902 Commits

Author SHA1 Message Date
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
Ed
0cb3aab9c2 Merge pull request #207 from xmos/release/v2.0.0
Release/v2.0.0 in support of XVF3610
2021-07-22 16:12:23 +01:00
Ed
4c6fb9f271 Merge pull request #205 from xmos/develop
Release pre for XVF3610
2021-07-22 15:00:09 +01:00
Ed
2bc36947a8 Merge pull request #206 from xmos/ed-xmos-patch-1
Fix module_build_info
2021-07-22 11:04:56 +01:00
Ed
7f001e1780 Fix module_build_info 2021-07-22 10:47:32 +01:00
Ed
a04d06303b Merge pull request #202 from mbanth/feature/configurable_hid
Add C and XC specific declarations of hidGetReportItem()
2021-07-08 08:34:00 +01:00
mbanth
9b153bbda5 Add C and XC specific declarations of hidGetReportItem() 2021-07-07 17:25:25 +01:00
Michael Banther
9d55c315c8 Merge pull request #201 from mbanth/feature/configurable_hid
Further Configurable HID enhancements
2021-07-07 11:39:51 +01:00
Ed
36a5163f4f Merge pull request #200 from xmos/feature/nullable_c_aud_ctl
Allow nullable chanend and insert asserts to capture invalid use
2021-07-07 08:31:48 +01:00
mbanth
e8e31ed8ff Move the Clock Block (again) 2021-07-06 17:26:30 +01:00
mbanth
afeac0fa81 Add list of Usage Pages 2021-07-06 17:11:46 +01:00
mbanth
46d8201ba6 Add change log entries 2021-07-06 16:51:03 +01:00
mbanth
5910638bed Add and modify unit tests 2021-07-06 16:47:58 +01:00
mbanth
f25a765e82 Add Get Report Item function and add Usage Page parameter to Set Report Item function 2021-07-06 16:47:31 +01:00
mbanth
e3068ad245 Use an unused clock block 2021-07-06 16:45:39 +01:00
Ed
1a5280ad14 Replace isnull with != null 2021-07-06 15:47:51 +01:00
Ed
4033b26587 Update API with note about nullable c_audioCtrl is passed 2021-07-06 15:13:55 +01:00
Ed
65103d8c88 Allow nullable chanend and insert asserts to capture invalid use 2021-07-06 15:05:21 +01:00
Michael Banther
364efa72c3 Merge pull request #199 from mbanth/feature/configurable_hid
Use v1.2.0 release of XUD
2021-06-29 11:22:28 +01:00
mbanth
3da2b12b59 Use v1.2.0 release of XUD 2021-06-28 16:43:02 +01:00
Luciano Martin
8c397b1514 Merge pull request #198 from lucianomartin/feature/multiple_spispecs
Allow DFU to support multiple flash devices
2021-06-28 16:10:30 +01:00
lucianom
55cfb7b7da Add missing brackets 2021-06-28 14:46:20 +01:00
lucianom
32e4fb55d3 Update description 2021-06-25 11:17:15 +01:00
lucianom
687c06864c Allow DFU to support multiple flash devices 2021-06-25 10:48:59 +01:00
Michael Banther
8c7dfab9f2 Merge pull request #196 from mbanth/feature/configurable_hid
Support configurable HID
2021-06-22 16:36:39 +01:00
mbanth
b711b3adf6 Update to version 2.0.0 2021-06-22 15:59:16 +01:00
mbanth
5c402f26c9 Add cmake files 2021-06-22 13:45:24 +01:00
mbanth
bec7111cfd Merge branch 'develop' of git@github.com:mbanth/lib_xua.git into feature/configurable_hid 2021-06-17 08:19:25 +01:00
Michael Banther
20cba85383 Merge pull request #194 from mbanth/feature/align_with_XUD
Align with XUD
2021-06-17 07:49:21 +01:00
mbanth
01c2874953 Added warning when re-booting and XS3 part 2021-06-16 16:16:13 +01:00
mbanth
5ea315fee8 Remove unused variable 2021-06-16 14:56:57 +01:00
mbanth
4dbe332b2c Add XS3 support and remove XS1 support 2021-06-16 14:47:03 +01:00
mbanth
0f0e8506b3 Remove unused symbol and obsolete comment 2021-06-16 14:46:31 +01:00
mbanth
ada99bd1d9 Remove XS1 support and tidy up white space 2021-06-16 14:46:02 +01:00
mbanth
a3617a641f Remove XS1 support 2021-06-16 13:33:26 +01:00
mbanth
f01bf03605 Remove arguments no longer supported by XUD 2021-06-16 13:08:22 +01:00
mbanth
a237472efb Define XUD_CORE_CLOCK to avoid warnings 2021-06-16 13:07:49 +01:00
mbanth
5fe76d3720 Remove XS1 support 2021-06-16 12:45:21 +01:00
mbanth
0130d3fb32 Define the XUD_CORE_CLOCK to avoid warnings 2021-06-16 12:45:02 +01:00
mbanth
45671148d5 Remove powersave directory from the list of include and source directories 2021-06-16 11:16:45 +01:00
mbanth
6f146cccbc Remove XS1-specific power saving functionality 2021-06-16 11:07:33 +01:00
mbanth
00eb07e637 Change MCLK clock block to avoid overlap with XUD 2021-06-15 16:25:19 +01:00
mbanth
a411b864c2 Replace linear event list with a representation based on bit and byte location in the HID Report 2021-06-11 15:20:30 +01:00
mbanth
1f6140c912 Include stddef.h to obtain the definition of size_t. 2021-06-11 15:19:36 +01:00
mbanth
e98c0b11bc Add change log entries 2021-06-09 16:29:28 +01:00
mbanth
285be1cd7a Update dependency on lib_xud to v2.0.0 2021-06-09 16:29:08 +01:00
mbanth
3f3007c3ac Remove arguments no longer used by XUD 2021-06-09 16:18:34 +01:00
mbanth
32e06c1ad2 Remove XS1 support and reassign clock block in conflict on XS3 2021-06-09 16:17:57 +01:00
mbanth
95b80ebf72 Fix incorrect comment 2021-06-09 16:17:02 +01:00
mbanth
25d4a74b59 Replace NO_USB symbol with XUA_USB_EN 2021-06-09 16:16:34 +01:00
Michael Banther
99be4c9005 Merge pull request #191 from mbanth/feature/configurable_hid
Create a configurable HID report
2021-06-08 10:24:52 +01:00
mbanth
05bf241ab8 Fix comment typos 2021-06-08 09:52:25 +01:00
mbanth
e401895314 Merge branch 'feature/update_legacy_test_xn_flash_spec' into feature/configurable_hid
Resolved Conflicts:
 legacy_tests/app_test_i2s_loopback/xk_216_mc/xk-audio-216-mc.xn
2021-06-07 15:21:56 +01:00
Michael Banther
ea5575a621 Merge pull request #190 from mbanth/feature/update_legacy_test_xn_flash_spec
Change to new flash part and add necessary parameters
2021-06-07 13:54:34 +01:00
mbanth
066231d86a Merge branch 'develop' into feature/update_legacy_test_xn_flash_spec 2021-06-07 13:31:31 +01:00
mbanth
108c551cef Add missing attributes 2021-06-07 13:24:23 +01:00
mbanth
008508c8ae Added change log entry 2021-06-04 17:04:20 +01:00
mbanth
6636e2f505 Add support for multi-byte HID Report 2021-06-04 16:27:54 +01:00
mbanth
b47a30a04c Remove debugging printf() 2021-06-04 16:27:17 +01:00
mbanth
567e5cc0e0 Fix bugs that prevented correct operation of HID Report descriptor. Add descriptive constants. 2021-06-04 15:18:51 +01:00
mbanth
382b1a8754 Add support for boot-time creation of the HID Report descriptor 2021-06-04 15:17:28 +01:00
mbanth
4446ab89c0 Limit the usage of hidGetReportDescriptor() to C only 2021-06-04 15:15:05 +01:00
mbanth
b871b4c046 Change interface to UserHIDRecordEvent function to support only binary event states 2021-06-03 16:01:45 +01:00
mbanth
fd45908ff6 Add function to return the length of the HID Report 2021-06-03 15:53:50 +01:00
mbanth
dab84e56df Add missing Flash programming parameters 2021-06-03 15:30:12 +01:00
mbanth
64805d203e Remove deprecated and ineffective compiler option 2021-06-03 15:28:58 +01:00
Michael Banther
9d41387b8a Merge pull request #192 from mbanth/feature/modify_hid_event_names
Remove unused GPI-specific event names and replace with generic ones
2021-06-03 11:16:47 +01:00
mbanth
162c9a14ce Remove duplicate change log entry 2021-06-03 10:51:23 +01:00
mbanth
345f5dc369 Merge branch 'feature/modify_hid_event_names' into feature/configurable_hid 2021-06-02 15:37:46 +01:00
mbanth
bc957cb593 Update change log 2021-06-02 15:12:12 +01:00
mbanth
12789a1bee Remove unused GPI-specific event names and replace with generic ones 2021-06-02 15:02:27 +01:00
mbanth
4c9130166c Rename a constant to match the expected name 2021-06-01 14:41:15 +01:00
mbanth
aec5bb8daa Remove duplicate copyright and license reference comments 2021-05-27 18:05:56 +01:00
mbanth
3106ccefcf Remove the redundant HID Report descriptor 2021-05-27 17:56:51 +01:00
mbanth
7b43785816 Makes each #define value a primary expression. Set the class length field in the HID descriptor to zero. 2021-05-27 17:56:26 +01:00
mbanth
0b9d970f75 Add HID Report descriptor definition to each App Note 2021-05-27 16:53:06 +01:00
mbanth
f2b09522b8 Remove dead code 2021-05-27 16:49:21 +01:00
mbanth
d0b2c77177 Update HID Report descriptor items 2021-05-27 16:31:07 +01:00
mbanth
cafdd8c93d Provide a HID Report descriptor definition for legacy tests 2021-05-27 16:07:10 +01:00
mbanth
13abe0e9e1 Update unit tests for explicit reset 2021-05-27 12:26:57 +01:00
mbanth
8a9d8cdd3e Add explicit reset 2021-05-27 11:54:31 +01:00
mbanth
3c129ab521 Update unit tests to align with Report descriptor defined in application 2021-05-27 11:37:25 +01:00
mbanth
dd7a8f423e Move HID Report descriptor to application 2021-05-27 11:36:36 +01:00
mbanth
a9e97b33b9 Add constant offset to the field in the HID descriptor that provides the length of the HID Report descriptor 2021-05-26 16:39:03 +01:00
mbanth
6adc94642a Attempt to correct the copyright date range 2021-05-26 14:07:06 +01:00
mbanth
33fcac9c47 Add pytest and pytest-xdist to the requirements, needed for unit tests 2021-05-26 13:21:58 +01:00
mbanth
7b433a40fc Assign an unused clock block to MCLK 2021-05-26 12:18:11 +01:00
mbanth
b81d096a5a Add XS1-specific XUD symbol to allow building with the current develop branch of lib_xud 2021-05-26 12:17:38 +01:00
mbanth
fc8a7a1ec9 Change to new flash part and add necessary parameters 2021-05-26 11:16:45 +01:00
mbanth
fcee74d912 Add Report descriptor length function. Change the internal Translate function to return the length of each item added to the raw buffer. Fix some out-of-date comments. 2021-05-25 16:51:54 +01:00
mbanth
d1650afd37 Avoid unnecessary preparation 2021-05-25 16:00:32 +01:00
mbanth
02596cc5a9 Clean-up 2021-05-25 15:12:45 +01:00
mbanth
a9dddfab2f Add tests: configurable and non-configurable items, and combined functions 2021-05-25 14:22:09 +01:00
mbanth
f3e8a1937f Add header tag and type tests 2021-05-25 12:07:11 +01:00
mbanth
b1f3cc0024 Add size range tests. Fix misspelled function name. 2021-05-25 11:23:18 +01:00
mbanth
46cac9afb9 Rename function and variable to better reflect its use beyond initialisation 2021-05-25 10:04:51 +01:00
mbanth
b552d60567 Add byte range tests 2021-05-25 08:59:20 +01:00
mbanth
3ae4a4e456 Add tests for max and min valid bit location and one for an underflow 2021-05-24 17:12:32 +01:00
mbanth
728980e7dc Add test that specifies a bit out-of-range when modifying a report item 2021-05-24 16:54:01 +01:00
mbanth
29ab72e614 Move constants needed by callers 2021-05-24 16:53:13 +01:00
mbanth
f1a1ee077f Add test for returning an initialized Report descriptor 2021-05-24 16:01:54 +01:00
mbanth
eb6d3b0869 Split functionality into test code in pure C and helper code in XC 2021-05-24 15:47:31 +01:00
mbanth
fbef825a3b Add include path to HID header files 2021-05-24 15:46:16 +01:00
mbanth
9cdbe9c62d Comment out xCore.AI unit test operation until the unit tests build successfully on that platform 2021-05-20 16:02:31 +01:00
mbanth
0e27c7f2ff Align with lib_agc Jenkinsfile regarding unit test operation 2021-05-20 15:58:30 +01:00
mbanth
c0dade0156 Updated trivial test. Builds for xCore200 with minimal warnings. 2021-05-20 15:47:02 +01:00
mbanth
ede81bd5f7 Working infrastructure for xCore200 2021-05-20 15:29:25 +01:00
mbanth
7836aacf47 Do not track Unity test runners 2021-05-20 15:14:55 +01:00
mbanth
4ffe3d94c7 Reverse the dependencies (yet again) and target only xCore-200 2021-05-19 18:08:49 +01:00
mbanth
0f47ef96be Reverse dependency order (again) 2021-05-19 18:02:05 +01:00
mbanth
496dd16431 Remove dual issue configuration 2021-05-19 17:57:22 +01:00
mbanth
cbf2320de6 Change order of dependency list 2021-05-19 17:41:53 +01:00
mbanth
ae5d364226 Add XUD to the dependency list 2021-05-19 17:11:43 +01:00
mbanth
bd805acf04 Correct headers 2021-05-19 17:06:58 +01:00
mbanth
9b2efd07ad Add unit test infrastructure 2021-05-19 16:07:40 +01:00
mbanth
1ddbfdd8c1 Merge branch 'develop' into feature/generic_hid_report 2021-05-19 14:31:31 +01:00
Michael Banther
2c5058d953 Merge pull request #188 from mbanth/feature/rename_legacy_test_dir
Move xmostest tests
2021-05-19 14:14:45 +01:00
mbanth
294d3a469e Set up for parallel testing 2021-05-19 13:45:04 +01:00
mbanth
f66ddc53eb Move legacy tests one level up in the directory hierarchy 2021-05-19 10:55:33 +01:00
mbanth
e55aa3ca8e Merge branch 'feature/rename_legacy_test_dir' into feature/generic_hid_report 2021-05-19 10:27:51 +01:00
mbanth
368031064a Merge branch 'develop' into feature/generic_hid_report 2021-05-19 10:26:32 +01:00
mbanth
e6c8766bb7 Update change log 2021-05-19 10:10:51 +01:00
mbanth
844cfb2ec2 Merge branch 'develop' into feature/rename_legacy_test_dir 2021-05-19 10:08:28 +01:00
Michael Banther
a44d5466b5 Merge pull request #187 from mbanth/feature/refactor_hid_descriptors
Feature/refactor hid descriptors
2021-05-19 10:06:14 +01:00
mbanth
0ed4ed0974 In preparation for adding unit tests, move xmostest-based legacy tests into a legacy_tests sub-directory of the tests directory 2021-05-19 09:59:46 +01:00
mbanth
a8ba18094f Initial implementation, compiles w/o error, not tested 2021-05-18 16:48:54 +01:00
mbanth
89fe6c4d5d Increase version number 2021-05-13 16:18:02 +01:00
mbanth
4b6a3697ac Move change log entry to a new version 2021-05-13 16:16:52 +01:00
mbanth
703ba4975a Manually revert Wake Word HID event from 't' back to AC Search 2021-05-13 15:12:20 +01:00
mbanth
8a869ce230 Update change log 2021-05-10 18:11:17 +01:00
mbanth
6b9249507d Define descriptor values 2021-05-10 12:26:38 +01:00
mbanth
c31f1521c2 Removed unnecessary #include 2021-05-10 10:29:13 +01:00
mbanth
35fe4fadeb Remove header guards. Since these files only include initialisation lists, no guard is needed. For UAC1 operation, one file has to be included twice, so including a guard breaks the implementation. 2021-05-07 16:46:37 +01:00
mbanth
7d7ec6858d Remove unnecessary #include 2021-05-07 16:35:30 +01:00
mbanth
cf5c486c62 Remove #if from comment to allow easier verification that each #if has a corresponding #end 2021-05-07 14:34:30 +01:00
mbanth
d765ba1dfb Re-factor HID descriptors 2021-05-07 10:11:55 +01:00
mbanth
49f1739098 Re-factor HID descriptors. 2021-05-06 17:16:24 +01:00
Luciano Martin
5bdfc61c3b Merge pull request #184 from xmos/release/v1.2.0
Merge release/v1.2.0 into master
2021-05-06 13:36:47 +01:00
Luciano Martin
679a8bb0e3 Merge pull request #186 from xmos/develop
Merge develop into release/v1.2.0
2021-05-05 15:29:13 +01:00
Luciano Martin
3a2497c8bf Merge pull request #185 from xmos/feature/remove_license_files
Remove license files in test folders
2021-05-05 15:28:44 +01:00
lucianom
70748bd106 Remove license files in test folders 2021-05-05 15:03:03 +01:00
Luciano Martin
0f09ae47e8 Merge pull request #183 from xmos/develop
Merge develop into release/v1.2.0
2021-05-05 13:58:34 +01:00
mbanth
21eee27d64 Merge branch '8c2dea71dc6c7dfb9d69f7d151f5aecd9845df65' into feature/configurable_hid 2021-05-04 13:00:58 +01:00
mbanth
8c2dea71dc Merge branch 'feature/HID_AC1_sync_desc_length' into feature/HID_keycode_t 2021-04-27 17:06:30 +01:00
mbanth
c3a45b2cba Change AC Search to Key code t or T 2021-04-27 17:06:19 +01:00
Michael Banther
39fab60a61 Merge pull request #181 from mbanth/feature/HID_AC1_sync_desc_length
AC1 HID descriptor
2021-04-27 17:01:39 +01:00
mbanth
0f392ffbb6 Update change log 2021-04-27 16:35:05 +01:00
mbanth
700ba975e7 Use sizeof to set length of the HID Report Descriptor reported in AC1 HID descriptor. Add comments to #endif statements. 2021-04-27 16:27:48 +01:00
danielpieczko
abf9f5e1a2 Merge pull request #180 from xmos/feature/public_licence
Use public licence
2021-04-23 11:49:57 +01:00
Daniel Pieczko
45c5f35165 Fix readme 2021-04-23 10:52:15 +01:00
Daniel Pieczko
7ca9bc22fd Add changelog entry 2021-04-22 17:18:26 +01:00
Daniel Pieczko
0aa60035a4 Update copyright notices and licence references 2021-04-22 17:17:39 +01:00
Daniel Pieczko
6f75a44d9c Use XMOS Public Licence Version 1 2021-04-22 17:15:08 +01:00
Brennan Magee
06e3439452 Merge pull request #177 from BrennanGit/feature/xjsl_0.16.2
Update Jenkins shared library
2021-03-11 15:42:08 +00:00
Brennan Magee
d161ed168c Update Jenkins shared library
This repo is still using an old version that is sensitive to brew upgrades of the python version
seen here: http://srv-bri-jcim0:8080/view/sw_xvf3510_develop/job/XMOS/job/lib_xua/job/develop/404/
2021-03-10 10:26:05 +00:00
Ed
53e0fbdcc8 Merge pull request #176 from xmos/feature/xs3_support
Add XS3 support in reboot
2021-03-09 17:06:47 +00:00
Ed
2e86563274 License date 2021-03-09 16:47:45 +00:00
Ed
f3063fdfc3 Update dates 2021-03-09 16:37:27 +00:00
Ed
90f8ede387 Add XS3 support in reboot 2021-03-09 14:42:16 +00: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
oscarbailey-xmos
c9299fce96 Merge pull request #174 from xmos/feature/6.15.3_fixes
Document 50 and 500 msec delays before DFU resets (sc_usb_audio 49e2ce9)
2020-12-08 16:39:57 +00:00
oscarbailey-xmos
30e8ba3717 Merge pull request #136 from xmos/xross-patch-1
Further updates for xs3 compat
2020-12-08 16:36:34 +00:00
oscarbailey-xmos
17bd4939a8 Merge pull request #137 from xmos/xross-patch-2
Update fastmix.S for xs3 compat
2020-12-08 16:36:16 +00:00
Oscar Bailey
04a991b37e Document 50 and 500 msec delays before DFU resets (sc_usb_audio 49e2ce9) 2020-12-08 16:02:57 +00:00
oscarbailey-xmos
9bdaf7ece6 Update CHANGELOG.rst 2020-12-08 15:57:39 +00:00
oscarbailey-xmos
05888a715f Merge branch 'develop' into xross-patch-2 2020-12-08 15:55:27 +00:00
oscarbailey-xmos
5d66159b40 Update copyright notice 2020-12-08 15:54:51 +00:00
oscarbailey-xmos
b9aae2092c Merge pull request #135 from xmos/feat/xs3
Update audioports for xs3 build
2020-12-08 15:53:43 +00:00
oscarbailey-xmos
23252ac323 Update copyright notice 2020-12-08 15:53:32 +00:00
oscarbailey-xmos
4a966aaa82 Merge pull request #157 from oscarbailey-xmos/feature/fix-hid-compiler-errors
Fix compiler errors when HID_CONTROLS > 0
2020-12-02 10:25:28 +00:00
oscarbailey-xmos
b31c9c6ab1 Merge pull request #73 from oscarbailey-xmos/feature/windows-dfu
Update xmosdfu
2020-12-02 10:24:30 +00:00
Oscar Bailey
16a927d63b Fix copyright notices 2020-11-24 16:40:55 +00:00
Oscar Bailey
7fc1f254b7 Update CHANGELOG 2020-11-24 15:24:02 +00:00
Oscar Bailey
7e7c557f38 Merge branch 'feature/windows-dfu' into feature/fix-hid-compiler-errors 2020-11-24 15:21:12 +00:00
Oscar Bailey
6dbff06dce Fix typo in pdm_mic.xc causing firmware crash 2020-11-10 14:35:54 +00:00
Oscar Bailey
46a304d545 Update LICENCE.txt 2020-10-29 10:22:04 +00:00
Oscar Bailey
eb9a90574e Update documentation and scripts to match xmosdfu changes 2020-10-27 15:28:32 +00:00
Oscar Bailey
60e23eb5cd Fix xmosdfu returning non-zero return code on success 2020-10-27 14:19:17 +00:00
Oscar Bailey
7465bc057b Fix copyright notice; Fix CHANGELOG 2020-10-27 13:45:59 +00:00
Oscar Bailey
3920ab831c Add line to changelog (fix issue #119) 2020-10-27 13:20:06 +00:00
Oscar Bailey
a57a45fd67 Add alias for _fileno (Windows xmosdfu) 2020-10-27 13:16:16 +00:00
Oscar Bailey
3a917e5161 Attempt to handle error case where input file is a directory 2020-10-27 13:14:34 +00:00
Oscar Bailey
a496040de0 Fix compiler warning for xmosdfu on Linux 2020-10-27 11:54:07 +00:00
Oscar Bailey
b85cb85205 xmosdfu now compiles to bin/; Add more compile tests to Jenkinsfile 2020-10-27 11:28:55 +00:00
Oscar Bailey
bf40fee271 Update version in module_build_info 2020-10-27 11:12:43 +00:00
Oscar Bailey
3076bdffcf Update CHANGELOG and default BCD 2020-10-27 11:01:58 +00:00
Oscar Bailey
32fd9c652b Merge branch 'develop' into feature/windows-dfu 2020-10-27 10:53:37 +00:00
Oscar Bailey
baa853985b Fix compiler errors when HID_CONTROLS > 0 2020-10-21 14:50:50 +01:00
Luciano Martin
758de74946 Merge pull request #154 from xmos/release/v1.1.1
Merge release/v1.1.1 into master
2020-10-08 13:56:12 +01:00
Luciano Martin
e6f6856df9 Merge pull request #153 from xmos/develop
Merge develop into release/v1.1.1
2020-10-07 16:29:27 +01:00
Luciano Martin
871ffbc5dd Merge pull request #152 from xmos/feature/remove_cpan_file
Remove not necessary cpanfile
2020-10-07 16:28:08 +01:00
lucianom
dde097b130 Remove not necessary cpanfile 2020-10-07 14:31:15 +01:00
Michael Banther
e8731a554c Merge pull request #151 from lucianomartin/feature/update_changelog
Add entry
2020-10-06 11:10:45 +01:00
lucianom
0766275a9a Add entry 2020-10-05 13:21:08 +01:00
Michael Banther
ce4424c471 Merge pull request #150 from xmos/feature/update_jsl
Update pinned version of xmos_jenkins_shared_library
2020-10-02 12:31:09 +01:00
lucianom
740f1250c7 Update pinned version of xmos_jenkins_shared_library 2020-10-02 11:19:02 +01:00
Michael Banther
45d699321d Merge pull request #148 from lucianomartin/feature/replace_pipfile
Replace Pipfile with requirements.txt file
2020-09-30 09:46:44 +01:00
lucianom
e0b8cdf5f7 Replace Pipfile 2020-09-22 09:00:36 +01:00
oscarbailey-xmos
ecaeb89ea8 Merge pull request #146 from ed-xmos/feature/fix_i2s_pushout_at_startup
Cherry pick decouple bug fix (v0.1.4) that solves the I2S timing issue
2020-09-21 09:36:56 +01:00
Ed
c4f32aceab Update changelog 2020-09-03 17:19:01 +01:00
Ed
2164d8d023 Cherry pick decouple bug fix (v0.1.4) that solves the I2S timing pushout on startup 2020-09-02 11:56:05 +01:00
Ed
a08060896d Merge pull request #143 from xmos/bump_version
Bump!
2020-06-22 16:55:28 +01:00
Ed
948546e0d0 Bump! 2020-06-22 16:29:18 +01:00
Michael Banther
ab2519ab4f Merge pull request #142 from xmos/release/v1.1.0
Release v1.1.0
2020-05-20 14:55:41 +01:00
Michael Banther
94ea3ba306 Merge pull request #141 from xmos/develop
Release v1.1.0
2020-05-20 14:22:58 +01:00
Michael Banther
3a4e626472 Merge pull request #140 from xmos/feature/update-JSL-v0.14.1
Update Jenkins Shared Library to v0.14.1
2020-05-20 12:17:19 +01:00
mbanth
a61f0e7a5f Update Jenkins Shared Library to v0.14.1 to correct a Groovy iteration bug that results in intermittent test failures. 2020-05-20 11:46:17 +01:00
Michael Banther
cd29ca91e3 Merge pull request #139 from lucianomartin/feature/serial_str_methods
Ability to read or modify serial number string
2020-05-19 16:29:40 +01:00
lucianom
7ccd5b526d Set iSerial correctly 2020-05-19 16:11:34 +01:00
lucianom
5c2a69288c Add missing bracket 2020-05-19 15:26:27 +01:00
lucianom
fda4c3afb1 Remove empty line 2020-05-19 14:12:51 +01:00
lucianom
05dacde043 Add SERIAL_STR configurable from xua_conf.h 2020-05-19 13:45:52 +01:00
lucianom
b7cbc5fe9e Ability to read or modify serial number string 2020-05-19 12:43:56 +01:00
Michael Banther
468b69cb62 Merge pull request #138 from xmos/feature/update-fastmix-copyright
Update copyright date range.
2020-05-14 16:26:56 +01:00
mbanth
74772d864e Update copyright date range. 2020-05-14 14:47:31 +01:00
xross
c18ca44768 Revert "Mixer update for XS3 compat"
This reverts commit 82f651d930.
2020-05-14 13:55:27 +01:00
Ross Owen
801e3fbe4e Update interrupt.h 2020-05-05 16:37:17 +01:00
Ross Owen
57932ee0df Update fastmix.S 2020-05-05 16:36:11 +01:00
Ross Owen
82f651d930 Mixer update for XS3 compat 2020-05-05 16:35:22 +01:00
Ross Owen
44d3e08305 Further updates for xs3 combat 2020-05-05 16:33:51 +01:00
Ross Owen
da3da9b422 Update audioports.xc 2020-05-01 16:39:41 +01:00
Michael Banther
3d9266a080 Merge pull request #134 from xmos/release/v1.0.1
Release v1.0.1
2020-05-01 15:54:39 +01:00
Michael Banther
4ac07b2df4 Merge pull request #132 from xmos/develop
Release v1.0.1
2020-05-01 15:05:25 +01:00
Michael Banther
afcf576d43 Merge pull request #133 from xmos/feature/update-Jenkinsfile
Update to Jenkins Shared Library v0.12.1
2020-05-01 14:43:33 +01:00
mbanth
bb73f2140e Update to Jenkins Shared Library v0.12.1 and allow view file names containing '.'. 2020-05-01 13:51:05 +01:00
Luciano Martin
c260039d0b Merge pull request #131 from lucianomartin/develop
Fix wrong size of vendor and product strings and add debug printouts
2020-04-17 16:33:30 +01:00
lucianom
a89371c143 Fix wrong size of vendor and product strings and add debug printouts 2020-04-17 14:44:19 +01:00
Michael Banther
f3ab9a8532 Merge pull request #130 from mbanth/feature/update_min_ver
Update dependent minimum versions
2020-03-20 14:11:42 +00:00
mbanth
fff1568c6f Update minimum dependency version for libraries with a higher major version 2020-03-19 16:21:57 +00:00
Michael Banther
5a13a1b751 Merge pull request #128 from xmos/develop
Early March 2020 release
2020-03-16 11:57:07 +00:00
Ed
2ada7e7534 Merge pull request #129 from ed-xmos/test_harness
Test harness needs access to internal state
2020-03-16 11:18:55 +00:00
Ed
c9989e4d87 Changelog 2020-03-12 10:20:30 +00:00
Ed
a1cb1336cd Merge commit 'ae599686ac5670c318a63cacc1bae5ea0318a9b6' into develop 2020-03-11 16:02:11 +00:00
Ed
bd71651cc4 Allow access of mclk setting externally for hardware test harness 2020-03-11 16:01:42 +00:00
Michael Banther
ae599686ac Merge pull request #127 from mbanth/feature/update_major_version
Update version number to indicate the first major release.
2020-03-10 11:29:13 +00:00
mbanth
045059ad1e Update version number to indicate the first major release.
The version number has been changed since the library is used in a
released product.
2020-03-10 10:53:21 +00:00
Luciano Martin
572bbdc8ff Merge pull request #126 from lucianomartin/feature/usb_str_cmds
Add new functions to read and write product and vendor strings
2020-03-05 11:51:31 +00:00
lucianom
4d0de4e01a Add missing string and memset buffers 2020-03-05 10:15:35 +00:00
lucianom
5fd34acab5 Allocate separate strings and fix descriptions 2020-03-05 09:14:03 +00:00
lucianom
c786b846d0 Define MIN if not defined 2020-03-04 22:05:36 +00:00
lucianom
09a81f5c1f Use standard functions and different empty strings 2020-03-04 21:53:49 +00:00
lucianom
ee1feb6c48 Use unsafe pointers 2020-03-04 17:51:03 +00:00
lucianom
3f2d0eb6f7 Move global variables 2020-03-04 17:16:35 +00:00
lucianom
b5d2aae3d6 Update entry 2020-03-04 17:12:13 +00:00
lucianom
d146435d07 Add XUA_Endpoint0_setStrTable() function 2020-03-04 17:10:36 +00:00
lucianom
ae27cfa89b Merge branch 'develop' of github.com:xmos/lib_xua into feature/usb_str_cmds 2020-03-03 22:52:47 +00:00
lucianom
e8bdaf8004 Add USB string functions 2020-03-03 22:52:36 +00:00
Michael Banther
db005a08ed Merge pull request #124 from xmos/develop
Early March 2020 release
2020-03-03 15:13:29 +00:00
chrisc-xmos
1dbad0ff89 Merge pull request #125 from larry-xmos/feature/configurable_bcd_device
Configurable bcdDevice
2020-03-03 07:57:31 +00:00
Larry Snizek
40ab0b563c Add commands to configure USB bcdDevice version 2020-03-02 16:02:26 +00:00
shuchitak
2175103510 Merge pull request #123 from shuchitak/feature/configurable_usb_rate_res
Feature/configurable usb rate res
2020-02-28 12:23:05 +00:00
shuchitak
73015bc44f remove extern from function declaration 2020-02-28 11:22:26 +00:00
shuchitak
8b52c83b4c include stdint.h 2020-02-28 10:38:54 +00:00
shuchitak
0978f0d50d Merge pull request #2 from keithauxmos/feature/configurable_usb_res_rate_shuchita
fixed typo of comments
2020-02-28 09:42:34 +00:00
Keith Au
cd8e46308f renamed xua_api.h to xua_usb_params_funcs.h 2020-02-28 17:14:47 +08:00
Keith Au
dbaf66fdb2 removed #if XC check 2020-02-28 17:08:58 +08:00
Keith Au
d3f2220be4 added xua_api.h for extern declaration of get/set_usb_to/from_device_rate/res APIs and removed from c/xc files 2020-02-28 15:53:27 +08:00
Keith Au
d125860552 changed define name USB_DESCRIPTOR_OVERRIDE_RATE_RES to XUA_USB_DESCRIPTOR_OVERWRITE_RATE_RES 2020-02-28 10:48:46 +08:00
Keith Au
11c8d56657 Merge branch 'feature/configurable_usb_rate_res' of github.com:shuchitak/lib_xua into feature/configurable_usb_res_rate_shuchita 2020-02-24 11:46:35 +08:00
shuchitak
abbafba3a7 changelog and source 2020-02-20 09:59:52 +00:00
shuchitak
b31028a3d6 undo copyright change 2020-02-20 09:28:16 +00:00
shuchitak
4ae9956a13 changelog + source check 2020-02-20 09:20:24 +00:00
shuchitak
be45d04423 undo changes in xua_ep0_uacreqs 2020-02-19 15:45:58 +00:00
Keith Au
0b5ddbd85e fixed typo of comments 2020-02-19 16:52:52 +08:00
shuchitak
c63df2e961 update g_curSubSlot_Out and g_curSubSlot_In under #if USB_DESCRIPTOR_OVERRIDE_RATE_RES 2020-02-18 10:20:25 +00:00
shuchitak
050d7757bc removed unused defines 2020-02-18 09:04:57 +00:00
shuchitak
ee239ba18c Merge pull request #1 from keithauxmos/feature/configurable_usb_res_rate_shuchita
removed USB_CMD_CFG_SAMP_FREQ related codes
2020-02-18 08:33:09 +00:00
Keith Au
1efe7c8822 removed USB_CMD_CFG_SAMP_FREQ related codes 2020-02-18 15:40:53 +08:00
shuchitak
dac808e9fa get usb_adaptive to compile 2020-02-17 12:09:54 +00:00
Keith Au
6402051165 Merge branch 'develop' into feature/configurable_rate_res 2020-02-14 17:05:57 +08:00
Keith Au
07b829cd7e further renamed global variables and APIs 2020-02-13 17:11:58 +08:00
Keith Au
76f12ccad6 rename default frequency naming 2020-02-13 16:35:21 +08:00
Keith Au
cb842df492 remove unnecessary AUDIO_CLASS checking 2020-02-13 16:10:57 +08:00
Keith Au
27c99623ac update Changelog 2020-02-13 15:54:46 +08:00
Keith Au
18cef82b06 modified to have USB out frequency be informed to c_audioControl after getting EP0 request 2020-02-13 15:48:46 +08:00
Keith Au
23cf086b84 replace all tab by 4 spaces 2020-02-13 15:33:43 +08:00
Keith Au
ed6ad4ce9f remove unused USB descriptor lines under USB_CMD_CFG_SAMP_FREQ in xua_ep0_descriptor.h 2020-02-13 15:05:45 +08:00
Keith Au
40a2ac6d73 moved the flow of changing USB descriptor values to XUA_Endpoint0_init() 2020-02-13 14:17:46 +08:00
oscarbailey-xmos
0a8db236f1 Merge pull request #122 from lucianomartin/feature/vid_pid_config
Add API functions for VID and PID
2020-02-12 10:00:22 +00:00
lucianom
035970c7a9 Fix description 2020-02-12 09:27:32 +00:00
lucianom
c8da4ca8f6 Fix typo 2020-02-11 16:54:48 +00:00
lucianom
f1b6a0b903 Fix typo 2020-02-11 16:53:38 +00:00
Keith Au
86c8bc9128 commit after updating to latest develop branch on 10 Feb 2020 2020-02-11 12:07:27 +08:00
Keith Au
d5d9c6ebc4 Merge branch 'develop' of github.com:xmos/lib_xua into feature/configurable_rate_res 2020-02-10 10:31:33 +08:00
lucianom
bef8fad109 Add new API functions for VID and PID 2020-02-07 19:17:24 +00:00
Keith Au
2c44f2c323 replace old g_BitResolution variable with latest API 2020-02-06 15:09:34 +08:00
Keith Au
e99d1cc486 remove extern reference to freq/bitres global variable 2020-02-04 16:16:05 +08:00
Keith Au
03b5dd6319 changed global variables to be accessed by APIs 2020-02-04 15:04:38 +08:00
Keith Au
a46c8b134a added default values for bit resolutions 2020-01-31 17:06:04 +08:00
Keith Au
f6d5bffad5 modified codes to change USB descriptor according to bit resolution variable values 2020-01-31 16:44:52 +08:00
Kevin Yeung
ad7ce6369e modified to change bit resolution 2020-01-31 12:34:35 +08:00
oscarbailey-xmos
a4507a172e Merge pull request #118 from larry-xmos/feature/dfu_detach_time_out
Expose DFU detach timeout value
2020-01-30 16:53:16 +00:00
Larry Snizek
5c5d7cb077 Merge develop into feature/dfu_detach_time_out 2020-01-27 12:53:59 +00:00
Larry Snizek
8666722798 Library checks 2020-01-21 16:45:54 +00:00
Larry Snizek
ae2f19224e Expose DFU detach timeout value 2020-01-21 16:12:38 +00:00
chrisc-xmos
75efab4a41 Merge pull request #117 from shuchitak/feature/gpi_to_hid_event
added an invalid event type
2020-01-21 15:47:34 +00:00
shuchitak
4e13f9e442 added an invalid event type 2020-01-21 11:32:36 +00:00
oscarbailey-xmos
b324bb04c8 Merge pull request #116 from mbanth/feature/hid_gpi_to_evt
Feature/hid gpi to evt
2020-01-20 09:48:53 +00:00
Keith Au
6485830a73 implemented descriptor handler flow for USB_DESCRIPTOR_OVERRIDE_RATE_RES 2020-01-20 16:14:09 +08:00
mbanth
dac71e8b38 Update copyright date range 2020-01-17 13:16:26 +00:00
mbanth
90edaebc6e Add comment to change log 2020-01-17 13:13:28 +00:00
mbanth
97e6ae4269 Shift bit flags to reflect the change to generic HID events.
Use AC Search to report Wake-phrase detection and AC Stop to report End
Call detection.
2020-01-17 11:55:19 +00:00
Michael Banther
27bf0e4fc4 Merge pull request #114 from mbanth/feature/hid_new_interface
Feature/hid new interface
2020-01-16 15:24:18 +00:00
mbanth
16138c2d42 Update copyright date range. 2020-01-16 12:27:25 +00:00
mbanth
7530591a64 Put trailing white space back because the License file check currently
fails if it's missing.
2020-01-16 12:18:33 +00:00
mbanth
6e184af899 Update copyright date range. 2020-01-16 12:07:24 +00:00
mbanth
c2f2ef1999 Merge branch 'develop' into feature/hid_new_interface 2020-01-16 11:07:46 +00:00
Keith Au
2f4da7f262 adding variable reference freqency support. Currently only 48kHz work 2020-01-16 15:05:41 +08:00
Keith Au
1ef566a570 modified AudioEndpointRequests_1 to distinguish between ep0 request for USB in and out 2020-01-13 10:15:10 +08:00
Keith Au
f6d0ede133 added USB IN alternate setting descriptor 2020-01-09 16:50:17 +08:00
mbanth
8f2509845a Update change log. 2020-01-08 11:09:03 +00:00
Keith Au
eae62a9e3c moved defined to xua_conf.h. Fixed bug that causes compile error 2020-01-08 13:49:54 +08:00
chrisc-xmos
95f39ae590 Merge pull request #113 from mbanth/feature/hid_reliance_custom_usages
Replace the HID Report descriptor with one that uses the Usage values
2020-01-07 17:36:10 +00:00
mbanth
4d5c0ec394 Merge branch 'feature/hid_reliance_custom_usages' into feature/hid_new_interface 2020-01-07 15:17:11 +00:00
mbanth
f189f02c02 Revert "Revert "Modify the interface to the User HID functionality.""
This reverts commit d81af18d1f.
2020-01-07 14:58:08 +00:00
mbanth
a2ff2897f9 Update license to new year. 2020-01-07 11:52:24 +00:00
Keith Au
5361ef8866 added option USB_CMD_CFG_SAMP_FREQ that allows host to conifgure sampling rate by endpoint command 2020-01-07 17:58:20 +08:00
Keith Au
6b1da7610f revert xua_ep0_uacreqs.xc so that frequency global variable is not affected by USB command. Now frequency can be varied by changing the default value. 2020-01-07 15:01:54 +08:00
mbanth
ad453c8a82 Update change log to keep Jenkins happy. 2020-01-06 17:22:57 +00:00
mbanth
67764fb0e8 Update change log. 2020-01-06 17:13:58 +00:00
Keith Au
3b80f63cb9 modified audio output frequency as a variable 2019-12-31 10:34:32 +08:00
mbanth
6eb30c5646 Replace the HID Report descriptor with one that uses the Usage values
specified by Reliance in their Reliance Jio Infocomm Limited, RJIL Devices,
VoicePoD, Technical Requirements Document, Rev. No. 2.0, Date 18-12-2019.
2019-12-20 13:37:54 +00:00
Michael Banther
edb020da9d Merge pull request #111 from mbanth/feature/hid_4bit_reliance_jan_demo
Feature/hid 4bit reliance jan demo
2019-12-19 15:16:01 +00:00
mbanth
d81af18d1f Revert "Modify the interface to the User HID functionality."
This reverts commit 538f2be5b4.

On branch feature/hid_4bit_reliance_jan_demo
Changes to be committed:
modified:   lib_xua/src/core/buffer/ep/ep_buffer.xc
modified:   lib_xua/src/core/user/hid/user_hid.h
2019-12-19 09:52:13 +00:00
mbanth
538f2be5b4 Modify the interface to the User HID functionality.
Setting the HID data use to occur through a global variable.  It now occurs
through a function call.  A list of general HID events has been provided as
well.
2019-12-18 12:09:11 +00:00
mbanth
02185f6701 Merge branch 'feature/hid_4bit_reliance_jan_demo' into experiment/hid_boot_time_config
# Conflicts:
#	lib_xua/src/core/user/hid/user_hid.h -- Manually resolved
2019-12-16 15:34:44 +00:00
mbanth
8b6f6bc8e1 Revert "Remove unnecessary Input statements."
This reverts commit 9f1e9735b8.
2019-12-16 15:13:53 +00:00
mbanth
9f1e9735b8 Remove unnecessary Input statements. 2019-12-16 14:53:38 +00:00
mbanth
1ee146ef60 Define each active bit field separately. 2019-12-16 12:33:59 +00:00
mbanth
e5389e4348 Added support for AC Stop (End Call), Volume Increment and Volume
Decrement bit fields in the HID report.
2019-12-13 18:17:36 +00:00
Michael Banther
31bb86c161 First changes to move to a USB HID design that allows some degree of boot-time configurability.
These changes are far from complete.  They build successfully, but have received very little bench testing.
2019-12-11 16:02:16 +00:00
oscarbailey-xmos
d8f34aa64d Merge pull request #109 from mbanth/feature/pendragon_merge_cleanup
Feature/pendragon merge cleanup
2019-12-06 10:09:36 +00:00
Michael Banther
746635b2eb Update change log. 2019-12-05 18:01:14 +00:00
Michael Banther
83284620cc Explain the need for using the assembler gettime operation instead of an XC timer more fully. 2019-12-05 16:45:49 +00:00
Michael Banther
255e9f75b5 Add missing header file guards. 2019-12-05 16:45:11 +00:00
oscarbailey-xmos
3a5b982774 Merge pull request #107 from mbanth/feature/pendragon
Add missing definition of MIC_DUAL_FRAME_SIZE
2019-11-27 09:27:26 +00:00
Michael Banther
daf378e4a5 Add in the code to call HidInterfaceClassRequests(). It was inadvertently removed during the removal of the XUA_Endpoint0_lite_loop() function. 2019-11-26 11:37:38 +00:00
Michael Banther
471ab4548a Move the override of MIC_ARRAY_FRAME_SIZE from mic_array_conf.h in lib_xua to ap_conf.h in sw_xvf3510/app_xk/xvf3510_l71.
This constant is only used in the audio pipelines, hence does not belong in the configuration of XUA.
2019-11-25 13:48:58 +00:00
Michael Banther
f22027564d Use the XUA-specific microphone frame size constant instead of directly overriding the microphone frame size constant from lib_mic_array.
Multiple constants may be derived from XUA_MIC_FRAME_SIZE.  The override of MIC_ARRAY_FRAME_SIZE occurs in mic_array_conf.h.
2019-11-25 12:10:26 +00:00
Michael Banther
82404f539c Merge commit 'a85cbc06b80dcd1ba2c8dd80644871e5579b9fa9' into feature/pendragon 2019-11-22 11:59:29 +00:00
oscarbailey-xmos
a85cbc06b8 Update CHANGELOG.rst 2019-11-22 11:27:59 +00:00
oscarbailey-xmos
6d01aa5cb8 Merge pull request #108 from xmos/feature/adaptive-fix
Fix descriptors for XUA_ADAPTIVE
2019-11-22 11:25:30 +00:00
Michael Banther
82d364a25d Disable single-threaded mic array processing for these examples. Remove the unnecessary definition of MIC_ARRAY_FRAME_SIZE. 2019-11-22 11:19:07 +00:00
Michael Banther
3a1c1b0265 Only override the value of MIC_DUAL_FRAME_SIZE if MIC_DUAL_ENABLED is set to true. 2019-11-22 10:08:36 +00:00
Michael Banther
eeca5fdd60 Move the default definition of MIC_ARRAY_MAX_FRAME_SIZE_LOG2 to mic_array_conf.h so that an assembler file can pick it up using a #include. 2019-11-21 17:32:39 +00:00
Michael Banther
241afbe7e6 Establish a default value for XUA_MIC_FRAME_SIZE. 2019-11-21 16:58:24 +00:00
Michael Banther
2aaa12e60b Remove the default definition of MIC_ARRAY_MAX_FRAME_SIZE_LOG2. It has been moved to mic_array_frame.h. Establish a value for MIC_ARRAY_FRAME_SIZE and MIC_DUAL_FRAME_SIZE if they have not already been defined. Give them the value of XUA_MIC_FRAME_SIZE in this case. 2019-11-21 16:57:56 +00:00
Oscar Bailey
6b454b0ebe Fix descriptors for XUA_ADAPTIVE 2019-11-20 11:43:32 +00:00
Michael Banther
4ff6815d07 Add missing #define and switch to using the single-threaded, dual PDM microphone design. 2019-11-19 10:35:22 +00:00
Michael Banther
e097b5dc3d Update copyright date range. 2019-11-19 09:59:37 +00:00
Michael Banther
f594d1d423 Add missing #define and update copyright date range. 2019-11-19 09:59:18 +00:00
Michael Banther
c8299998c8 Update copyright date range. 2019-11-18 13:16:05 +00:00
Michael Banther
f91728485c Add missing constant 2019-11-18 13:08:44 +00:00
Michael Banther
9674ae3328 Update copyright date range. 2019-11-18 11:36:41 +00:00
Michael Banther
192d8f54d7 Update copyright date range. 2019-11-18 11:28:42 +00:00
Michael Banther
3b6f6b6a10 Added comment to change log. 2019-11-18 11:18:46 +00:00
Michael Banther
5c3cff6a91 Add missing #defines.
The XUA library code now depends on these constants.
2019-11-18 11:15:00 +00:00
Michael Banther
fecc01d203 Update the copyright date. 2019-11-15 17:19:44 +00:00
Michael Banther
e0c7272190 Add missing definition of MIC_DUAL_FRAME_SIZE. Use the MIC_ARRAY_FRAME_SIZE value from lib_xua. 2019-11-15 14:29:49 +00:00
Michael Banther
23e5094e50 Merge pull request #103 from mbanth/feature/pendragon
Feature/pendragon
2019-11-15 12:30:22 +00:00
Michael Banther
ec396961be Remove XUA_Endpoint0_lite_init() and XUA_Endpoint0_lite_loop() functions which are not used. 2019-11-14 14:19:51 +00:00
Michael Banther
b0a26351ce Update copyright notices. 2019-11-11 13:41:07 +00:00
Michael Banther
3f03dae23d Add missing copyright notices. 2019-11-11 13:40:47 +00:00
Michael Banther
c7cce77fb2 Added empty line demanded by Jenkins checks. 2019-11-11 11:28:13 +00:00
Michael Banther
41654b17a9 Fixed bad formatting. 2019-11-11 11:17:48 +00:00
Michael Banther
861d20827b Change version to 0.3.0 to match change log. 2019-11-11 11:09:30 +00:00
Michael Banther
94afffe517 Corrected change log information and version numbering. 2019-11-11 09:59:02 +00:00
Michael Banther
c640829d9f Merge commit '955301ca76948185b7297709906c08cca37b6862' into feature/pendragon 2019-11-08 16:21:33 +00:00
Michael Banther
a865f4bc51 Add src/hid to the list of source directories. 2019-11-08 14:50:01 +00:00
oscarbailey-xmos
0ef1fe81a1 Merge pull request #106 from xmos/remove_triggers_master
Remove upstream triggers
2019-11-08 14:12:26 +00:00
oscarbailey-xmos
bc6a0cbcd8 Remove upstream triggers 2019-11-08 12:44:07 +00:00
oscarbailey-xmos
955301ca76 Merge pull request #105 from xmos/remove_triggers
Remove upstream triggers
2019-11-08 12:34:45 +00:00
oscarbailey-xmos
a2094e8953 Remove upstream triggers 2019-11-08 12:08:11 +00:00
Michael Banther
5bb5998788 Merge branch 'develop' into feature/pendragon 2019-11-06 15:20:36 +00:00
Michael Banther
28cce8b51c Remove xua_ep0_wrapper.h and xua_ep0_wrapper.xc.
Requested by Oscar Bailey as part of github.com/xmos/lib_xua Pull Request #103.
2019-11-06 15:12:21 +00:00
Michael Banther
92019d851a Remove xua_lite examples.
Requested by Oscar Bailey as part of github.com/xmos/lib_xua Pull Request #103.
2019-11-06 14:58:34 +00:00
oscarbailey-xmos
6dd1853094 Add missing line break in ep0_descriptors 2019-11-06 11:47:25 +00:00
oscarbailey-xmos
7fce471fd9 Merge pull request #102 from xmos/master
Update develop with v0.2.1
2019-11-05 14:31:56 +00:00
oscarbailey-xmos
734e585044 Merge pull request #101 from oscarbailey-xmos/hotfix/fix-adaptive-usb-descriptors
Fix descriptors for XUA_ADAPTIVE
2019-11-05 13:58:17 +00:00
Oscar Bailey
5a0bc319ea Fix copyright 2019-11-05 12:57:03 +00:00
Oscar Bailey
8768bb0ee0 Fix descriptors for XUA_ADAPTIVE 2019-11-05 12:34:10 +00:00
Ross Owen
0af60c3eff Merge pull request #99 from xmos/develop
Infrastructure update + audio stream start/stop callbacks
2019-10-30 10:26:51 +00:00
Michael Banther
75abc71cd7 Cleaning up a previous merge conflict. 2019-10-29 16:45:03 +00:00
Michael Banther
aea89a4cd6 Merge branch 'develop' into feature/pendragon
1st attempt
2019-10-29 16:40:47 +00:00
Larry Snizek
102d1b4e3a Tidy up HID 2019-10-23 15:05:10 +01:00
larry
9fb073a2b0 Merge pull request #3 from michaelb/pendragon_hid_add_requests
Pendragon hid add requests
2019-10-17 14:10:09 +01:00
Michael Banther
a6f3daf581 Update change log. 2019-10-16 16:03:52 +01:00
Michael Banther
a7c0ac6234 Protect configurations that do not include HID functionality from HID code. 2019-10-16 15:58:06 +01:00
Michael Banther
024c0304f1 Reverse the order of operands in an equals comparison to allow the compiler to catch a mistaken use of '=' instead of '=='. 2019-10-16 14:57:33 +01:00
Michael Banther
21ec3cf7bd Put the processing of the Set Idle request in a static function.
This reorganisation prepares this file for adding other HID Class-specific requests without the
2019-10-16 12:18:50 +01:00
Michael Banther
9a7c2d85b2 Reorganise file layout for easier maintenance and reading. 2019-10-16 11:47:32 +01:00
Michael Banther
8820ddf269 Add documentation. 2019-10-16 11:37:27 +01:00
Michael Banther
6afb4ab7e4 Remove debugging print. 2019-10-15 15:43:05 +01:00
Michael Banther
5caca37177 Change the representation, but not the logic, of a multi-part conditional expression to make it easier to understand. 2019-10-15 15:40:26 +01:00
Michael Banther
a5f17c46fc Use a variable large enough to hold the Set Idle duration in ms without overflow. 2019-10-15 15:39:14 +01:00
Michael Banther
e4f0b73a88 Explicitly label assignment of zero as unsigned when used with unsigned variables. 2019-10-15 15:38:16 +01:00
Michael Banther
3331c9e97b Add handling for an indefinite duration. 2019-10-15 10:45:20 +01:00
Michael Banther
aeb1d58bf3 The interface number occupies the entire sp.wIndex field. 2019-10-15 10:44:34 +01:00
Michael Banther
97e3233120 Rename parameter to a less ambiguous name. 2019-10-15 10:42:33 +01:00
Michael Banther
962e91adec Include xua.h to pick up the NUM_USB_CHAN_IN and NUM_USB_CHAN_OUT pre-processor symbols.
They're used further down in the file.  If not present through an #include of xua_h outside of and before the #include of descriptor_defs.h or through definition in the Make file, the enumeration of interface numbers silently mis-assigns values.
2019-10-14 16:47:59 +01:00
Michael Banther
9f98e13342 Use the HID_CONTROLS pre-processor symbol consistently. 2019-10-14 16:42:34 +01:00
Michael Banther
1808d7affa Initial implementation of the USB HID Set_Idle Request.
This code builds successfully.  It has not been tested even a little.
2019-10-10 17:21:21 +01:00
Larry Snizek
8ba9a0064c Cosmetic 2019-10-09 16:45:57 +01:00
Larry Snizek
b592c943f8 Set_Idle request handled (incomplete reports sent instead of NAK) 2019-10-08 21:18:08 +01:00
Michael Banther
2a960700c5 Remove the duplicate USB HID Report Descriptor that Git, for some unknown reason, produced at the last merge. 2019-10-08 13:54:16 +01:00
Michael Banther
f08e79197d Merge branch 'pendragon_hid_usage_investigation' into pendragon 2019-10-08 13:50:23 +01:00
Michael Banther
1690c4eff6 Remove the USB HID Report descriptor with the Voice Command Usage.
This commit also contains a small amount of whitespace clean-up.
2019-10-08 13:45:20 +01:00
Michael Banther
75fea9ed84 Change the simulated interrupt pulse width from 100 us to 100 ms. 2019-10-08 13:44:04 +01:00
Michael Banther
34ebbc8509 Change the HID Report Descriptor to use the AC Search Usage instead of Voice Command. 2019-10-07 16:50:27 +01:00
Michael Banther
5b87efb5a7 Change the HID Report Descriptor to use the AC Search Usage instead of Voice Command. 2019-10-07 12:35:23 +01:00
larry
22323daa5f Merge pull request #2 from michaelb/pendragon
HID -- Interrupt integration
2019-10-02 17:10:16 +01:00
Michael Banther
211a49f26f Remove unnecessary port parameters passed through XUA Buffer (whether the traditional one or the Lite version). 2019-10-02 16:57:42 +01:00
Michael Banther
74564edde8 Add HID trigger function. 2019-10-02 16:55:42 +01:00
Michael Banther
e7e8b58275 Move user_hid.xc from lib_xua to the application (sw_xvf3510). 2019-10-02 16:54:38 +01:00
Michael Banther
ce24c73dc0 Change pre-processor symbol names to make them generic. 2019-10-02 16:51:46 +01:00
Michael Banther
0440020c2f Change pre-processor symbol names to make them generic. 2019-10-02 15:24:28 +01:00
Michael Banther
17317093d5 Rework HID data processing.
Move port handling up into XUA_Buffer_lite2() to take advantage of its select operator.  Add functions to initialise and set the HID data.
2019-10-01 17:04:13 +01:00
Michael Banther
2fb0bdfcc2 A slightly different way of saying the same thing.
I've changed to an if - else construct to make it easy to add in debugging print statements if needed.
2019-10-01 13:52:08 +01:00
Michael Banther
d32235d0f0 Final clean-up of HID -- NDP10x Interrupt integration. 2019-10-01 11:57:54 +01:00
Michael Banther
e1b72c47bc Add a version of UserReadHIDData() which uses a signal on a port to set the Voice Command bit in the HID Report data.
This commit preserves the ability to simulate the NDP100 entirely, i.e. without using a port for input.
2019-09-30 16:14:16 +01:00
Michael Banther
660b483d1e Clean up whitespace, no functional change. 2019-09-30 16:12:16 +01:00
Michael Banther
d7be8419d8 Add a 1b port for receiving the NDP10x interrupt. 2019-09-30 13:52:22 +01:00
Michael Banther
b68c192ad9 Updated change log 2019-09-26 16:29:53 +01:00
larry
0b30ba0cb7 Merge pull request #1 from michaelb/pendragon
Add UAC1 HID support for Voice Command detection
2019-09-26 15:32:02 +01:00
Michael Banther
37bbea3726 Use a consistent method to interpret the HID_CONTROLS pre-processor symbol throughout the code base. 2019-09-26 14:45:17 +01:00
Michael Banther
ba666fb314 Add a 100 ms assertion period when this demonstration code signals an NDP100 interrupt.
When testing with the Play/Pause Usage (0xCD) with a Mac as USB Host, adding in this assertion period produced reliable playing and pausing of the iTunes app every 10 seconds.  Without an explicit assertion period, i.e. sending only one report with the lsb set to 1b followed by many reports with the lsb set to 0b, the iTunes app behaved as though it did not see many of the Play/Pause signals.  The inclusion of an assertion period may or may not help when reporting Voice Command events on Andriod.
2019-09-26 14:27:20 +01:00
Michael Banther
9472bd7dce Change HID usage from Play On-Off Control (OOC) to Voice Command One-Shot Control (OSC).
OSC requires relative data.
2019-09-26 14:22:17 +01:00
Michael Banther
3c86da7c09 Add demo HID code that simulates an interrupt roughly every 10 seconds. 2019-09-25 16:13:46 +01:00
Michael Banther
d491eb2da9 Change HID Report descriptor to contain one variable bit in the lsb position. This bit reports the interrupt. The remaining seven bits are constant at zero. 2019-09-25 16:12:59 +01:00
Michael Banther
960333ca09 Add the missing MSB of the maximum packet size and use hex values instead of decimal. 2019-09-25 14:38:17 +01:00
Michael Banther
3131b89a1d Add HID descriptors for UAC1. 2019-09-25 11:46:16 +01:00
Michael Banther
958d52b5eb Consistently use hex when defining descriptor values. 2019-09-25 11:45:40 +01:00
Michael Banther
35393d3739 Remove duplicate definitions. 2019-09-25 11:44:43 +01:00
Michael Banther
75422de6d1 Replace existing #ifdef HID_CONTROLS with #if( 0 < HID_CONTROLS ) to move to best practice regarding compile-time switches. 2019-09-25 11:42:59 +01:00
Michael Banther
017d937ec7 Add comments to match #endif directives to their corresponding #if or #ifdef directive.
Added to aid reading.
2019-09-25 11:39:48 +01:00
Michael Banther
bb5757e099 Initial implementation of HID. 2019-09-23 17:29:39 +01:00
Michael Banther
8ff44c553c Add the specific directory that contains user_hid.h.
Apparently xwaf doesn't recursively descend directory trees the way xmake does.
2019-09-23 15:36:35 +01:00
Ross Owen
b3331c9d47 Merge pull request #94 from oscarbailey-xmos/feature/xwaf-xcommon-develop
Feature/xwaf xcommon develop
2019-09-13 11:31:00 +01:00
oscarbailey-xmos
a2895a013b Merge pull request #5 from shuchitak/patch-1
Update Jenkinsfile
2019-09-13 10:21:33 +01:00
shuchitak
a1aca010fb Update Jenkinsfile 2019-09-13 10:20:23 +01:00
Oscar Bailey
eb1ca1eb8d Update CHANGELOG 2019-09-06 09:13:09 +01:00
Oscar Bailey
508c62af00 Keep version on 0.2.0 2019-09-05 16:34:59 +01:00
Oscar Bailey
a682ed7d19 Update copyright 2019-09-05 16:03:31 +01:00
Oscar Bailey
eafcc89a6b Change XUA to use new mic array API 2019-09-05 15:52:51 +01:00
Oscar Bailey
244232d3e1 Change view to lib_xua_xwaf_xcommon 2019-08-29 10:01:03 +01:00
Sam Chesney
a7a577acad Update cleanup call 2019-08-29 09:57:55 +01:00
Sam Chesney
8d3cc039f7 Update dependency requirements 2019-08-29 09:57:27 +01:00
Sam Chesney
f1ba1dace8 Bump version 2019-08-29 09:57:15 +01:00
Sam Chesney
9d84debefd Update to support "xwaf.xcommon" builds 2019-08-29 09:56:54 +01:00
Ross Owen
e1f8a8c521 Merge pull request #88 from oscarbailey-xmos/feature/add-audio-stream-callbacks
Added audio stream start/stop callbacks for input/output
2019-08-27 11:07:03 +01:00
Ross Owen
5b05e4e32e Update CHANGELOG.rst 2019-08-27 11:06:44 +01:00
Oscar Bailey
3fc2729db8 Update Copyright 2019-08-23 09:52:53 +01:00
Oscar Bailey
a120d7a83e Added audio stream start/stop callbacks for input/output 2019-08-23 09:30:05 +01:00
Sam Chesney
5a13171a40 Merge pull request #84 from samchesney/feature/new-jenkins-agents
Update Jenkins Pipeline to use new agents
2019-08-21 16:46:12 +01:00
Sam Chesney
204c695434 Correct dependency info in release notes 2019-08-20 19:02:53 +01:00
Sam Chesney
40f4c2f8ab Update copyright date 2019-08-20 18:50:25 +01:00
Sam Chesney
636803d5d4 Update dependency info in release notes 2019-08-20 18:49:45 +01:00
Sam Chesney
344d87342c Build host apps on both Linux and macOS 2019-08-20 13:17:06 +01:00
Sam Chesney
9cb697f5de Update Jenkins Pipeline to use new agents 2019-08-20 13:03:45 +01:00
Ross Owen
c0c4117b8e Merge pull request #80 from larry-xmos/document_composite_workaround
Document composite driver workaround
2019-08-08 10:38:32 +01:00
Larry Snizek
e56af33aa3 Document composite driver workaround 2019-08-07 10:51:12 +01:00
oscarbailey-xmos
3987224d50 Merge pull request #2 from ed-xmos/patch-2
Fix build error when USB not enabled
2019-04-29 06:31:55 -04:00
Ed
37ef88a602 Fix build error when USB not enabled
#ifdeffing the whole source as is the way in lib_xua
2019-04-29 11:04:20 +01:00
Oscar Bailey
786ce134c6 Update comments in xua_ep0_descriptors.h 2019-03-28 17:26:04 +00:00
Oscar Bailey
7339ceca19 Fix asynch mode not working on Windows 2019-03-28 17:11:05 +00:00
oscarbailey-xmos
06317b0b17 Merge pull request #1 from xmos/master
Update xua_lite branch with changes in master
2019-02-28 17:00:10 +00:00
Oscar Bailey
0588ea2d18 Fix XUA lite when using VENDOR_REQUESTS_PARAMS 2019-02-27 17:07:36 +00:00
Oscar Bailey
0b926fd907 Refactor: Separate XUA lite and app code 2019-02-27 11:05:25 +00:00
Oscar Bailey
b12aeac264 Whitespace changes 2019-02-26 17:18:02 +00:00
Oscar Bailey
86b4ab89ea Change version of lib_mic_array; Fix synchronous endpoint behaviour
The device now adjusts it's clock to the USB clock when host is not
pushing data to device.
2019-02-26 16:59:29 +00:00
Ross Owen
ee5e1095c2 Removed -fsubword-select 2019-01-11 11:31:33 +00:00
Ross Owen
0e362dab46 Merge pull request #72 from samchesney/feature/sync_buildsystems
Sync buildsystems
2019-01-10 12:07:53 +00:00
Ross Owen
d4300f0e5c Merge branch 'master' into feature/sync_buildsystems 2019-01-10 12:07:40 +00:00
Ross Owen
87d2a3db26 Merge pull request #74 from lucianomartin/feature/fix_reset
Fix PLL mask to reset tile - WIP
2019-01-10 12:05:39 +00:00
Ross Owen
533ec7b5df Update wscript 2019-01-10 12:05:04 +00:00
Ross Owen
b6b26f252e Update module_build_info 2019-01-10 12:04:49 +00:00
Ross Owen
1d09916b54 Update CHANGELOG.rst 2019-01-10 12:04:37 +00:00
Sam Chesney
8340c4054b Update XMOS copyright 2019-01-09 17:40:45 +00:00
Luciano Martin
868b17a5ff Update lib version and copyright 2019-01-09 17:39:15 +00:00
Sam Chesney
1460b610a4 Set INCLUDE_DIRS in module_build_info
This is required in the wscript.
2019-01-09 17:32:43 +00:00
Luciano Martin
532c872902 Fix PLL mask to reset tile 2019-01-09 17:17:15 +00:00
Sam Chesney
600ec0da92 Add XMOS copyright 2018-12-13 18:14:54 +00:00
Sam Chesney
5830b75c0f Fix CHANGELOG 2018-12-13 18:14:27 +00:00
Sam Chesney
3f1fd3db37 Add Jenkins Pipeline 2018-12-13 18:01:44 +00:00
Oscar Bailey
4ff0713e59 Add Windows support to xmosdfu
Needs WinUSB drivers installed on interface 0.
2018-12-12 15:37:31 +00:00
Sam Chesney
7b4ff40b25 Read values required in wscript from module_build_info 2018-12-11 17:39:21 +00:00
Sam Chesney
a2498dacd8 Add file specific flags for xua_ep0_uacreqs.xc
This is to bring the xwaf build in line with the xmake build.
2018-12-11 17:27:34 +00:00
Sam Chesney
6f295d388a Remove file specific flags for audiorequests.xc
Library does not contain a file of this name.
2018-12-11 16:22:50 +00:00
Sam Chesney
68d1455ed8 Update module_build_info to match wscript 2018-12-11 16:20:53 +00:00
Ed Clarke
a8fa274230 Separate out pdm from rate calc 2018-11-30 14:00:55 +00:00
Ross Owen
21c18c0599 Merge pull request #71 from larry-xmos/master
Correct comment on class 1 control interface descriptor
2018-11-30 11:46:18 +00:00
Ed Clarke
abd3141b0d PID tuning (with gnuplot script to display fifo level printed) 2018-11-30 11:43:55 +00:00
Larry Snizek
ca48783f78 Correct comment on class 1 control interface descriptor 2018-11-30 11:03:58 +00:00
Ed Clarke
45d84a2b84 PID loop development + move rate control to own source files 2018-11-30 10:14:34 +00:00
Ed Clarke
0b2839c9fc Update todo list 2018-11-23 11:45:26 +00:00
Ed Clarke
d7c96c717a Fix saturating logic in PI controller 2018-11-20 15:15:28 +00:00
Ed Clarke
19e6dca445 Initial PID implementation 2018-11-20 14:07:33 +00:00
Ross Owen
7b7a85ae6b Merge pull request #68 from ed-xmos/patch-1
Update xua_audiohub.xc
2018-11-16 14:57:29 +00:00
Ed Clarke
8e7e1bfc51 Make channel preload more clear 2018-11-14 11:40:22 +00:00
Ed Clarke
25f94fe430 reduce deadband on buffer level + debug 2018-11-14 10:36:43 +00:00
Ed Clarke
436e8f4bd4 Reduce backpressure on pll_nudge 2018-11-14 10:36:10 +00:00
Ed Clarke
ad5c2e8583 Underflow now provides zeros 2018-11-14 10:13:50 +00:00
Ed Clarke
d92614ced9 Interface number now passed back to app from EP0 2018-11-14 10:13:29 +00:00
Ed Clarke
6333ca5621 Move pack/unpack to external helper 2018-11-14 10:05:00 +00:00
Ed Clarke
ca7ee58883 Fix buffer level calcs (now locks over & under) 2018-11-14 10:04:39 +00:00
Ross Owen
28b012aa60 Merge pull request #69 from oscarbailey-xmos/no-usb-fix
Fix xs1.h not included when XUA_USB_EN=0
2018-11-13 11:22:54 +00:00
Ed Clarke
8dd33cf33b Unit tests for fifo 2018-11-09 17:32:43 +00:00
Ed Clarke
e93901f0cc Update FIFO to use true shorts + add/use fast block fifo API 2018-11-09 17:32:32 +00:00
Ed Clarke
7af92668f5 Update todo 2018-11-09 17:31:31 +00:00
Ed Clarke
4262cc81ac Remove compiler warning and risk of alignment for EP buffers 2018-11-08 17:13:06 +00:00
Ed Clarke
4d5049a47a Minor tidy 2018-11-08 17:12:38 +00:00
Ed Clarke
1251425ee6 Correct MCLK settings (24.576MHz) solves noise issue 2018-11-08 16:20:34 +00:00
Ed Clarke
f014922e98 Move function prototypes to headers 2018-11-08 14:38:52 +00:00
Ed Clarke
3debc9fef4 combinable ep0 task 2018-11-06 16:15:46 +00:00
Ed Clarke
a72885634d Work around for I2S shift 2018-11-06 14:38:31 +00:00
Ed Clarke
409da256d6 Always parse SP for EP0 2018-11-06 14:38:15 +00:00
Ed Clarke
54f42a37fe Add visual indication for PLL nudge 2018-11-06 14:37:47 +00:00
Ed Clarke
c662acaa3b WIP Adaptive with PLL nudge (demo working) 2018-11-05 13:46:01 +00:00
Ed Clarke
3214d4ea9f Remove magic numbers from endpoint numbers so switch between asynch/adaptive handled 2018-11-05 11:16:21 +00:00
Ed Clarke
0709860f48 Ensure behaviour is correct when UAC_FORCE_FEEDBACK_EP and XUA_ADAPTIVE features defined as 0 2018-11-05 11:14:03 +00:00
Ed Clarke
05f16da222 Minor tidy and todo.txt update 2018-11-05 10:06:13 +00:00
Ed Clarke
a49aad644e Manuallay apply adaptive descriptors from asrc_usb branch 2018-11-05 10:05:39 +00:00
Ed Clarke
c352a08c55 Send fixed number of samples when no output stream (not correct for asynch) 2018-10-31 14:45:16 +00:00
Ed Clarke
90d1a60595 Remove unnecessary arguments 2018-10-31 14:43:58 +00:00
Ed Clarke
9be45c7e89 Add burn threads 2018-10-31 14:43:03 +00:00
Ed Clarke
239f9b9cb7 Enable USB input path (from mics) 2018-10-31 14:10:28 +00:00
Ed Clarke
c0d80b665a Optimisations to xud select cases 2018-10-31 14:09:44 +00:00
Ed Clarke
5643d2b675 Add ddr pdm mics 2018-10-31 13:25:46 +00:00
Oscar Bailey
018576cda5 Fix xs1.h not included when XUA_USB_EN=0 2018-10-31 12:04:27 +00:00
Ed Clarke
35468c7d77 Streaming channels to audio 2018-10-30 11:48:17 +00:00
Ed Clarke
40ea575589 Fix class 1 noise by using channel buffering 2018-10-29 13:29:19 +00:00
Ed Clarke
12327505e5 Class 1 FS - noise + occasional overflow 2018-10-29 13:09:10 +00:00
Ed Clarke
fc68acae6e Merge branch 'xua_lite' of github.com:ed-xmos/lib_xua into xua_lite
* 'xua_lite' of github.com:ed-xmos/lib_xua:
  Light tidy of single thread EP buffer

# Conflicts:
#	examples/xua_lite_example/src/xua_buffer.xc
2018-10-29 12:43:09 +00:00
Ed Clarke
3f1e612d67 Light tidy of single thread EP buffer 2018-10-29 11:19:19 +00:00
Ed Clarke
eaf190b485 Light tidy of single thread EP buffer 2018-10-29 11:12:54 +00:00
Ed Clarke
4b73f17997 First pass combine ep0 into buffer 2018-10-29 08:50:04 +00:00
Ed Clarke
f0c6b22ddc Restrict sample app to single data format 2018-10-29 07:37:23 +00:00
Ed Clarke
44ea92e229 Make c_Audiocontrol nullable 2018-10-29 07:27:53 +00:00
Ed Clarke
5cfbd550fe Add initial lit ep0 cutdown versions 2018-10-29 07:20:12 +00:00
Ed Clarke
6046dc905e Update todo 2018-10-29 07:19:47 +00:00
Ed Clarke
b3fe0cb172 FB calc move to fn 2018-10-28 17:40:23 +00:00
Ed Clarke
f097e0a016 Add todo list 2018-10-28 17:22:20 +00:00
Ed Clarke
491b3936ac WIP feedback calc refactor 2018-10-28 08:59:27 +00:00
Ed Clarke
35b43c0762 Use select for EP0 handling + split ep0 into init and loop 2018-10-28 08:29:39 +00:00
Ed Clarke
78f9e890d6 Output FIFO - sounds great! 2018-10-26 16:24:50 +01:00
Ed Clarke
2405b2f4f1 Basic hook up of audio to buffer (without FIFO) - output audible! 2018-10-26 14:16:17 +01:00
Ed Clarke
1db927601a Basic feedback endpoint working for class 2 2018-10-26 13:44:30 +01:00
Ed Clarke
6fbbbedc28 Loopback audio working (no feedback calc yet) 2018-10-26 12:20:38 +01:00
Ed Clarke
35042e742f Put USB on tile[1] - builds + I2S looping 2018-10-26 11:46:51 +01:00
Ed Clarke
161b934b8f WIP + get DAC config running 2018-10-26 11:25:39 +01:00
Ed Clarke
770c11b3f0 Very early cut of xua_lite app. Builds (4 threads + I2C) but not functional 2018-10-25 17:52:13 +01:00
Ed
0b15179219 Update xua_audiohub.xc
https://github.com/xmos/lib_xua/issues/67
2018-10-05 10:21:09 +01:00
Ross Owen
7bac8d1d77 Merge pull request #66 from larry-xmos/bug_18059
Indexing of ADAT channel strings
2018-10-04 13:50:22 +01:00
Larry Snizek
2aa502f999 Indexing of ADAT channel strings (#18059) 2018-09-07 11:29:28 +01:00
Ross Owen
56d7c7c94c Merge pull request #64 from lucianomartin/master
Update copyrights and changelog
2018-06-05 10:33:22 +01:00
Luciano Martin
a0191c733c Fix copyrights and changelog 2018-06-05 09:43:49 +01:00
Ross Owen
e6d45ff3cc Merge pull request #63 from lucianomartin/audio_class_fallback
Replace "defined(AUDIO_CLASS_FALLBACK)" with if(AUDIO_CLASS_FALLBACK)
2018-06-04 10:41:59 +01:00
Ross Owen
f64b1c4ed9 Update warnings.xc 2018-06-04 10:41:37 +01:00
Ross Owen
38de67054e Update xua_ep0_descriptors.h 2018-06-04 10:41:16 +01:00
Ross Owen
ab127f2eb2 Tidy AUDIO_CLASS_FALLBACK usage 2018-06-04 10:38:32 +01:00
Ross Owen
09b1cdf610 Tidy up AUDIO_CLASS_FALLBACK usage 2018-06-04 10:36:27 +01:00
Luciano Martin
a8b03de538 Set AUDIO_CLASS_FALLBACK to 0 by default
- Remove usage of "defined(AUDIO_CLASS_FALLBACK)"
2018-06-01 17:37:19 +01:00
Ross Owen
cde4a6e41c Updated comment to reflect code 2018-05-30 13:55:17 +01:00
Ross Owen
973a4d9fd5 Chanend param to DoSampleTransfer() now nullable 2018-05-30 13:54:32 +01:00
Ross Owen
6b000cf249 Merge pull request #61 from lucianomartin/fix_for_vocalfusion
Remove some compilation warnings
2018-05-30 11:29:16 +01:00
Luciano Martin
bbafb21049 Remove some compilation warnings 2018-05-29 14:37:12 +01:00
Ross Owen
50e44447ae Merge pull request #60 from lucianomartin/fix_for_vocalfusion
Fix compilation errors when PDM_TILE and AUDIO_IO_TILE are the same tile
2018-05-29 11:08:31 +01:00
Luciano Martin
366031e662 Fix compilation errors when PDM_TILE and AUDIO_IO_TILE are the same tile 2018-05-29 11:02:32 +01:00
Ross Owen
02ddea2c3c Update CHANGELOG.rst 2018-04-23 09:38:01 +01:00
Ross Owen
142f217fcd Merge pull request #59 from ed-xmos/multichannel_uac1_descriptor
Multichannel uac1 descriptor
2018-04-23 09:35:36 +01:00
Ross Owen
949ff83687 Update module_build_info
Removed multiple SOURCE_DIR
2018-04-23 09:35:01 +01:00
Ed Clarke
f83a09ce5a Merge branch 'master' into multichannel_uac1_descriptor
* master: (86 commits)
  Added |appendix| to doc
  Added version to lib_spdif dependancy
  Update README.rst
  Update README.rst
  Fixed for TDM slave loopback test (sync check)
  Fixed build of I2S loopback test (API change to XUA_AudioHub - now takes all ports)
  Scripted changelog update
  Copyright comments
  AN00248 doc updates
  PDM resources no longer accessed globally
  PDM mic resources no longer accessed globally
  App note updates
  Updates to AN00248
  PDM related build fixes
  NUM_PDM_MICS -> XUA_NUM_PDM_MICS
  Added start of AN00248
  PDM func rename
  xua_pdm_mic.h included in xua.h
  xua_pdm_mic.h moved to api
  AN00246 now operational with lib_i2c
  ...
2018-04-20 14:46:03 +01:00
Ed Clarke
817e385f74 Ensure channel config properly set for UAC1 when chans != 2
Needed for Windows 10 MC output
2018-04-20 14:19:06 +01:00
xross
2da4cb3096 Added |appendix| to doc 2018-04-06 16:13:24 +01:00
xross
4fb444306c Merge branch 'master' of github.com:xmos/lib_xua 2018-04-06 16:10:25 +01:00
xross
4d86346fcf Added version to lib_spdif dependancy 2018-04-06 16:10:10 +01:00
Ross Owen
5f84b66615 Update README.rst 2018-04-06 11:40:39 +01:00
Ross Owen
f779ee1b88 Update README.rst 2018-04-06 11:39:58 +01:00
xross
42a619d911 Fixed for TDM slave loopback test (sync check) 2018-04-05 15:30:46 +01:00
xross
06e18c293c Fixed build of I2S loopback test (API change to XUA_AudioHub - now takes all ports) 2018-04-05 11:21:26 +01:00
xross
96a800c3d4 Scripted changelog update 2018-04-05 11:14:19 +01:00
xross
558e49354a Copyright comments 2018-04-05 11:13:31 +01:00
xross
aaf3944d18 AN00248 doc updates 2018-04-04 18:17:18 +01:00
xross
a3c7ff3dd5 PDM resources no longer accessed globally 2018-04-04 18:02:16 +01:00
xross
e378d70c4e PDM mic resources no longer accessed globally 2018-04-04 18:01:52 +01:00
xross
ae132c2e94 App note updates 2018-04-04 16:57:56 +01:00
xross
b3afeaccda Updates to AN00248 2018-04-04 15:16:45 +01:00
xross
72c32e2828 PDM related build fixes 2018-04-04 15:16:29 +01:00
xross
14af847ddb NUM_PDM_MICS -> XUA_NUM_PDM_MICS 2018-04-04 14:24:57 +01:00
xross
e5ed3e88d6 Added start of AN00248 2018-04-04 14:15:42 +01:00
xross
7b7d7f7e98 PDM func rename 2018-04-04 14:15:14 +01:00
xross
daa3fd2992 xua_pdm_mic.h included in xua.h 2018-04-04 14:14:57 +01:00
xross
d835f58bbc xua_pdm_mic.h moved to api 2018-04-04 14:14:41 +01:00
xross
9b132c25a0 AN00246 now operational with lib_i2c 2018-04-03 17:40:03 +01:00
xross
e50477cb1c Initial work to move AN00246 to lib_i2c from sc_i2c 2018-04-03 16:28:55 +01:00
xross
650cedeec7 AN00247 build fix 2018-04-03 13:53:08 +01:00
xross
6a879ec52b Added “configuring lib_xua” section to AN00247 doc 2018-04-03 12:05:35 +01:00
xross
5af1420e68 Added missing adat buffer 2018-03-29 18:32:25 +01:00
xross
c109d3db81 Added missing adatCounter var 2018-03-29 18:25:49 +01:00
xross
548cb700c5 Fixed endif without if 2018-03-29 18:18:44 +01:00
xross
093beb302b Added missing audiohub_adat.h 2018-03-29 18:01:32 +01:00
xross
6ee02cbfe2 Application note tidy and build fixes 2018-03-29 17:52:24 +01:00
xross
6e8ec4b25e Updates to AN00247 2018-03-29 17:25:36 +01:00
xross
1832d8c870 Simplification of AN00247 code 2018-03-29 16:47:04 +01:00
xross
6e6cb30aca SPDIF Tx doc updates 2018-03-29 16:40:32 +01:00
xross
5ea3222e90 SPDIF tx doc update 2018-03-29 16:31:18 +01:00
xross
dc62349472 Moved to lib_spdif for S/PDIF Rx 2018-03-29 16:21:37 +01:00
xross
d1681dc37f Fixed SPDIF channel strings (and gen script) 2018-03-29 15:53:29 +01:00
xross
26fef5eeb2 main.xc now builds with new SPDIF arrangement 2018-03-29 15:37:37 +01:00
xross
53b1ebe371 Merge branch 'master' of github.com:xmos/lib_xua 2018-03-29 14:05:20 +01:00
xross
f4d0bb24c9 ADAT_RX ifdef vs if (run-time trap on SR change) 2018-03-29 14:04:59 +01:00
Ross Owen
df039bc664 Merge pull request #52 from larry-xmos/xmosdfu_doc_linux_and_pi
xmosdfu: Linux and Raspberry Pi build instructions
2018-03-29 13:58:08 +01:00
Ross Owen
4e5e7dbe42 Merge pull request #51 from larry-xmos/master
License update
2018-03-29 13:57:59 +01:00
xross
2197cbdef6 XUA_AudioHub() no longer pars S/PDIF transmitter task and always takes a channend for S/PDIF tx data (when enabled). I2S clock ports to XUA_AudioHub now nullable - and not used if I2S not enabled!
AN00247 code now builds and runs (and plays!)
2018-03-29 13:50:22 +01:00
xross
c4d2462c98 Updates to AN000247 2018-03-29 13:47:28 +01:00
xross
b4090602ad Added initial AN00247 2018-03-29 13:32:54 +01:00
xross
f1aca129f2 Started adding SPDIF TX info to lib doc 2018-03-29 13:16:54 +01:00
xross
a0b0c40c7f Scripted changelog update 2018-03-29 11:36:14 +01:00
xross
f9e90823b7 Updated module_build_info (version and added spdif depth) 2018-03-28 16:45:15 +01:00
xross
e1c0731c42 Further doc updates 2018-03-28 16:44:21 +01:00
xross
248eeffbaa Moved to lib_spdif for spdif tx (from module_spdif_tx) 2018-03-28 16:44:02 +01:00
xross
f4dcb77427 Documentation updates (related to AudioHub/I2S) 2018-03-28 11:51:57 +01:00
Larry Snizek
c4a2b86c0d xmosdfu: Linux and Raspberry Pi build instructions 2018-03-22 14:48:45 +00:00
Larry Snizek
44b154f578 License update 2018-03-16 13:23:34 +00:00
Larry Snizek
41a78ed7bf Apply host directory move in DFU documentation too 2018-03-15 10:45:49 +00:00
Ross Owen
101bbea74d Merge pull request #50 from larry-xmos/master
Gitignore updates
2018-03-15 10:45:02 +00:00
Ross Owen
711efc8be9 Merge pull request #49 from larry-xmos/MAINTEN/v0.1
Apply host directory move in DFU documentation too
2018-03-15 10:44:31 +00:00
Larry Snizek
63cc3d9db6 Gitignore updates 2018-03-14 17:51:46 +00:00
Larry Snizek
566cf12c3f Apply host directory move in DFU documentation too 2018-03-14 17:49:56 +00:00
xross
b6460a266e Fixed SOURCE_DIRS to handle subdirs 2018-03-14 15:33:45 +00:00
xross
275be0c269 Fixed SOURCE_DIRS to handle subdirs 2018-03-14 15:32:11 +00:00
xross
69319f706d Ignore dfu src in main build 2018-03-13 18:34:24 +00:00
xross
de1572004d Ignore dfu src in main build 2018-03-13 18:33:45 +00:00
Larry Snizek
3098e8bce5 Move host directory under lib directory so it gets released 2018-03-13 17:23:22 +00:00
Ross Owen
74b44502a5 Merge pull request #48 from larry-xmos/host_directory_under_lib
Move host directory under lib directory so it gets released
2018-03-13 17:09:24 +00:00
Larry Snizek
178f420c87 Move host directory under lib directory so it gets released 2018-03-13 17:01:33 +00:00
xross
41cf4e8c21 Documentation corrections. 2018-03-09 16:38:21 +00:00
xross
5a631a327b Merge branch 'master' of github.com:xmos/lib_xua 2018-03-09 16:12:22 +00:00
xross
891ae562ea Doc update 2018-03-09 16:11:45 +00:00
xross
b66e9cdc60 Further Audiohub tidyups. I2S ports params. Documentation updates inline. 2018-03-09 16:11:18 +00:00
xross
961d890b2c First cut at reunifying master/slave i2s loops 2018-03-08 20:07:30 +00:00
Ross Owen
4ec8e85737 Merge pull request #43 from larry-xmos/dfu_upload_error_handling
Handle libusb_control_transfer errors from dfu_upload
2018-03-08 19:18:34 +00:00
Ross Owen
2f1b72055a Merge pull request #44 from larry-xmos/git_ignore
Git ignore files
2018-03-08 19:17:45 +00:00
xross
6824657b4f Build fixes related to XUA_USB_EN 2018-03-08 18:22:51 +00:00
xross
39acd6cf17 NO_USB -> XUA_USB_EN 2018-03-08 18:02:59 +00:00
xross
a7645a9b0f Audiohub now takes some resources as params (prev was global) 2018-03-08 17:40:56 +00:00
xross
a33950f675 Test rename 2018-03-08 17:40:11 +00:00
xross
2729d9a34a Initial doc add 2018-03-08 17:39:15 +00:00
xross
a7678f8916 Updated readmes (and gitignore) 2018-03-08 11:30:02 +00:00
xross
756a81ad14 Fixed i2s_loopback test build (and removed some unrequired complexity 2018-03-05 11:48:51 +00:00
xross
16ba8deacf Merge branch 'master' of github.com:xmos/lib_xua 2018-03-05 11:31:16 +00:00
xross
fdff48b706 Comment only 2018-03-05 11:30:59 +00:00
xross
bfe281a311 Remove commented out code from example 2018-03-05 11:30:39 +00:00
Larry Snizek
da969fa610 Git ignore files 2018-03-02 13:05:07 +00:00
Larry Snizek
1e8392730d Handle libusb_control_transfer errors from dfu_upload 2018-03-01 09:53:16 +00:00
Ross Owen
a80e4716f4 Merge pull request #41 from larry-xmos/project_files
Eclipse project files
2018-02-28 13:45:20 +00:00
Ross Owen
3192b2ee0b Update .gitignore 2018-02-28 13:45:08 +00:00
Larry Snizek
88c2c03501 Eclipse project files 2018-02-28 11:59:19 +00:00
xross
ee83fcaf4f Preprocessor typo 2018-02-28 10:04:26 +00:00
xross
5663b90a40 PDM build fix 2018-02-28 10:00:25 +00:00
xross
b2ee519ab8 Fix typo in PDM mclk name 2018-02-28 09:55:17 +00:00
xross
bff169463f Mixed missing calls to PDM tasks 2018-02-27 15:29:29 +00:00
xross
90aa19d351 Tidy up ADAT_RX and SPDIF_RX usage (ifdef vs if) 2018-02-27 14:59:58 +00:00
xross
db68680ebf Changelog update 2018-02-27 14:37:28 +00:00
xross
13b84c07fa Merge branch 'master' of github.com:xmos/lib_xua 2018-02-27 14:36:30 +00:00
xross
2da23a58af Simplified call to xud 2018-02-27 14:36:14 +00:00
xross
a4966597cb Removed L series support from main 2018-02-27 14:35:54 +00:00
xross
a8562ad56a Simplified mclk port usage (no longer unsafe). pdm_mics() -> xua_pdm_mics() 2018-02-27 14:35:40 +00:00
xross
04b08c9213 PDM hw resource dec moved to main 2018-02-27 12:40:33 +00:00
Ross Owen
eef832df7d Update CHANGELOG.rst 2018-02-27 12:24:59 +00:00
Ross Owen
53e8fe4f57 Changelog tidy only 2018-02-26 14:51:27 +00:00
Ross Owen
9563e6a98b Merge pull request #40 from lucianomartin/usb_dfu
USB DFU updates
2018-02-26 14:50:47 +00:00
Ross Owen
77d1de14aa Update CHANGELOG.rst 2018-02-26 14:50:06 +00:00
Luciano Martin
ef364c9d59 - update CHANGELOG 2018-02-26 12:21:19 +00:00
Luciano Martin
b6dd33076a - add warning for empty uploaded image in USB DFU 2018-02-26 12:17:58 +00:00
xross
72f7a1d153 Fixed runtime deadlock with MIXER=1 && MAX_MIX_COUNT=0 2018-02-21 15:54:25 +00:00
xross
9a8910121f Start simplifiction of appnote code 2018-02-21 10:57:05 +00:00
xross
4a8ddb2e40 Changelog update 2018-02-19 15:01:40 +00:00
xross
43648638ba Changelog update 2018-02-19 15:00:44 +00:00
xross
0afcb6d65c Fixes #39 2018-02-19 14:36:17 +00:00
xross
bc91e21189 Typos only 2018-02-19 11:32:15 +00:00
xross
29deebd07a Scripted changelog update 2018-02-19 10:56:47 +00:00
xross
7027dc2ad4 Changelog update 2018-02-19 10:55:28 +00:00
xross
0674880c11 Undo accidental removal of buffering bounds check 2018-02-15 16:08:21 +00:00
xross
4f6a54f3b0 Whitespace only 2018-02-14 16:53:58 +00:00
xross
90f9588fe0 Comment change only 2018-02-14 16:52:45 +00:00
xross
a19086f0d4 Removed unused tmpBuffer 2018-02-14 16:52:23 +00:00
xross
8a8cc4168a Feedback properly configured in AN00246 app 2018-02-14 16:50:47 +00:00
xross
b3aa9dc009 xScope enabled in AN00246 app 2018-02-14 16:50:16 +00:00
xross
6c091a85d3 Changelog update and version bump 2018-02-14 12:23:18 +00:00
xross
eb0ea91979 Added AN00246 files 2018-02-14 12:19:50 +00:00
xross
1a324855a0 Added AN00246 2018-02-14 11:14:14 +00:00
xross
2ae49afa17 Merge branch 'master' of github.com:xmos/lib_xua 2018-02-12 11:25:27 +00:00
xross
b2e64ba9fc Removed VF from DFU pid list 2018-02-12 11:25:15 +00:00
244 changed files with 17248 additions and 4039 deletions

1
.github/CODEOWNERS vendored Normal file
View File

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

15
.gitignore vendored
View File

@@ -1,5 +1,4 @@
*.log
module_dfu/host/xmosdfu/xmosdfu
*.dSYM
*/.build_*/*
*/bin/*
@@ -11,14 +10,24 @@ module_dfu/host/xmosdfu/xmosdfu
*.xi
*.i
*.bin
.*
*~
*.a
*.swp
*.*~
*.pyc
.build*
.DS_Store
test_results.csv
_build*
**/.venv/**
**/.vscode/**
**.egg-info
*.pdf
# waf build files
.lock-waf_*
.waf-*/
build/
host/xmosdfu/xmosdfu
.build*
*.pyc
xscope.xmt

View File

@@ -1,13 +1,202 @@
lib_xua Change Log
==================
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()
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
* CHANGED: HID Report to return multiple bytes
* CHANGED: NO_USB conditional compilation switch with XUA_USB_EN
* CHANGED: Clock blocks used for BCLK and MCLK
* 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
* FIXED: Automate HID Report Descriptor length in AC1 HID Descriptor
1.1.1
-----
* CHANGED: Pin Python package versions
* FIXED: Zero length input packets generated before enumeration causing
I2S timing pushout at startup
1.1.0
-----
* ADDED: Ability to read or modify serial number string
1.0.1
-----
* FIXED: Wrong size of vendor and product strings
1.0.0
-----
* ADDED: UAC1 HID support with simulated Voice Command detection reported
every 10 seconds
* ADDED: Support for USB HID Set Idle request
* ADDED: Pre-processor symbols to enable single-threaded, dual-PDM
microphone operation
* ADDED: Guards to user_hid.h and xua_hid.h
* ADDED: UAC1 HID support for AC Stop (End Call), Volume Increment and
Volume Decrement
* CHANGED: UAC1 HID to report function keys f21 through f24 as specified by
customer
* 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
detection as AC Stop
* ADDED: Ability to read or modify vendor and product IDs and strings
* ADDED: Ability to read or modify bcdDevice
* 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
-----
* 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
-----
* 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
* CHANGED: I2S hardware resources no longer used globally and must be passed
to XUA_AudioHub()
* 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
* FIXED: Indexing of ADAT channel strings (#18059)
* FIXED: Rebooting device fails when PLL config "not reset" bit is set
* Changes to dependencies:
- lib_dsp: Added dependency 5.0.0
- lib_mic_array: Added dependency 4.0.0
- lib_spdif: Added dependency 3.1.0
- lib_xassert: Added dependency 3.0.1
0.1.2
-----
* ADDED: Application note AN00246: Simple USB Audio Device using lib_xua
* 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)
* 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:
@@ -18,31 +207,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
@@ -52,105 +241,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
@@ -164,75 +353,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:
@@ -242,48 +431,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
-----
@@ -291,35 +480,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

198
Jenkinsfile vendored Normal file
View File

@@ -0,0 +1,198 @@
@Library('xmos_jenkins_shared_library@v0.18.0') _
getApproval()
pipeline {
agent none
environment {
REPO = 'lib_xua'
VIEW = getViewName(REPO)
}
options {
skipDefaultCheckout()
}
stages {
stage('Basic tests') {
agent {
label 'x86_64 && linux'
}
stages {
stage('Get view') {
steps {
xcorePrepareSandbox("${VIEW}", "${REPO}")
}
}
stage('Library checks') {
steps {
xcoreLibraryChecks("${REPO}")
}
}
stage('XS2 Tests') {
failFast true
parallel {
stage('Legacy tests') {
steps {
runXmostest("${REPO}", 'legacy_tests')
}
}
stage('Unit 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 -s")
}
}
}
}
}
}
}
}
}
// 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}") {
xcoreAllAppNotesBuild('examples')
dir("${REPO}") {
runXdoc('doc')
}
}
}
}
}
post {
cleanup {
xcoreCleanSandbox()
}
}
}
stage('Build host apps') {
failFast true
parallel {
stage('Build Linux host app') {
agent {
label 'x86_64&&linux'
}
steps {
xcorePrepareSandbox("${VIEW}", "${REPO}")
dir("${REPO}/${REPO}/host/xmosdfu") {
sh 'make -f Makefile.Linux64'
}
}
post {
cleanup {
xcoreCleanSandbox()
}
}
}
stage('Build Mac host app') {
agent {
label 'x86_64&&macOS'
}
steps {
xcorePrepareSandbox("${VIEW}", "${REPO}")
dir("${REPO}/${REPO}/host/xmosdfu") {
sh 'make -f Makefile.OSX64'
}
}
post {
cleanup {
xcoreCleanSandbox()
}
}
}
stage('Build Pi host app') {
agent {
label 'pi'
}
steps {
dir("${REPO}") {
checkout scm
dir("${REPO}/host/xmosdfu") {
sh 'make -f Makefile.Pi'
}
}
}
post {
cleanup {
xcoreCleanSandbox()
}
}
}
stage('Build Windows host app') {
agent {
label 'x86_64&&windows'
}
steps {
dir("${REPO}") {
checkout scm
dir("${REPO}/host/xmosdfu") {
runVS('nmake /f Makefile.Win32')
}
}
}
post {
cleanup {
xcoreCleanSandbox()
}
}
}
}
}
stage('Update') {
agent {
label 'x86_64 && linux'
}
steps {
updateViewfiles()
}
post {
cleanup {
xcoreCleanSandbox()
}
}
}
}
}

84
LICENSE.rst Normal file
View File

@@ -0,0 +1,84 @@
*******************************
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,135 +0,0 @@
Software Release License Agreement
Copyright (c) 2011-2018, XMOS, All rights reserved.
BY ACCESSING, USING, INSTALLING OR DOWNLOADING THE XMOS SOFTWARE, YOU AGREE TO BE BOUND BY THE FOLLOWING TERMS. IF YOU DO NOT AGREE TO THESE, DO NOT ATTEMPT TO DOWNLOAD, ACCESS OR USE THE XMOS Software.
Parties:
(1) XMOS Limited, incorporated and registered in England and Wales with company number 5494985 whose registered office is 107 Cheapside, London, EC2V 6DN (XMOS).
(2) An individual or legal entity exercising permissions granted by this License (Customer).
If you are entering into this Agreement on behalf of another legal entity such as a company, partnership, university, college etc. (for example, as an employee, student or consultant), you warrant that you have authority to bind that entity.
1. Definitions
"License" means this Software License and any schedules or annexes to it.
"License Fee" means the fee for the XMOS Software as detailed in any schedules or annexes to this Software License
"Licensee Modifications" means all developments and modifications of the XMOS Software developed independently by the Customer.
"XMOS Modifications" means all developments and modifications of the XMOS Software developed or co-developed by XMOS.
"XMOS Hardware" means any XMOS hardware devices supplied by XMOS from time to time and/or the particular XMOS devices detailed in any schedules or annexes to this Software License.
"XMOS Software" comprises the XMOS owned circuit designs, schematics, source code, object code, reference designs, (including related programmer comments and documentation, if any), error corrections, improvements, modifications (including XMOS Modifications) and updates.
The headings in this License do not affect its interpretation. Save where the context otherwise requires, references to clauses and schedules are to clauses and schedules of this License.
Unless the context otherwise requires:
- references to XMOS and the Customer include their permitted successors and assigns;
- references to statutory provisions include those statutory provisions as amended or re-enacted; and
- references to any gender include all genders.
Words in the singular include the plural and in the plural include the singular.
2. License
XMOS grants the Customer a non-exclusive license to use, develop, modify and distribute the XMOS Software with, or for the purpose of being used with, XMOS Hardware.
Open Source Software (OSS) must be used and dealt with in accordance with any license terms under which OSS is distributed.
3. Consideration
In consideration of the mutual obligations contained in this License, the parties agree to its terms.
4. Term
Subject to clause 12 below, this License shall be perpetual.
5. Restrictions on Use
The Customer will adhere to all applicable import and export laws and regulations of the country in which it resides and of the United States and United Kingdom, without limitation. The Customer agrees that it is its responsibility to obtain copies of and to familiarise itself fully with these laws and regulations to avoid violation.
6. Modifications
The Customer will own all intellectual property rights in the Licensee Modifications but will undertake to provide XMOS with any fixes made to correct any bugs found in the XMOS Software on a non-exclusive, perpetual and royalty free license basis.
XMOS will own all intellectual property rights in the XMOS Modifications.
The Customer may only use the Licensee Modifications and XMOS Modifications on, or in relation to, XMOS Hardware.
7. Support
Support of the XMOS Software may be provided by XMOS pursuant to a separate support agreement.
8. Warranty and Disclaimer
The XMOS Software is provided "AS IS" without a warranty of any kind. XMOS and its licensors' entire liability and Customer's exclusive remedy under this warranty to be determined in XMOS's sole and absolute discretion, will be either (a) the corrections of defects in media or replacement of the media, or (b) the refund of the license fee paid (if any).
Whilst XMOS gives the Customer the ability to load their own software and applications onto XMOS devices, the security of such software and applications when on the XMOS devices is the Customer's own responsibility and any breach of security shall not be deemed a defect or failure of the hardware. XMOS shall have no liability whatsoever in relation to any costs, damages or other losses Customer may incur as a result of any breaches of security in relation to your software or applications.
XMOS AND ITS LICENSORS DISCLAIM ALL OTHER WARRANTIES, EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY/ SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT EXCEPT TO THE EXTENT THAT THESE DISCLAIMERS ARE HELD TO BE LEGALLY INVALID UNDER APPLICABLE LAW.
9. High Risk Activities
The XMOS Software is not designed or intended for use in conjunction with on-line control equipment in hazardous environments requiring fail-safe performance, including without limitation the operation of nuclear facilities, aircraft navigation or communication systems, air traffic control, life support machines, or weapons systems (collectively "High Risk Activities") in which the failure of the XMOS Software could lead directly to death, personal injury, or severe physical or environmental damage. XMOS and its licensors specifically disclaim any express or implied warranties relating to use of the XMOS Software in connection with High Risk Activities.
10. Liability
TO THE EXTENT NOT PROHIBITED BY APPLICABLE LAW, NEITHER XMOS NOR ITS LICENSORS SHALL BE LIABLE FOR ANY LOST REVENUE, BUSINESS, PROFIT, CONTRACTS OR DATA, ADMINISTRATIVE OR OVERHEAD EXPENSES, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES HOWEVER CAUSED AND REGARDLESS OF THEORY OF LIABILITY ARISING OUT OF THIS LICENSE, EVEN IF XMOS HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. In no event shall XMOS's liability to the Customer whether in contract, tort (including negligence), or otherwise exceed the License Fee.
Customer agrees to indemnify, hold harmless, and defend XMOS and its licensors from and against any claims or lawsuits, including attorneys' fees and any other liabilities, demands, proceedings, damages, losses, costs, expenses fines and charges which are made or brought against or incurred by XMOS as a result of your use or distribution of the Licensee Modifications or your use or distribution of XMOS Software, or any development of it, other than in accordance with the terms of this License.
11. Ownership
The copyrights and all other intellectual and industrial property rights for the protection of information with respect to the XMOS Software (including the methods and techniques on which they are based) are retained by XMOS and/or its licensors. Nothing in this Agreement serves to transfer such rights. Customer may not sell, mortgage, underlet, sublease, sublicense, lend or transfer possession of the XMOS Software in any way whatsoever to any third party who is not bound by this Agreement.
12. Termination
Either party may terminate this License at any time on written notice to the other if the other:
- is in material or persistent breach of any of the terms of this License and either that breach is incapable of remedy, or the other party fails to remedy that breach within 30 days after receiving written notice requiring it to remedy that breach; or
- is unable to pay its debts (within the meaning of section 123 of the Insolvency Act 1986), or becomes insolvent, or is subject to an order or a resolution for its liquidation, administration, winding-up or dissolution (otherwise than for the purposes of a solvent amalgamation or reconstruction), or has an administrative or other receiver, manager, trustee, liquidator, administrator or similar officer appointed over all or any substantial part of its assets, or enters into or proposes any composition or arrangement with its creditors generally, or is subject to any analogous event or proceeding in any applicable jurisdiction.
Termination by either party in accordance with the rights contained in clause 12 shall be without prejudice to any other rights or remedies of that party accrued prior to termination.
On termination for any reason:
- all rights granted to the Customer under this License shall cease;
- the Customer shall cease all activities authorised by this License;
- the Customer shall immediately pay any sums due to XMOS under this License; and
- the Customer shall immediately destroy or return to the XMOS (at the XMOS's option) all copies of the XMOS Software then in its possession, custody or control and, in the case of destruction, certify to XMOS that it has done so.
Clauses 5, 8, 9, 10 and 11 shall survive any effective termination of this Agreement.
13. Third party rights
No term of this License is intended to confer a benefit on, or to be enforceable by, any person who is not a party to this license.
14. Confidentiality and publicity
Each party shall, during the term of this License and thereafter, keep confidential all, and shall not use for its own purposes nor without the prior written consent of the other disclose to any third party any, information of a confidential nature (including, without limitation, trade secrets and information of commercial value) which may become known to such party from the other party and which relates to the other party, unless such information is public knowledge or already known to such party at the time of disclosure, or subsequently becomes public knowledge other than by breach of this license, or subsequently comes lawfully into the possession of such party from a third party.
The terms of this license are confidential and may not be disclosed by the Customer without the prior written consent of XMOS.
The provisions of clause 14 shall remain in full force and effect notwithstanding termination of this license for any reason.
15. Entire agreement
This License and the documents annexed as appendices to this License or otherwise referred to herein contain the whole agreement between the parties relating to the subject matter hereof and supersede all prior agreements, arrangements and understandings between the parties relating to that subject matter.
16. Assignment
The Customer shall not assign this License or any of the rights granted under it without XMOS's prior written consent.
17. Governing law and jurisdiction
This License shall be governed by and construed in accordance with English law and each party hereby submits to the non-exclusive jurisdiction of the English courts.
This License has been entered into on the date stated at the beginning of it.
Schedule
XMOS lib_xua software

View File

@@ -1,18 +1,84 @@
lib_xua
=======
USB Audio Shared Components. For use in the XMOS USB Audio Refererence Designs.
:Latest release: 3.2.0rc1
Required software (dependencies)
................................
:Scope: General Use
* lib_logging
* lib_xud
Summary
-------
Checking dependent libs
USB Audio Shared Components for use in the XMOS USB Audio Refererence Designs.
This library enables the development of USB Audio devices on the XMOS xCORE architecture.
Features
........
Key features of the various applications in this repository are as follows
- USB Audio Class 1.0/2.0 Compliant
- Fully Asynchronous operation
- 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
- Support for dynamically selectable output audio formats (e.g. resolution)
- Field firmware upgrade compliant to the USB Device Firmware Upgrade (DFU) Class Specification
- S/PDIF output
- S/PDIF input
- ADAT output
- ADAT input
- Synchronisation to external digital streams i.e. S/PDIF or ADAT
- I2S slave & master modes
- TDM slave & master modes
- MIDI input/output (Compliant to USB Class Specification for MIDI devices)
- DSD output (Native and DoP mode) at DSD64 and DSD128 rates
- Mixer with flexible routing
- Simple playback controls via Human Interface Device (HID)
- Support for operation with Apple devices (requires software module sc_mfi for MFI licensees only - please contact XMOS)
Note, not all features may be supported at all sample frequencies, simultaneously or on all devices. Some features also require specific host driver support.
Software version and dependencies
.................................
.. libdeps::
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.
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
Required software (dependencies)
================================
* lib_locks (git@github.com:xmos/lib_locks.git)
* lib_logging (git@github.com:xmos/lib_logging)
* lib_mic_array (git@github.com:xmos/lib_mic_array.git)
* lib_xassert (git@github.com:xmos/lib_xassert)
* lib_dsp (git@github.com:xmos/lib_dsp)
* lib_spdif (git@github.com:xmos/lib_spdif)
* lib_xud (git@github.com:xmos/lib_xud)

View File

@@ -0,0 +1,56 @@
.. _usb_audiosec_building_xmos_dfu:
Building the XMOS DFU loader
============================
The XMOS DFU loader is provided as source as part of the USB Audio
framework, located in lib_xua/host/xmosdfu.
The loader is compiled using libusb, the code for the loader is contained in the
file ``xmosdfu.cpp``
macOS
-----
To build the loader a Makefile is provided, which can be run as follows:
``make -f Makefile.OSX64 all``
This Makefile contains the following:
.. literalinclude:: Makefile.OSX64
There is also a 32bit OS X makefile, ``Makefile.OSX32``.
Linux
-----
Similarly to macOS, there are two Linux makefiles provided, ``Makefile.Linux32`` and ``Makefile.Linux64``:
.. literalinclude:: Makefile.Linux64
System-wide libusb is used. On Debian-derived systems this can be installed with:
``apt-get install libusb-1.0.0-dev``
Raspberry Pi
------------
A makefile is provided for Raspbian. libusb is required and can be installed using the ``apt-get`` command from previous Linux section.
.. literalinclude:: Makefile.Pi
Windows
-------
To build on Windows, you must first install Visual Studio 2019 Build Tools with
C++ support. `This is available from Microsoft's website. <https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2019>`_
To build, open a Developer Command Prompt via the start menu and navigate to the
xmosdfu folder. The command to build is as follows:
``nmake /f Makefile.Win32``
This Makefile contains the following:
.. literalinclude:: Makefile.Win32

View File

@@ -7,4 +7,4 @@ DFU loader for XMOS USB AUDIO devices
Creating factory and upgrade images with XFLASH <factory_image>
Using the DFU loader - Windows (via the Thesycon driver) <thesycon_dfu>
Using the DFU loader - macOS (via the XMOS DFU loader) <xmos_dfu>
Building the XMOS DFU loader - macOS <building_xmos_dfu>
Building the XMOS DFU loader <building_xmos_dfu>

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

View File

@@ -4,6 +4,9 @@ Using the DFU loader - macOS (via the XMOS DFU loader)
The XMOS DFU loader is provided as source as part of the XMOS USB Audio software
framework, see :ref:`usb_audiosec_building_xmos_dfu`.
NOTE: Windows requires the installation of libusbK drivers on the DFU endpoint.
We recommend using `Zadig <https://zadig.akeo.ie/>`_.
Set up the image loader
-----------------------
@@ -18,7 +21,7 @@ Download new firmware
To program the new firmware run the command:
``./xmosdfu XMOS_L2_AUDIO2_PID --download new_firmware.bin``
``./bin/xmosdfu XMOS_L2_AUDIO2_PID --download new_firmware.bin``
Replace ``XMOS_L2_AUDIO2_PID`` with product ID of your target device. Invoke
``xmosdfu`` with no arguments to get a list of all supported product IDs.
@@ -35,7 +38,7 @@ present.
Run the command:
``./xmosdfu XMOS_L2_AUDIO2_PID --upload currentfirmware.bin``
``./bin/xmosdfu XMOS_L2_AUDIO2_PID --upload currentfirmware.bin``
The file ``currentfirmware.bin`` contains the latest upgrade image. This file is
an exact copy of the data from the flash and can be downloaded to the device
@@ -47,6 +50,6 @@ Reverting firmware to factory image
To revert the device back to its factory (i.e XFLASH) installed state from the
new firmware, run the command:
``./xmosdfu XMOS_L2_AUDIO2_PID --revertfactory``
``./bin/xmosdfu XMOS_L2_AUDIO2_PID --revertfactory``
The device will now be running, and only contain the factory firmware.

View File

@@ -1,135 +0,0 @@
Software Release License Agreement
Copyright (c) 2017-2018, XMOS, All rights reserved.
BY ACCESSING, USING, INSTALLING OR DOWNLOADING THE XMOS SOFTWARE, YOU AGREE TO BE BOUND BY THE FOLLOWING TERMS. IF YOU DO NOT AGREE TO THESE, DO NOT ATTEMPT TO DOWNLOAD, ACCESS OR USE THE XMOS Software.
Parties:
(1) XMOS Limited, incorporated and registered in England and Wales with company number 5494985 whose registered office is 107 Cheapside, London, EC2V 6DN (XMOS).
(2) An individual or legal entity exercising permissions granted by this License (Customer).
If you are entering into this Agreement on behalf of another legal entity such as a company, partnership, university, college etc. (for example, as an employee, student or consultant), you warrant that you have authority to bind that entity.
1. Definitions
"License" means this Software License and any schedules or annexes to it.
"License Fee" means the fee for the XMOS Software as detailed in any schedules or annexes to this Software License
"Licensee Modifications" means all developments and modifications of the XMOS Software developed independently by the Customer.
"XMOS Modifications" means all developments and modifications of the XMOS Software developed or co-developed by XMOS.
"XMOS Hardware" means any XMOS hardware devices supplied by XMOS from time to time and/or the particular XMOS devices detailed in any schedules or annexes to this Software License.
"XMOS Software" comprises the XMOS owned circuit designs, schematics, source code, object code, reference designs, (including related programmer comments and documentation, if any), error corrections, improvements, modifications (including XMOS Modifications) and updates.
The headings in this License do not affect its interpretation. Save where the context otherwise requires, references to clauses and schedules are to clauses and schedules of this License.
Unless the context otherwise requires:
- references to XMOS and the Customer include their permitted successors and assigns;
- references to statutory provisions include those statutory provisions as amended or re-enacted; and
- references to any gender include all genders.
Words in the singular include the plural and in the plural include the singular.
2. License
XMOS grants the Customer a non-exclusive license to use, develop, modify and distribute the XMOS Software with, or for the purpose of being used with, XMOS Hardware.
Open Source Software (OSS) must be used and dealt with in accordance with any license terms under which OSS is distributed.
3. Consideration
In consideration of the mutual obligations contained in this License, the parties agree to its terms.
4. Term
Subject to clause 12 below, this License shall be perpetual.
5. Restrictions on Use
The Customer will adhere to all applicable import and export laws and regulations of the country in which it resides and of the United States and United Kingdom, without limitation. The Customer agrees that it is its responsibility to obtain copies of and to familiarise itself fully with these laws and regulations to avoid violation.
6. Modifications
The Customer will own all intellectual property rights in the Licensee Modifications but will undertake to provide XMOS with any fixes made to correct any bugs found in the XMOS Software on a non-exclusive, perpetual and royalty free license basis.
XMOS will own all intellectual property rights in the XMOS Modifications.
The Customer may only use the Licensee Modifications and XMOS Modifications on, or in relation to, XMOS Hardware.
7. Support
Support of the XMOS Software may be provided by XMOS pursuant to a separate support agreement.
8. Warranty and Disclaimer
The XMOS Software is provided "AS IS" without a warranty of any kind. XMOS and its licensors' entire liability and Customer's exclusive remedy under this warranty to be determined in XMOS's sole and absolute discretion, will be either (a) the corrections of defects in media or replacement of the media, or (b) the refund of the license fee paid (if any).
Whilst XMOS gives the Customer the ability to load their own software and applications onto XMOS devices, the security of such software and applications when on the XMOS devices is the Customer's own responsibility and any breach of security shall not be deemed a defect or failure of the hardware. XMOS shall have no liability whatsoever in relation to any costs, damages or other losses Customer may incur as a result of any breaches of security in relation to your software or applications.
XMOS AND ITS LICENSORS DISCLAIM ALL OTHER WARRANTIES, EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY/ SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT EXCEPT TO THE EXTENT THAT THESE DISCLAIMERS ARE HELD TO BE LEGALLY INVALID UNDER APPLICABLE LAW.
9. High Risk Activities
The XMOS Software is not designed or intended for use in conjunction with on-line control equipment in hazardous environments requiring fail-safe performance, including without limitation the operation of nuclear facilities, aircraft navigation or communication systems, air traffic control, life support machines, or weapons systems (collectively "High Risk Activities") in which the failure of the XMOS Software could lead directly to death, personal injury, or severe physical or environmental damage. XMOS and its licensors specifically disclaim any express or implied warranties relating to use of the XMOS Software in connection with High Risk Activities.
10. Liability
TO THE EXTENT NOT PROHIBITED BY APPLICABLE LAW, NEITHER XMOS NOR ITS LICENSORS SHALL BE LIABLE FOR ANY LOST REVENUE, BUSINESS, PROFIT, CONTRACTS OR DATA, ADMINISTRATIVE OR OVERHEAD EXPENSES, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES HOWEVER CAUSED AND REGARDLESS OF THEORY OF LIABILITY ARISING OUT OF THIS LICENSE, EVEN IF XMOS HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. In no event shall XMOS's liability to the Customer whether in contract, tort (including negligence), or otherwise exceed the License Fee.
Customer agrees to indemnify, hold harmless, and defend XMOS and its licensors from and against any claims or lawsuits, including attorneys' fees and any other liabilities, demands, proceedings, damages, losses, costs, expenses fines and charges which are made or brought against or incurred by XMOS as a result of your use or distribution of the Licensee Modifications or your use or distribution of XMOS Software, or any development of it, other than in accordance with the terms of this License.
11. Ownership
The copyrights and all other intellectual and industrial property rights for the protection of information with respect to the XMOS Software (including the methods and techniques on which they are based) are retained by XMOS and/or its licensors. Nothing in this Agreement serves to transfer such rights. Customer may not sell, mortgage, underlet, sublease, sublicense, lend or transfer possession of the XMOS Software in any way whatsoever to any third party who is not bound by this Agreement.
12. Termination
Either party may terminate this License at any time on written notice to the other if the other:
- is in material or persistent breach of any of the terms of this License and either that breach is incapable of remedy, or the other party fails to remedy that breach within 30 days after receiving written notice requiring it to remedy that breach; or
- is unable to pay its debts (within the meaning of section 123 of the Insolvency Act 1986), or becomes insolvent, or is subject to an order or a resolution for its liquidation, administration, winding-up or dissolution (otherwise than for the purposes of a solvent amalgamation or reconstruction), or has an administrative or other receiver, manager, trustee, liquidator, administrator or similar officer appointed over all or any substantial part of its assets, or enters into or proposes any composition or arrangement with its creditors generally, or is subject to any analogous event or proceeding in any applicable jurisdiction.
Termination by either party in accordance with the rights contained in clause 12 shall be without prejudice to any other rights or remedies of that party accrued prior to termination.
On termination for any reason:
- all rights granted to the Customer under this License shall cease;
- the Customer shall cease all activities authorised by this License;
- the Customer shall immediately pay any sums due to XMOS under this License; and
- the Customer shall immediately destroy or return to the XMOS (at the XMOS's option) all copies of the XMOS Software then in its possession, custody or control and, in the case of destruction, certify to XMOS that it has done so.
Clauses 5, 8, 9, 10 and 11 shall survive any effective termination of this Agreement.
13. Third party rights
No term of this License is intended to confer a benefit on, or to be enforceable by, any person who is not a party to this license.
14. Confidentiality and publicity
Each party shall, during the term of this License and thereafter, keep confidential all, and shall not use for its own purposes nor without the prior written consent of the other disclose to any third party any, information of a confidential nature (including, without limitation, trade secrets and information of commercial value) which may become known to such party from the other party and which relates to the other party, unless such information is public knowledge or already known to such party at the time of disclosure, or subsequently becomes public knowledge other than by breach of this license, or subsequently comes lawfully into the possession of such party from a third party.
The terms of this license are confidential and may not be disclosed by the Customer without the prior written consent of XMOS.
The provisions of clause 14 shall remain in full force and effect notwithstanding termination of this license for any reason.
15. Entire agreement
This License and the documents annexed as appendices to this License or otherwise referred to herein contain the whole agreement between the parties relating to the subject matter hereof and supersede all prior agreements, arrangements and understandings between the parties relating to that subject matter.
16. Assignment
The Customer shall not assign this License or any of the rights granted under it without XMOS's prior written consent.
17. Governing law and jurisdiction
This License shall be governed by and construed in accordance with English law and each party hereby submits to the non-exclusive jurisdiction of the English courts.
This License has been entered into on the date stated at the beginning of it.
Schedule
XMOS lib_xua software

View File

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

View File

@@ -1,18 +0,0 @@
.. _usb_audiosec_building_xmos_dfu:
Building the XMOS DFU loader - macOS
====================================
The XMOS DFU loader is provided as source as part of the USB Audio
framework, located in sc_usb_audio/module_dfu/host/xmos_dfu_osx.
The loader is compiled using libusb, the code for the loader is contained in the
file ``xmosdfu.cpp``
To build the loader a Makefile is provided, which can be run as follows:
``make -f Makefile.OSX all``
This Makefile contains the following:
.. literalinclude:: Makefile.OSX

View File

@@ -0,0 +1,84 @@
*******************************
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

@@ -0,0 +1,21 @@
APP_NAME = app_xua_simple
TARGET = xk-audio-216-mc.xn
# The flags passed to xcc when building the application
XCC_FLAGS = -fcomment-asm -Xmapper --map -Xmapper MAPFILE -O3 -report -save-temps \
-g -Wno-unused-function -Wno-timing -DXUD_SERIES_SUPPORT=XUD_X200_SERIES \
-DXUD_CORE_CLOCK=600 -DUSB_TILE=tile[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.
# Modules are expected to be in the directory above the BASE_DIR directory.
USED_MODULES = lib_xua lib_device_control lib_xud lib_i2c
#=============================================================================
# The following part of the Makefile includes the common build infrastructure
# for compiling XMOS applications. You should not need to edit below here.
XMOS_MAKE_PATH ?= ../..
include $(XMOS_MAKE_PATH)/xcommon/module_xcommon/build/Makefile.common

View File

@@ -0,0 +1,32 @@
Simple USB Audio Device using lib_xua
=====================================
Summary
-------
Software dependencies
.....................
For a list of direct dependencies, look for USED_MODULES in the Makefile.
Required hardware
.................
The example code provided with the application has been implemented
and tested on the xCORE-200 Multi-channel Audio Board
Prerequisites
.............
* This document assumes familiarity with the XMOS xCORE architecture,
the XMOS tool chain and the xC language. Documentation related to these
aspects which are not specific to this application note are linked to in
the references appendix.
* For a description of XMOS related terms found in this document
please see the XMOS Glossary [#]_.
.. [#] http://www.xmos.com/published/glossary

View File

@@ -0,0 +1,249 @@
.. include:: ../../README.rst
|newpage|
Overview
--------
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 Makefile
------------
To start using ``lib_xua``, you need to add ``lib_xua`` to your Makefile::
USED_MODULES = .. lib_xua ...
This demo also uses the XMOS USB Device library (``lib_xud``) for low-level USB connectivity.
The Makefile also includes::
USED_MODULES = .. lib_xud ..
``lib_xud`` library requires some flags for correct operation. Firstly the
tile on which ``lib_xud`` will be execute, for example::
XCC_FLAGS = .. -DUSB_TILE=tile[1] ..
Secondly, the architecture of the target device, for example::
XCC_FLAGS = .. -DXUD_SERIES_SUPPORT=XUD_X200_SERIES ..
Includes
........
This application requires the system header that defines XMOS xCORE specific
defines for declaring and initialising hardware:
.. literalinclude:: app_xua_simple.xc
:start-on: include <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
:start-on: include "xua.h"
:end-on: include "xud_device.h"
Allocating hardware resources
.............................
A basic implementation of a USB Audio device (i.e. simple stereo input and output via I2S)
using ``lib_xua`` requires the follow pins:
- I2S Bit Clock (from xCORE to DAC)
- I2S L/R clock (from xCORE to DAC)
- I2S Data line (from xCORE to DAC)
- I2S Data line (from ADC to xCORE)
- Audio Master clock (from clock source to xCORE)
.. note::
This application note assumes xCORE is I2S bus master
On an xCORE the pins are controlled by ``ports``. The application therefore declares various ``ports``
for this purpose:
.. literalinclude:: app_xua_simple.xc
:start-on: /* Port declaration
:end-on: 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.
These ports are declared as follows:
.. literalinclude:: app_xua_simple.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
:start-on: /* Clock-block
:end-on: clock clk_audio_mclk_usb
Again, for the same reasoning as the master-clock ports, two master-clock clock-blocks are required
- one on each tile.
Other declarations
..................
``lib_xua`` currently requires the manual declaration of tables for the endpoint types for
``lib_xud`` and the calling the main XUD funtion in a par (``XUD_Main()``).
For a simple application the following endpoints are required:
- ``Control`` enpoint zero
- ``Isochonous`` endpoint for each direction for audio data to/from the USB host
These are declared as follows:
.. literalinclude:: app_xua_simple.xc
:start-on: /* Endpoint type tables
:end-on: XUD_EpType epTypeTableIn
The application main() function
-------------------------------
The ``main()`` function sets up the tasks in the application.
Various channels are required in order to allow the required tasks to communcate.
These must first be declared:
.. literalinclude:: app_xua_simple.xc
:start-on: /* Channels for lib_xud
:end-on: chan c_aud_ctl
The rest of the ``main()`` function starts all of the tasks in parallel
using the xC ``par`` construct:
.. literalinclude:: app_xua_simple.xc
:start-on: par
:end-before: return 0
This code starts the low-level USB task, an Endpoint 0 task, an Audio buffering task and a task to handle
the audio I/O (i.e. I2S signalling).
Configuration
.............
``lib_xua`` has many parameters than can be configured at build time, some examples include:
- Sample-rates
- Channel counts
- Audio Class version
- Product/Vendor ID's
- Various product strings
- Master clock frequency
These parameters are set via defines in an optional ``xua_conf.h`` header file. For this simple application the contents
of this file might look something like the following:
.. literalinclude:: xua_conf.h
:start-on: // Copyright
:end-on: #endif
Some items have sensible default values, items like strings and sample rates for example. However, some items are specific to a hardware
implentation e.g. master clock frequencies and must be defined. Please see the ``lib_xua`` library documentation for full details.
|appendix|
|newpage|
Demo Hardware Setup
-------------------
To run the demo, connect a USB cable to power the xCORE-200 MC Audio board
and plug the xTAG to the board and connect the xTAG USB cable to your
development machine.
.. figure:: images/hw_setup.*
:width: 80%
Hardware setup
|newpage|
Launching the demo application
------------------------------
Once the demo example has been built either from the command line using xmake or
via the build mechanism of xTIMEcomposer studio it can be executed on the xCORE-200
MC Audio board.
Once built there will be a ``bin/`` directory within the project which contains
the binary for the xCORE device. The xCORE binary has a XMOS standard .xe extension.
Launching from the command line
...............................
From the command line you use the ``xrun`` tool to download and run the code
on the xCORE device::
xrun --xscope bin/app_xua_simple.xe
Once this command has executed the application will be running on the
xCORE-200 MC Audio Board
Launching from xTIMEcomposer Studio
...................................
From xTIMEcomposer Studio use the run mechanism to download code to xCORE device.
Select the xCORE binary from the ``bin/`` directory, right click and go to Run
Configurations. Double click on xCORE application to create a new run configuration,
enable the xSCOPE I/O mode in the dialog box and then
select Run.
Once this command has executed the application will be running on the
xCORE-200 MC Audio board.
Running the application
.......................
Once running the device will be detected as a USB Audio device - note, Windows operating
systems may require a third party driver for correct operation
|newpage|
References
----------
.. nopoints::
* XMOS Tools User Guide
http://www.xmos.com/published/xtimecomposer-user-guide
* XMOS xCORE Programming Guide
http://www.xmos.com/published/xmos-programming-guide
* XMOS lib_xua Library
http://www.xmos.com/support/libraries/lib_xua
* XMOS lib_xud Library
http://www.xmos.com/support/libraries/lib_xud
|newpage|
Full source code listing
------------------------
Source code for main.xc
.......................
.. literalinclude:: app_xua_simple.xc
:largelisting:
|newpage|

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

View File

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

View File

@@ -1,20 +1,21 @@
// Copyright (c) 2017-2018, XMOS Ltd, All rights reserved
// 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
* - No DFU
* - I2S only
* - I2S only
*
*/
#include <xs1.h>
#include <platform.h>
#include "xud_device.h"
#include "xua.h"
#include "xud_device.h"
/* Port declarations. Note, the defines come from the xn file */
buffered out port:32 p_i2s_dac[] = {PORT_I2S_DAC0}; /* I2S Data-line(s) */
@@ -22,21 +23,17 @@ 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 */
/* Note, declared unsafe as sometimes we want to share this port
e.g. PDM mics and I2S use same master clock IO */
port p_mclk_in_ = PORT_MCLK_IN;
unsafe
{
/* TODO simplify this */
unsafe port p_mclk_in; /* Audio master clock input */
}
/* Master clock for the audio IO tile */
in port p_mclk_in = PORT_MCLK_IN;
/* Resources for USB feedback */
in port p_for_mclk_count = PORT_MCLK_COUNT; /* Extra port for counting master clock ticks */
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_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 */
/* 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 */
@@ -52,39 +49,40 @@ int main()
/* Channel for communicating SOF notifications from XUD to the Buffering cores */
chan c_sof;
/* Channel for audio data between buffering cores and audio IO core */
/* Channel for audio data between buffering cores and AudioHub/IO core */
chan c_aud;
/* Channel for communcating control messages from EP0 to the rest of the device (via the buffering cores */
/* 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 */
/* Low level USB device layer core */
on tile[1]: XUD_Main(c_ep_out, 2, c_ep_in, 2,
c_sof, epTypeTableOut, epTypeTableIn,
/* TODO rm me! */
null, null, -1 ,
XUD_SPEED_HS, XUD_PWR_BUS);
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);
/* 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]: XUA_Buffer(c_ep_out[1], c_ep_in[1], c_sof, c_aud_ctl, p_for_mclk_count, c_aud);
on tile[1]: {
/* 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 */
start_clock(clk_audio_mclk_usb); /* Set the clock off running */
XUA_Buffer(c_ep_out[1], c_ep_in[1], c_sof, c_aud_ctl, p_for_mclk_count, c_aud);
/* IOHub core does most of the audio IO i.e. I2S (also serves as a hub for all audio) */
on tile[0]: {
unsafe
{
p_mclk_in = p_mclk_in_;
}
XUA_AudioHub(c_aud);
}
/* 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);
}
return 0;
}

View File

@@ -1,4 +1,5 @@
// Copyright (c) 2017-2018, XMOS Ltd, All rights reserved
// 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_

View File

@@ -1,4 +1,5 @@
// Copyright (c) 2017-2018, XMOS Ltd, All rights reserved
// 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_

View File

@@ -0,0 +1,168 @@
// 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.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 = 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 = 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 = 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 = 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 = HID_REPORT_SET_HEADER(1, HID_REPORT_ITEM_TYPE_LOCAL, HID_REPORT_ITEM_TAG_USAGE),
.data = { 0x01, 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_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 elements in the HID Report descriptor.
*/
static USB_HID_Report_Element_t* const hidConfigurableElements[] = {
&hidUsageByte0Bit0,
&hidUsageByte0Bit1,
&hidUsageByte0Bit2,
&hidUsageByte0Bit3,
&hidUsageByte0Bit4,
&hidUsageByte0Bit5
};
/*
* 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_Report_Element_t* const hidReports[] = {
&hidReportPageConsumer
};
/*
* List all items in the HID Report descriptor.
*/
static const USB_HID_Short_Item_t* const hidReportDescriptorItems[] = {
&(hidReportPageConsumer.item),
&hidUsageConsumerControl,
&hidCollectionApplication,
&hidLogicalMinimum0,
&hidLogicalMaximum1,
&(hidUsageByte0Bit0.item),
&(hidUsageByte0Bit1.item),
&(hidUsageByte0Bit2.item),
&(hidUsageByte0Bit3.item),
&(hidUsageByte0Bit4.item),
&(hidUsageByte0Bit5.item),
&hidReportSize1,
&hidReportCount6,
&hidInputDataVar,
&hidLogicalMaximum0,
&hidReportCount2,
&hidInputConstArray,
&hidCollectionEnd
};
/*
* 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_COUNT ( 1 )
#endif // __hid_report_descriptor_h__

View File

@@ -1,16 +1,17 @@
// Copyright (c) 2016-2018, XMOS Ltd, All rights reserved
// Copyright 2016-2022 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.
#include <platform.h>
#include <timer.h>
#include <stdint.h>
#include "xua.h"
#include "i2c_shared.h"
#include "i2c.h" /* From lib_i2c */
#include "cs5368.h"
#include "cs4384.h"
on tile [0] : struct r_i2c r_i2c = {XS1_PORT_4A};
port p_i2c = on tile[0]:XS1_PORT_4A;
/* General output port bit definitions */
#define P_GPIO_DSD_MODE (1 << 0) /* DSD mode select 0 = 8i/8o I2S, 1 = 8o DSD*/
@@ -22,17 +23,16 @@ on tile [0] : struct r_i2c r_i2c = {XS1_PORT_4A};
#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) {data[0] = val; i2c_shared_master_write_reg(r_i2c, CS4384_I2C_ADDR, reg, data, 1);}
#define DAC_REGREAD(reg, val) {i2c_shared_master_read_reg(r_i2c, CS4384_I2C_ADDR, reg, val, 1);}
#define ADC_REGWRITE(reg, val) {data[0] = val; i2c_shared_master_write_reg(r_i2c, CS5368_I2C_ADDR, reg, data, 1);}
#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 AudioHwConfig(unsigned samFreq, unsigned mClk, unsigned dsdMode,
unsigned sampRes_DAC, unsigned sampRes_ADC)
void AudioHwConfig2(unsigned samFreq, unsigned mClk, unsigned dsdMode, unsigned sampRes_DAC, unsigned sampRes_ADC, client interface i2c_master_if i2c)
{
unsigned char data[1] = {0};
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)
@@ -50,7 +50,7 @@ void AudioHwConfig(unsigned samFreq, unsigned mClk, unsigned dsdMode,
delay_microseconds(20000);
/* Take ADC out of reset */
gpioVal |= P_GPIO_ADC_RST_N;
gpioVal |= P_GPIO_ADC_RST_N;
p_gpio <: gpioVal;
/* Configure ADC for I2S slave mode via I2C */
@@ -58,7 +58,7 @@ void AudioHwConfig(unsigned samFreq, unsigned mClk, unsigned dsdMode,
dif = 0x01; /* I2S */
mode = 0x03; /* Slave mode all speeds */
/* Reg 0x01: (GCTL) Global Mode Control Register
/* 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
@@ -67,6 +67,7 @@ void AudioHwConfig(unsigned samFreq, unsigned mClk, unsigned dsdMode,
*/
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
@@ -91,7 +92,7 @@ void AudioHwConfig(unsigned samFreq, unsigned mClk, unsigned dsdMode,
*/
DAC_REGWRITE(CS4384_MODE_CTRL, 0b11000001);
/* PCM Control (Address: 0x03) */
/* 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)
@@ -120,6 +121,8 @@ void AudioHwConfig(unsigned samFreq, unsigned mClk, unsigned dsdMode,
*/
DAC_REGWRITE(CS4384_MODE_CTRL, 0b10000000);
/* Kill the i2c task */
i2c.shutdown();
return;
}
@@ -128,8 +131,16 @@ void AudioHwInit()
/* Set USB Mux to micro-b */
/* ADC and DAC in reset */
p_gpio <: P_GPIO_USB_SEL0 | P_GPIO_USB_SEL1;
/* Init the i2c module */
i2c_shared_master_init(r_i2c);
}
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]);
}
}

View File

@@ -40,9 +40,10 @@
</Tile>
<Tile Number="1" Reference="tile[1]">
<!-- USB intended to run on this tile -->
<!-- Audio Ports -->
<!-- Ports for USB feedback calculation -->
<Port Location="XS1_PORT_16B" Name="PORT_MCLK_COUNT"/>
<Port Location="XS1_PORT_1L" Name="PORT_MCLK_IN2"/>
<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 -->
@@ -74,7 +75,7 @@
</Link>
</Links>
<ExternalDevices>
<Device NodeId="0" Tile="0" Class="SQIFlash" Name="bootFlash" Type="S25FL116K">
<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"/>

View File

@@ -0,0 +1,27 @@
// Copyright 2017-2022 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.
#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 I2S_CHANS_DAC 2 /* Number of I2S channels out of xCORE */
#define I2S_CHANS_ADC 2 /* 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 */
#define MAX_FREQ 48000 /* Maximum sample rate */
#define EXCLUDE_USB_AUDIO_MAIN
#define VENDOR_STR "XMOS"
#define VENDOR_ID 0x20B1
#define PRODUCT_STR_A2 "XUA Example"
#define PRODUCT_STR_A1 "XUA Example"
#define PID_AUDIO_1 1
#define PID_AUDIO_2 2
#define XUA_DFU_EN 0 /* Disable DFU (for simplicity of example */
#define MIC_DUAL_ENABLED 0 // Use multi-threaded design
#endif

View File

@@ -1,4 +1,5 @@
// Copyright (c) 2017-2018, XMOS Ltd, All rights reserved
// Copyright 2017-2021 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.
#include "xua_conf.h"

View File

@@ -0,0 +1,84 @@
*******************************
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

@@ -3,13 +3,15 @@ APP_NAME = app_xua_simple
TARGET = xk-audio-216-mc.xn
# The flags passed to xcc when building the application
XCC_FLAGS = -fcomment-asm -Xmapper --map -Xmapper MAPFILE -O3 -report -fsubword-select -save-temps -g -Wno-unused-function -Wno-timing -DXUD_SERIES_SUPPORT=XUD_X200_SERIES -DUSB_TILE=tile[1] -DSDA_HIGH=2 -DSCL_HIGH=1
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 \
-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.
# Modules are expected to be in the directory above the BASE_DIR directory.
USED_MODULES = lib_mic_array lib_logging lib_xua lib_device_control lib_xud module_i2c_shared module_i2c_single_port module_locks
USED_MODULES = lib_xua lib_xud lib_spdif
#=============================================================================
# The following part of the Makefile includes the common build infrastructure

View File

@@ -0,0 +1,32 @@
Using lib_xua with lib_spdif (transmit)
=======================================
Summary
-------
Software dependencies
.....................
For a list of direct dependencies, look for USED_MODULES in the Makefile.
Required hardware
.................
The example code provided with the application has been implemented
and tested on the xCORE-200 Multi-channel Audio Board
Prerequisites
.............
* This document assumes familiarity with the XMOS xCORE architecture,
the XMOS tool chain and the xC language. Documentation related to these
aspects which are not specific to this application note are linked to in
the references appendix.
* For a description of XMOS related terms found in this document
please see the XMOS Glossary [#]_.
.. [#] http://www.xmos.com/published/glossary

View File

@@ -0,0 +1,278 @@
.. include:: ../../README.rst
|newpage|
Overview
--------
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 with
S/PDIF transmit functionality the xCORE-200 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
note.
The Makefile
------------
To start using ``lib_xua``, you need to add ``lib_xua`` and ``lib_spdif`` to your Makefile::
USED_MODULES = .. lib_xua lib_spdif ...
This demo also uses the XMOS USB Device library (``lib_xud``) for low-level USB connectivity.
The Makefile also includes::
USED_MODULES = .. lib_xud ..
``lib_xud`` library requires some flags for correct operation. Firstly the
tile on which ``lib_xud`` will be execute, for example::
XCC_FLAGS = .. -DUSB_TILE=tile[1] ..
Secondly, the architecture of the target device, for example::
XCC_FLAGS = .. -DXUD_SERIES_SUPPORT=XUD_X200_SERIES ..
Includes
--------
This application requires the system header that defines XMOS xCORE specific
defines for declaring and initialising hardware:
.. literalinclude:: app_xua_simple.xc
:start-on: include <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
: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
:start-on: /* From lib_spdif
:end-on: include "spdif.h"
Declarations
------------
Allocating hardware resources for lib_xua
.........................................
A minimal implementation of a USB Audio device, without I2S functionalilty,
using ``lib_xua`` requires the follow pins:
- Audio Master clock (from clock source to xCORE)
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
: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
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
: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
:start-on: /* Clock-block
:end-on: clock clk_audio_mclk_usb
Again, for the same reasoning as the master-clock ports, two master-clock clock-blocks are required
- one on each tile.
Allocating hardware resources for lib_spdif
...........................................
The S/PDIF transmitter requires a single (buffered) 1-bit port:
.. literalinclude:: app_xua_simple.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
:start-on: clock clk_spdif_tx
:end-before: /* Lib_xua
Other declarations
..................
``lib_xua`` currently requires the manual declaration of tables for the endpoint types for
``lib_xud`` and the calling the main XUD function in a par (``XUD_Main()``).
For a simple application the following endpoints are required:
- ``Control`` enpoint zero
- ``Isochonous`` endpoint for each direction for audio data to/from the USB host
These are declared as follows:
.. literalinclude:: app_xua_simple.xc
:start-on: /* Endpoint type tables
:end-on: XUD_EpType epTypeTableIn
Configuring lib_xua
-------------------
``lib_xua`` must be configued to enable S/PDIF Tx functionality.
``lib_xua`` has many parameters than can be configured at build time, some examples include:
- Sample-rates
- Channel counts
- Audio Class version
- Product/Vendor ID's
- Various product strings
- Master clock frequency
To enable S/PDIF functionality ``XUA_SPDIF_TX_EN`` must be set to a non-zero value. Setting this will cause the ``XUA_AudioHub``
tasks to forward samples and sample rate information to the S/PDIF transmitter task.
These parameters are set via defines in an optional ``xua_conf.h`` header file. For this simple application the
complete contents of this file are as follows:
.. literalinclude:: xua_conf.h
:start-on: // Copyright
:end-on: #endif
The application main() function
-------------------------------
The ``main()`` function sets up the tasks in the application.
Various channels are required in order to allow the required tasks to communcate.
These must first be declared:
.. literalinclude:: app_xua_simple.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
: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
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.
|appendix|
|newpage|
Demo Hardware Setup
-------------------
To run the demo, connect a USB cable to power the xCORE-200 MC Audio board
and plug the xTAG to the board and connect the xTAG USB cable to your
development machine.
.. figure:: images/hw_setup.*
:width: 80%
Hardware setup
|newpage|
Launching the demo application
------------------------------
Once the demo example has been built either from the command line using xmake or
via the build mechanism of xTIMEcomposer studio it can be executed on the xCORE-200
MC Audio board.
Once built there will be a ``bin/`` directory within the project which contains
the binary for the xCORE device. The xCORE binary has a XMOS standard .xe extension.
Launching from the command line
...............................
From the command line you use the ``xrun`` tool to download and run the code
on the xCORE device::
xrun --xscope bin/app_xua_simple.xe
Once this command has executed the application will be running on the
xCORE-200 MC Audio Board
Launching from xTIMEcomposer Studio
...................................
From xTIMEcomposer Studio use the run mechanism to download code to xCORE device.
Select the xCORE binary from the ``bin/`` directory, right click and go to Run
Configurations. Double click on xCORE application to create a new run configuration,
enable the xSCOPE I/O mode in the dialog box and then
select Run.
Once this command has executed the application will be running on the
xCORE-200 MC Audio board.
Running the application
.......................
Once running the device will be detected as a USB Audio device - note, Windows operating
systems may require a third party driver for correct operation
|newpage|
References
----------
.. nopoints::
* XMOS Tools User Guide
http://www.xmos.com/published/xtimecomposer-user-guide
* XMOS xCORE Programming Guide
http://www.xmos.com/published/xmos-programming-guide
* XMOS lib_xua Library
http://www.xmos.com/support/libraries/lib_xua
* XMOS lib_xud Library
http://www.xmos.com/support/libraries/lib_xud
|newpage|
Full source code listing
------------------------
Source code for main.xc
.......................
.. literalinclude:: app_xua_simple.xc
:largelisting:
|newpage|

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

View File

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

View File

@@ -0,0 +1,106 @@
// 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
*
* - S/PDIF output only
* - No DFU
*
*/
#include <xs1.h>
#include <platform.h>
#include "xua.h"
#include "xud_device.h"
/* From lib_spdif */
#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 */
clock clk_spdif_tx = on tile[0]: 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 */
/* Resources for USB feedback */
in port p_for_mclk_count = PORT_MCLK_COUNT; /* Extra port for counting master clock ticks */
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 */
/* 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};
int main()
{
/* Channels for lib_xud */
chan c_ep_out[2];
chan c_ep_in[2];
/* Channel for communicating SOF notifications from XUD to the Buffering cores */
chan c_sof;
/* 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;
/* Channel for communication between AudioHub and S/PDIF transmitter */
chan c_spdif_tx;
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);
/* 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);
/* 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]: {
/* 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 */
start_clock(clk_audio_mclk_usb); /* Set the clock off running */
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]: {
/* 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);
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);
}
}
}
return 0;
}

View File

@@ -0,0 +1,168 @@
// 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.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 = 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 = 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 = 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 = 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 = HID_REPORT_SET_HEADER(1, HID_REPORT_ITEM_TYPE_LOCAL, HID_REPORT_ITEM_TAG_USAGE),
.data = { 0x01, 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_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 elements in the HID Report descriptor.
*/
static USB_HID_Report_Element_t* const hidConfigurableElements[] = {
&hidUsageByte0Bit0,
&hidUsageByte0Bit1,
&hidUsageByte0Bit2,
&hidUsageByte0Bit3,
&hidUsageByte0Bit4,
&hidUsageByte0Bit5
};
/*
* 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_Report_Element_t* const hidReports[] = {
&hidReportPageConsumer
};
/*
* List all items in the HID Report descriptor.
*/
static const USB_HID_Short_Item_t* const hidReportDescriptorItems[] = {
&(hidReportPageConsumer.item),
&hidUsageConsumerControl,
&hidCollectionApplication,
&hidLogicalMinimum0,
&hidLogicalMaximum1,
&(hidUsageByte0Bit0.item),
&(hidUsageByte0Bit1.item),
&(hidUsageByte0Bit2.item),
&(hidUsageByte0Bit3.item),
&(hidUsageByte0Bit4.item),
&(hidUsageByte0Bit5.item),
&hidReportSize1,
&hidReportCount6,
&hidInputDataVar,
&hidLogicalMaximum0,
&hidReportCount2,
&hidInputConstArray,
&hidCollectionEnd
};
/*
* 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_COUNT ( 1 )
#endif // __hid_report_descriptor_h__

View File

@@ -0,0 +1,52 @@
// Copyright 2016-2021 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.
#include <platform.h>
#include <timer.h>
#include "xua.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.*/
out port p_gpio = on tile[0]:XS1_PORT_8C;
void AudioHwConfig(unsigned samFreq, unsigned mClk, unsigned dsdMode,
unsigned sampRes_DAC, unsigned sampRes_ADC)
{
unsigned char gpioVal = 0;
/* Set master clock select appropriately and put ADC and DAC into reset */
if (mClk == MCLK_441)
{
gpioVal = P_GPIO_USB_SEL0 | P_GPIO_USB_SEL1;
}
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;
}
void AudioHwInit()
{
/* Set USB Mux to micro-b */
/* ADC and DAC in reset */
p_gpio <: P_GPIO_USB_SEL0 | P_GPIO_USB_SEL1;
}

View File

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

View File

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

@@ -0,0 +1,84 @@
*******************************
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

@@ -0,0 +1,22 @@
APP_NAME = app_xua_simple
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 \
-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.
# Modules are expected to be in the directory above the BASE_DIR directory.
USED_MODULES = lib_xua lib_xud lib_mic_array
#=============================================================================
# The following part of the Makefile includes the common build infrastructure
# for compiling XMOS applications. You should not need to edit below here.
XMOS_MAKE_PATH ?= ../..
include $(XMOS_MAKE_PATH)/xcommon/module_xcommon/build/Makefile.common

View File

@@ -0,0 +1,35 @@
Using lib_xua with lib_mic_array
================================
Summary
-------
This applicaition note describes how to use ``lib_mic_array`` in conjunction with ``lib_xua``
to implement a USB Audio device with the ability to record from multiple PDM microphones.
Software dependencies
.....................
For a list of direct dependencies, look for USED_MODULES in the Makefile.
Required hardware
.................
The example code provided with the application has been implemented
and tested on the xCORE-200 Array Microphone board.
Prerequisites
.............
* This document assumes familiarity with the XMOS xCORE architecture,
the XMOS tool chain and the xC language. Documentation related to these
aspects which are not specific to this application note are linked to in
the references appendix.
* For a description of XMOS related terms found in this document
please see the XMOS Glossary [#]_.
.. [#] http://www.xmos.com/published/glossary

View File

@@ -0,0 +1,315 @@
.. include:: ../../README.rst
|newpage|
Overview
--------
Introduction
............
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
record functionality from PDM microphones on the xCORE-200 Array Microphone board.
Core PDM microphone functionality is contained in` ``lib_mic_array``. This library includes both the physical
interfacing to the PDM microphones as well as efficient decimation to user selectable output
sample rates - essentially providing PDM to PCM conversion.
To reduce complexity this application note does not enable any other audio interfaces other than recording
from PDM microphones (i.e. no I2S and the on board DAC is not configured.
Readers are encouraged to read application note AN00246 in conjunction with this application note.
The Makefile
------------
To start using ``lib_xua``, you need to add ``lib_xua`` to the Makefile. ``lib_mic_array`` should also be
added for this application example::
USED_MODULES = .. lib_xua lib_mic_array ...
This demo also uses the XMOS USB Device library (``lib_xud``) for low-level USB connectivity.
The Makefile therefore also includes this lib::
USED_MODULES = .. lib_xud ..
``lib_xud`` library requires some flags for correct operation. Firstly 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
--------
This application requires the system header files that contains XMOS xCORE specific
defines for declaring and initialising hardware:
.. literalinclude:: app_xua_simple.xc
:start-on: include <xs1.h>
:end-before: include "xua.h"
The XUA and XUD library functions are defined in header files ``xua.h`` and ``xud_device.h`` respectively. These headers must
be included in the code in order to use these libraries.
.. literalinclude:: app_xua_simple.xc
:start-on: include "xua.h"
:end-on: include "xud_device.h"
The application uses PDM interfacing and decimation code from ``lib_mic_array``. This header
must be included in the code.
.. literalinclude:: app_xua_simple.xc
:start-on: /* From lib_mic
:end-on: include "mic_array.h"
Declarations
------------
Allocating hardware resources for lib_xua
.........................................
A minimal implementation of a USB Audio device using ``lib_xua``, without I2S functionality,
requires the follow I/O pins:
- Audio Master clock (from clock source to xCORE)
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
: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. In this example ``XUA_Buffer()`` and ``XUA_AudioHub()``
reside on the same tile and can therefore make use of the same master-clock port.
These ports are declared as follows:
.. literalinclude:: app_xua_simple.xc
:start-on: /* Resources for USB feedback
:end-on: in port p_for
In addition to ``port`` resources a single clock-block resource is also required:
.. literalinclude:: app_xua_simple.xc
:start-on: /* Clock-block declarations
:end-on: clock clk_audio_mclk
Again, for the same reasoning as the master-clock ports, only one master-clock clock-blocks is required.
Allocating hardware resources for lib_mic_array
...............................................
``lib_mic_array`` requires a single 8-bit port for PDM data from up to 8 microphones. This port must be declared
as 32-bit buffered:
.. literalinclude:: app_xua_simple.xc
:start-on: in buffered port:32 p_pdm_mics
:end-before: clock clk_pdm
The microphones must be clocked by an audio related clock - typically 3.072MHz.
The xCORE-200 Array Microphone Board expects the xCORE to divide down the audio master clock input (24.576MHz)
and output the result to the microphones.
Two ports for this purpose are declared as follows:
.. literalinclude:: app_xua_simple.xc
:start-on: /* Lib_mic_array declarations
:end-before: in buffered
Please see the ``lib_mic_array`` library documentation for full details.
Other declarations
..................
``lib_xua`` currently requires the manual declaration of tables for the endpoint types for
``lib_xud`` and the calling the main XUD function in a par (``XUD_Main()``).
For a simple application the following endpoints are required:
- ``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
:start-on: /* Endpoint type tables
:end-on: XUD_EpType epTypeTableIn
Configuring lib_xua
-------------------
``lib_xua`` must be configured to enable support for PDM microphones.
``lib_xua`` has many parameters than can be configured at build time, some examples include:
- Supported sample-rates
- Channel counts
- Audio Class version
- Product/Vendor ID's
- Various product strings
- Master clock frequency
To enable PDM microphone support ``XUA_NUM_PDM_MICS`` must be set to a non-zero value. Setting this will cause the ``XUA_AudioHub``
task to forward sample rate information and receive samples from the relevant microphone related tasks.
These parameters are set via defines in an optional ``xua_conf.h`` header file. For this simple application the
complete contents of this file are as follows:
.. literalinclude:: xua_conf.h
:start-on: // Copyright
:end-on: #endif
The application main() function
-------------------------------
The ``main()`` function sets up and runs the tasks in the application.
Channel declarations
....................
Various channels are required in order to allow the required tasks to communicate.
These must first be declared:
.. literalinclude:: app_xua_simple.xc
:start-on: /* Channels for lib_xud
:end-on: chan c_mic_pcm
Standard ``lib_xua`` tasks
..........................
The rest of the ``main()`` function starts all of the tasks in parallel
using the xC ``par`` construct.
Firstly the standard ``lib_xua`` tasks are run on tile 1:
.. literalinclude:: app_xua_simple.xc
:start-on: par
:end-before: on tile[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 (``XUA_AudioHub``).
Note, since there is no I2S functionality in this example the ``XUA_AudioHub`` task essentially just receives
samples from the PDM buffer task and forwards samples to the ``XUA_Buffer`` task for forwarding to the USB host.
Microphone related tasks
........................
Microphone related tasks are executed on tile 0 as follows:
.. literalinclude:: app_xua_simple.xc
:start-on: Microphone related tasks
:end-before: return 0
Two functions from ``lib_mic_array`` are used - a PDM receiver task (``mic_array_pdm_rx()``) and a decimation task (``mic_array_decimate_to_pcm_4ch()``).
Each call to ``mic_array_decimate_to_pcm_4ch()`` can handle the decimation of up to 4 microphone signals. Since the xCORE-200 Array microphone
board is equipped with seven microphones two instances of this task are run.
The ``mic_array_pdm_rx()`` task expects the PDM microphone port to be clocked from the PDM clock.
|appendix|
|newpage|
Demo Hardware Setup
-------------------
To run the demo, connect a USB cable to power the xCORE-200 MC Audio board
and plug the xTAG to the board and connect the xTAG USB cable to your
development machine.
.. figure:: images/hw_setup.*
:width: 80%
Hardware setup
|newpage|
Launching the demo application
------------------------------
Once the demo example has been built either from the command line using xmake or
via the build mechanism of xTIMEcomposer studio it can be executed on the xCORE-200
MC Audio board.
Once built there will be a ``bin/`` directory within the project which contains
the binary for the xCORE device. The xCORE binary has a XMOS standard .xe extension.
Launching from the command line
...............................
From the command line you use the ``xrun`` tool to download and run the code
on the xCORE device::
xrun --xscope bin/app_xua_simple.xe
Once this command has executed the application will be running on the
xCORE-200 MC Audio Board
Launching from xTIMEcomposer Studio
...................................
From xTIMEcomposer Studio use the run mechanism to download code to xCORE device.
Select the xCORE binary from the ``bin/`` directory, right click and go to Run
Configurations. Double click on xCORE application to create a new run configuration,
enable the xSCOPE I/O mode in the dialog box and then
select Run.
Once this command has executed the application will be running on the
xCORE-200 MC Audio board.
Running the application
.......................
Once running the device will be detected as a USB Audio device - note, Windows operating
systems may require a third party driver for correct operation
|newpage|
References
----------
.. nopoints::
* XMOS Tools User Guide
http://www.xmos.com/published/xtimecomposer-user-guide
* XMOS xCORE Programming Guide
http://www.xmos.com/published/xmos-programming-guide
* XMOS lib_xua Library
http://www.xmos.com/support/libraries/lib_xua
* XMOS lib_xud Library
http://www.xmos.com/support/libraries/lib_xud
|newpage|
Full source code listing
------------------------
Source code for main.xc
.......................
.. literalinclude:: app_xua_simple.xc
:largelisting:
|newpage|

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

View File

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

View File

@@ -0,0 +1,121 @@
// 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
*
* - No DFU
*
*/
#include <xs1.h>
#include <platform.h>
#include "xua.h"
#include "xud_device.h"
/* From lib_mic_array */
#include "mic_array.h"
/* Lib_mic_array declarations. Note, the defines derived from the xn file */
in port p_pdm_clk = PORT_PDM_CLK; /* Port for PDM mic clock */
in port p_pdm_mclk = PORT_PDM_MCLK; /* Master clock for PDM mics */
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 */
/* 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 */
/* Resources for USB feedback */
in port p_for_mclk_count = PORT_MCLK_COUNT; /* Extra port for counting master clock ticks */
/* Clock-block declarations */
clock clk_audio_mclk = on tile[1]: XS1_CLKBLK_1; /* Master clock */
/* 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};
int main()
{
/* Channels for lib_xud */
chan c_ep_out[2];
chan c_ep_in[2];
/* Channel for communicating SOF notifications from XUD to the Buffering cores */
chan c_sof;
/* 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;
/* Array of channels for communication between PDM mic decimator task(s) and the XUA mic buffer task */
streaming chan c_ds_output[2];
/* Channel for communcation between XUA_AudioHub() and the XUA mic buffer task */
chan c_mic_pcm;
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_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]:
{
/* 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);
}
}
/* Microphone related tasks */
on tile[0]:
{
streaming chan c_4x_pdm_mic_0;
streaming chan c_4x_pdm_mic_1;
configure_clock_src_divide(clk_pdm, p_pdm_mclk, 4); /* Master clock to PDM clock divide */
configure_port_clock_output(p_pdm_clk, clk_pdm);
configure_in_port(p_pdm_mics, clk_pdm);
start_clock(clk_pdm);
par
{
/* 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);
XUA_PdmBuffer(c_ds_output, c_mic_pcm);
}
}
}
return 0;
}

View File

@@ -0,0 +1,31 @@
// Copyright 2017-2022 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.
#include <xs1.h>
#include <assert.h>
#include <platform.h>
#include "xua.h"
/* 0: DAC reset */
/* 1: Ethernet Phy reset */
on tile[1] : out port p_gpio = XS1_PORT_4F;
void AudioHwInit()
{
/* DAC in reset */
p_gpio <: 0;
return;
}
/* Configures the external audio hardware for the required sample frequency */
void AudioHwConfig(unsigned samFreq, unsigned mClk, unsigned dsdMode,
unsigned sampRes_DAC, unsigned sampRes_ADC)
{
/* Note, without any config the Cirrus 2100 will output it's 24.576MHz ref clock
to the Aux output - which we will use for mclk */
return;
}
//:

View File

@@ -0,0 +1,168 @@
// 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.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 = 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 = 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 = 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 = 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 = HID_REPORT_SET_HEADER(1, HID_REPORT_ITEM_TYPE_LOCAL, HID_REPORT_ITEM_TAG_USAGE),
.data = { 0x01, 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_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 elements in the HID Report descriptor.
*/
static USB_HID_Report_Element_t* const hidConfigurableElements[] = {
&hidUsageByte0Bit0,
&hidUsageByte0Bit1,
&hidUsageByte0Bit2,
&hidUsageByte0Bit3,
&hidUsageByte0Bit4,
&hidUsageByte0Bit5
};
/*
* 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_Report_Element_t* const hidReports[] = {
&hidReportPageConsumer
};
/*
* List all items in the HID Report descriptor.
*/
static const USB_HID_Short_Item_t* const hidReportDescriptorItems[] = {
&(hidReportPageConsumer.item),
&hidUsageConsumerControl,
&hidCollectionApplication,
&hidLogicalMinimum0,
&hidLogicalMaximum1,
&(hidUsageByte0Bit0.item),
&(hidUsageByte0Bit1.item),
&(hidUsageByte0Bit2.item),
&(hidUsageByte0Bit3.item),
&(hidUsageByte0Bit4.item),
&(hidUsageByte0Bit5.item),
&hidReportSize1,
&hidReportCount6,
&hidInputDataVar,
&hidLogicalMaximum0,
&hidReportCount2,
&hidInputConstArray,
&hidCollectionEnd
};
/*
* 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_COUNT ( 1 )
#endif // __hid_report_descriptor_h__

View File

@@ -0,0 +1,94 @@
<?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"/>
<!-- Mic related ports -->
<Port Location="XS1_PORT_1E" Name="PORT_PDM_CLK"/>
<Port Location="XS1_PORT_8B" Name="PORT_PDM_DATA"/>
<Port Location="XS1_PORT_1F" Name="PORT_PDM_MCLK"/>
<!-- LED ports -->
<Port Location="XS1_PORT_8C" Name="PORT_LED0_TO_7"/>
<Port Location="XS1_PORT_1K" Name="PORT_LED8"/>
<Port Location="XS1_PORT_1L" Name="PORT_LED9"/>
<Port Location="XS1_PORT_8D" Name="PORT_LED10_TO_12"/>
<Port Location="XS1_PORT_1P" Name="PORT_LED_OEN"/>
<!-- Button ports -->
<Port Location="XS1_PORT_4A" Name="PORT_BUT_A_TO_D"/>
</Tile>
<Tile Number="1" Reference="tile[1]">
<Port Location="XS1_PORT_1H" Name="PORT_USB_TX_READYIN"/>
<Port Location="XS1_PORT_1J" Name="PORT_USB_CLK"/>
<Port Location="XS1_PORT_1K" Name="PORT_USB_TX_READYOUT"/>
<Port Location="XS1_PORT_1I" Name="PORT_USB_RX_READY"/>
<Port Location="XS1_PORT_1E" Name="PORT_USB_FLAG0"/>
<Port Location="XS1_PORT_1F" Name="PORT_USB_FLAG1"/>
<Port Location="XS1_PORT_1G" Name="PORT_USB_FLAG2"/>
<Port Location="XS1_PORT_8A" Name="PORT_USB_TXD"/>
<Port Location="XS1_PORT_8B" Name="PORT_USB_RXD"/>
<!-- Audio Ports -->
<Port Location="XS1_PORT_4D" Name="PORT_PLL_REF"/>
<Port Location="XS1_PORT_1O" Name="PORT_MCLK_IN"/>
<Port Location="XS1_PORT_1N" Name="PORT_I2S_LRCLK"/>
<Port Location="XS1_PORT_1M" Name="PORT_I2S_BCLK"/>
<Port Location="XS1_PORT_1P" Name="PORT_I2S_DAC0"/>
<Port Location="XS1_PORT_4E" Name="PORT_I2C"/>
<Port Location="XS1_PORT_16B" Name="PORT_MCLK_COUNT"/>
</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,31 @@
// Copyright 2017-2022 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.
#ifndef _XUA_CONF_H_
#define _XUA_CONF_H_
#define NUM_USB_CHAN_OUT 0
#define NUM_USB_CHAN_IN 8
#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_NUM_PDM_MICS 8
#define VENDOR_STR "XMOS"
#define VENDOR_ID 0x20B1
#define PRODUCT_STR_A2 "XUA PDM Example"
#define PRODUCT_STR_A1 "XUA PDM Example"
#define PID_AUDIO_1 1
#define PID_AUDIO_2 2
#define 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
#endif

View File

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

@@ -1,135 +0,0 @@
Software Release License Agreement
Copyright (c) 2018, XMOS, All rights reserved.
BY ACCESSING, USING, INSTALLING OR DOWNLOADING THE XMOS SOFTWARE, YOU AGREE TO BE BOUND BY THE FOLLOWING TERMS. IF YOU DO NOT AGREE TO THESE, DO NOT ATTEMPT TO DOWNLOAD, ACCESS OR USE THE XMOS Software.
Parties:
(1) XMOS Limited, incorporated and registered in England and Wales with company number 5494985 whose registered office is 107 Cheapside, London, EC2V 6DN (XMOS).
(2) An individual or legal entity exercising permissions granted by this License (Customer).
If you are entering into this Agreement on behalf of another legal entity such as a company, partnership, university, college etc. (for example, as an employee, student or consultant), you warrant that you have authority to bind that entity.
1. Definitions
"License" means this Software License and any schedules or annexes to it.
"License Fee" means the fee for the XMOS Software as detailed in any schedules or annexes to this Software License
"Licensee Modifications" means all developments and modifications of the XMOS Software developed independently by the Customer.
"XMOS Modifications" means all developments and modifications of the XMOS Software developed or co-developed by XMOS.
"XMOS Hardware" means any XMOS hardware devices supplied by XMOS from time to time and/or the particular XMOS devices detailed in any schedules or annexes to this Software License.
"XMOS Software" comprises the XMOS owned circuit designs, schematics, source code, object code, reference designs, (including related programmer comments and documentation, if any), error corrections, improvements, modifications (including XMOS Modifications) and updates.
The headings in this License do not affect its interpretation. Save where the context otherwise requires, references to clauses and schedules are to clauses and schedules of this License.
Unless the context otherwise requires:
- references to XMOS and the Customer include their permitted successors and assigns;
- references to statutory provisions include those statutory provisions as amended or re-enacted; and
- references to any gender include all genders.
Words in the singular include the plural and in the plural include the singular.
2. License
XMOS grants the Customer a non-exclusive license to use, develop, modify and distribute the XMOS Software with, or for the purpose of being used with, XMOS Hardware.
Open Source Software (OSS) must be used and dealt with in accordance with any license terms under which OSS is distributed.
3. Consideration
In consideration of the mutual obligations contained in this License, the parties agree to its terms.
4. Term
Subject to clause 12 below, this License shall be perpetual.
5. Restrictions on Use
The Customer will adhere to all applicable import and export laws and regulations of the country in which it resides and of the United States and United Kingdom, without limitation. The Customer agrees that it is its responsibility to obtain copies of and to familiarise itself fully with these laws and regulations to avoid violation.
6. Modifications
The Customer will own all intellectual property rights in the Licensee Modifications but will undertake to provide XMOS with any fixes made to correct any bugs found in the XMOS Software on a non-exclusive, perpetual and royalty free license basis.
XMOS will own all intellectual property rights in the XMOS Modifications.
The Customer may only use the Licensee Modifications and XMOS Modifications on, or in relation to, XMOS Hardware.
7. Support
Support of the XMOS Software may be provided by XMOS pursuant to a separate support agreement.
8. Warranty and Disclaimer
The XMOS Software is provided "AS IS" without a warranty of any kind. XMOS and its licensors' entire liability and Customer's exclusive remedy under this warranty to be determined in XMOS's sole and absolute discretion, will be either (a) the corrections of defects in media or replacement of the media, or (b) the refund of the license fee paid (if any).
Whilst XMOS gives the Customer the ability to load their own software and applications onto XMOS devices, the security of such software and applications when on the XMOS devices is the Customer's own responsibility and any breach of security shall not be deemed a defect or failure of the hardware. XMOS shall have no liability whatsoever in relation to any costs, damages or other losses Customer may incur as a result of any breaches of security in relation to your software or applications.
XMOS AND ITS LICENSORS DISCLAIM ALL OTHER WARRANTIES, EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY/ SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT EXCEPT TO THE EXTENT THAT THESE DISCLAIMERS ARE HELD TO BE LEGALLY INVALID UNDER APPLICABLE LAW.
9. High Risk Activities
The XMOS Software is not designed or intended for use in conjunction with on-line control equipment in hazardous environments requiring fail-safe performance, including without limitation the operation of nuclear facilities, aircraft navigation or communication systems, air traffic control, life support machines, or weapons systems (collectively "High Risk Activities") in which the failure of the XMOS Software could lead directly to death, personal injury, or severe physical or environmental damage. XMOS and its licensors specifically disclaim any express or implied warranties relating to use of the XMOS Software in connection with High Risk Activities.
10. Liability
TO THE EXTENT NOT PROHIBITED BY APPLICABLE LAW, NEITHER XMOS NOR ITS LICENSORS SHALL BE LIABLE FOR ANY LOST REVENUE, BUSINESS, PROFIT, CONTRACTS OR DATA, ADMINISTRATIVE OR OVERHEAD EXPENSES, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES HOWEVER CAUSED AND REGARDLESS OF THEORY OF LIABILITY ARISING OUT OF THIS LICENSE, EVEN IF XMOS HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. In no event shall XMOS's liability to the Customer whether in contract, tort (including negligence), or otherwise exceed the License Fee.
Customer agrees to indemnify, hold harmless, and defend XMOS and its licensors from and against any claims or lawsuits, including attorneys' fees and any other liabilities, demands, proceedings, damages, losses, costs, expenses fines and charges which are made or brought against or incurred by XMOS as a result of your use or distribution of the Licensee Modifications or your use or distribution of XMOS Software, or any development of it, other than in accordance with the terms of this License.
11. Ownership
The copyrights and all other intellectual and industrial property rights for the protection of information with respect to the XMOS Software (including the methods and techniques on which they are based) are retained by XMOS and/or its licensors. Nothing in this Agreement serves to transfer such rights. Customer may not sell, mortgage, underlet, sublease, sublicense, lend or transfer possession of the XMOS Software in any way whatsoever to any third party who is not bound by this Agreement.
12. Termination
Either party may terminate this License at any time on written notice to the other if the other:
- is in material or persistent breach of any of the terms of this License and either that breach is incapable of remedy, or the other party fails to remedy that breach within 30 days after receiving written notice requiring it to remedy that breach; or
- is unable to pay its debts (within the meaning of section 123 of the Insolvency Act 1986), or becomes insolvent, or is subject to an order or a resolution for its liquidation, administration, winding-up or dissolution (otherwise than for the purposes of a solvent amalgamation or reconstruction), or has an administrative or other receiver, manager, trustee, liquidator, administrator or similar officer appointed over all or any substantial part of its assets, or enters into or proposes any composition or arrangement with its creditors generally, or is subject to any analogous event or proceeding in any applicable jurisdiction.
Termination by either party in accordance with the rights contained in clause 12 shall be without prejudice to any other rights or remedies of that party accrued prior to termination.
On termination for any reason:
- all rights granted to the Customer under this License shall cease;
- the Customer shall cease all activities authorised by this License;
- the Customer shall immediately pay any sums due to XMOS under this License; and
- the Customer shall immediately destroy or return to the XMOS (at the XMOS's option) all copies of the XMOS Software then in its possession, custody or control and, in the case of destruction, certify to XMOS that it has done so.
Clauses 5, 8, 9, 10 and 11 shall survive any effective termination of this Agreement.
13. Third party rights
No term of this License is intended to confer a benefit on, or to be enforceable by, any person who is not a party to this license.
14. Confidentiality and publicity
Each party shall, during the term of this License and thereafter, keep confidential all, and shall not use for its own purposes nor without the prior written consent of the other disclose to any third party any, information of a confidential nature (including, without limitation, trade secrets and information of commercial value) which may become known to such party from the other party and which relates to the other party, unless such information is public knowledge or already known to such party at the time of disclosure, or subsequently becomes public knowledge other than by breach of this license, or subsequently comes lawfully into the possession of such party from a third party.
The terms of this license are confidential and may not be disclosed by the Customer without the prior written consent of XMOS.
The provisions of clause 14 shall remain in full force and effect notwithstanding termination of this license for any reason.
15. Entire agreement
This License and the documents annexed as appendices to this License or otherwise referred to herein contain the whole agreement between the parties relating to the subject matter hereof and supersede all prior agreements, arrangements and understandings between the parties relating to that subject matter.
16. Assignment
The Customer shall not assign this License or any of the rights granted under it without XMOS's prior written consent.
17. Governing law and jurisdiction
This License shall be governed by and construed in accordance with English law and each party hereby submits to the non-exclusive jurisdiction of the English courts.
This License has been entered into on the date stated at the beginning of it.
Schedule
XMOS lib_xua software

View File

@@ -1,2 +0,0 @@
all:
g++ -m32 -Wall -g -o xmosdfu xmosdfu.cpp -Ilibusb/Linux32 -lusb-1.0

View File

@@ -1,2 +0,0 @@
all:
g++ -Wall -g -o xmosdfu xmosdfu.cpp -Ilibusb/Linux32 -lusb-1.0

View File

@@ -1,2 +0,0 @@
all:
g++ -g -o xmosdfu xmosdfu.cpp -Ilibusb/OSX32 libusb/OSX32/libusb-1.0.0.dylib -m32 -Wall

View File

@@ -1,2 +0,0 @@
all:
g++ -g -o xmosdfu xmosdfu.cpp -Ilibusb/OSX64 libusb/OSX64/libusb-1.0.0.dylib -Wall

View File

@@ -1,9 +1,7 @@
# 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
USED_MODULES = lib_xua lib_i2c lib_logging
BUILD_FLAGS = -O0 -g -lflash -DXUD_SERIES_SUPPORT=4 -fxscope -save-temps -march=xs2a -DUSB_TILE=tile[1]
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 \

View File

@@ -1,4 +1,5 @@
// Copyright (c) 2016-2018, XMOS Ltd, All rights reserved
// Copyright 2016-2021 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.
#ifndef __debug_conf_h__
#define __debug_conf_h__

View File

@@ -0,0 +1,167 @@
// 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.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 = 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 = 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 = 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 = 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 = HID_REPORT_SET_HEADER(1, HID_REPORT_ITEM_TYPE_LOCAL, HID_REPORT_ITEM_TAG_USAGE),
.data = { 0x01, 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, 1, 0, 0 ) };
/*
* Define configurable items in the HID Report descriptor.
*/
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.
*/
static USB_HID_Report_Element_t* const hidConfigurableElements[] = {
&hidUsageByte0Bit0,
&hidUsageByte0Bit1,
&hidUsageByte0Bit2,
&hidUsageByte0Bit3,
&hidUsageByte0Bit4,
&hidUsageByte0Bit5
};
/*
* 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_Report_Element_t* const hidReports[] = {
&hidReportPageConsumer
};
/*
* List all items in the HID Report descriptor.
*/
static const USB_HID_Short_Item_t * const hidReportDescriptorItems[] = {
&(hidReportPageConsumer.item),
&hidUsageConsumerControl,
&hidCollectionApplication,
&hidLogicalMinimum0,
&hidLogicalMaximum1,
&(hidUsageByte0Bit0.item),
&(hidUsageByte0Bit1.item),
&(hidUsageByte0Bit2.item),
&(hidUsageByte0Bit3.item),
&(hidUsageByte0Bit4.item),
&(hidUsageByte0Bit5.item),
&hidReportSize1,
&hidReportCount6,
&hidInputDataVar,
&hidLogicalMaximum0,
&hidReportCount2,
&hidInputConstArray,
&hidCollectionEnd
};
/*
* 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_COUNT ( 1 )
#endif // __hid_report_descriptor_h__

View File

@@ -1,4 +1,5 @@
// Copyright (c) 2016-2018, XMOS Ltd, All rights reserved
// Copyright 2016-2022 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.
#include <platform.h>
#include <stdlib.h>
#include <print.h>
@@ -77,20 +78,12 @@ 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 */
#endif
/* Note, declared unsafe as sometimes we want to share this port
e.g. PDM mics and I2S use same master clock IO */
port p_mclk_in_ = PORT_MCLK_IN;
in port p_mclk_in = PORT_MCLK_IN;
/* Clock-block declarations */
clock clk_audio_bclk = on tile[AUDIO_IO_TILE]: XS1_CLKBLK_1; /* Bit clock */
clock clk_audio_bclk = on tile[AUDIO_IO_TILE]: XS1_CLKBLK_1; /* Bit clock */
clock clk_audio_mclk = on tile[AUDIO_IO_TILE]: XS1_CLKBLK_2; /* Master clock */
unsafe
{
/* TODO simplify this */
unsafe port p_mclk_in; /* Audio master clock input */
}
#ifdef SIMULATION
#define INITIAL_SKIP_FRAMES 10
#define TOTAL_TEST_FRAMES 100
@@ -196,14 +189,14 @@ void checker(chanend c_checker, int disable)
#ifdef SIMULATION
out port p_mclk_gen = on tile[AUDIO_IO_TILE] : XS1_PORT_1A;
out port p_mclk_gen = on tile[AUDIO_IO_TILE] : XS1_PORT_1A;
clock clk_audio_mclk_gen = on tile[AUDIO_IO_TILE] : XS1_CLKBLK_3;
void master_mode_clk_setup(void);
#if CODEC_MASTER
out port p_bclk_gen = on tile[AUDIO_IO_TILE] : XS1_PORT_1B;
out port p_bclk_gen = on tile[AUDIO_IO_TILE] : XS1_PORT_1B;
clock clk_audio_bclk_gen = on tile[AUDIO_IO_TILE] : XS1_CLKBLK_4;
out port p_lrclk_gen = on tile[AUDIO_IO_TILE] : XS1_PORT_1C;
out port p_lrclk_gen = on tile[AUDIO_IO_TILE] : XS1_PORT_1C;
clock clk_audio_lrclk_gen = on tile[AUDIO_IO_TILE] : XS1_CLKBLK_5;
void slave_mode_clk_setup(const unsigned samFreq, const unsigned chans_per_frame);
#endif
@@ -211,38 +204,35 @@ void slave_mode_clk_setup(const unsigned samFreq, const unsigned chans_per_frame
#endif
#if I2S_MODE_TDM
const int i2s_tdm_mode = 1;
const int i2s_tdm_mode = 8;
#else
const int i2s_tdm_mode = 0;
const int i2s_tdm_mode = 2;
#endif
int main(void)
{
chan c_checker;
chan c_out;
chan c_checker;
chan c_out;
par {
on tile[AUDIO_IO_TILE]:
par
{
unsafe
{
p_mclk_in = p_mclk_in_;
}
par
{
XUA_AudioHub(c_out);
generator(c_checker, c_out);
checker(c_checker, 0);
on tile[AUDIO_IO_TILE]:
{
par
{
XUA_AudioHub(c_out, clk_audio_mclk, clk_audio_bclk, p_mclk_in, p_lrclk, p_bclk, p_i2s_dac, p_i2s_adc);
generator(c_checker, c_out);
checker(c_checker, 0);
#ifdef SIMULATION
#if CODEC_MASTER
slave_mode_clk_setup(DEFAULT_FREQ, (i2s_tdm_mode != 0) ? 8 : 2);
slave_mode_clk_setup(DEFAULT_FREQ, i2s_tdm_mode);
#else
master_mode_clk_setup();
master_mode_clk_setup();
#endif
#endif
}
}
}
}
}
return 0;
return 0;
}

View File

@@ -1,4 +1,5 @@
// Copyright (c) 2016-2018, XMOS Ltd, All rights reserved
// Copyright 2016-2022 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.
#ifdef SIMULATION
#include <platform.h>
@@ -21,7 +22,7 @@ void AudioHwInit()
extern clock clk_audio_mclk_gen;
extern out port p_mclk_gen;
extern out port p_mclk_gen;
void master_mode_clk_setup(void)
{
configure_clock_rate(clk_audio_mclk_gen, 25, 1); // Slighly faster than typical MCLK of 24.576MHz
@@ -34,17 +35,17 @@ void master_mode_clk_setup(void)
#if CODEC_MASTER
extern out port p_bclk_gen;
extern out port p_bclk_gen;
extern clock clk_audio_bclk_gen;
extern out port p_lrclk_gen;
extern out port p_lrclk_gen;
extern clock clk_audio_lrclk_gen;
void slave_mode_clk_setup(const unsigned samFreq, const unsigned chans_per_frame){
const unsigned data_bits = 32;
const unsigned mclk_freq = 24576000;
const unsigned mclk_bclk_ratio = mclk_freq / (chans_per_frame * samFreq * data_bits);
const unsigned bclk_lrclk_ratio = (chans_per_frame * data_bits); // 48.828Hz LRCLK
const unsigned mclk_bclk_ratio = mclk_freq / (chans_per_frame * samFreq * data_bits);
const unsigned bclk_lrclk_ratio = (chans_per_frame * data_bits); // 48.828Hz LRCLK
//bclk
configure_clock_src_divide(clk_audio_bclk_gen, p_mclk_gen, mclk_bclk_ratio/2);

View File

@@ -1,4 +1,5 @@
// Copyright (c) 2016-2018, XMOS Ltd, All rights reserved
// Copyright 2016-2021 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.
#ifndef __usb_device_h__
#define __usb_device_h__

View File

@@ -1,4 +1,5 @@
// Copyright (c) 2018, XMOS Ltd, All rights reserved
// Copyright 2018-2021 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.
#if 0
#include <xs1.h>
#include <xccompat.h>

View File

@@ -1,4 +1,5 @@
// Copyright (c) 2016-2018, XMOS Ltd, All rights reserved
// Copyright 2016-2022 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.
#ifdef HARDWARE
#include <xs1.h>
@@ -7,7 +8,7 @@
#include "devicedefines.h"
#include <platform.h>
#include "gpio_access.h"
#include "i2c_shared.h"
#include "i2c.h"
#include "cs4384.h"
#include "cs5368.h"
#include "cs2100.h"
@@ -24,16 +25,10 @@
on tile[0] : out port p_gpio = XS1_PORT_8C;
#ifndef IAP
/* If IAP not enabled, i2c ports not declared - still needs for DAC config */
on tile [0] : struct r_i2c r_i2c = {XS1_PORT_4A};
#else
extern struct r_i2c r_i2c;
#endif
port p_i2c = on tile[0]:PORT_I2C;
#define DAC_REGWRITE(reg, val) {data[0] = val; i2c_shared_master_write_reg(r_i2c, CS4384_I2C_ADDR, reg, data, 1);}
#define DAC_REGREAD(reg, val) {i2c_shared_master_read_reg(r_i2c, CS4384_I2C_ADDR, reg, val, 1);}
#define ADC_REGWRITE(reg, val) {data[0] = val; i2c_shared_master_write_reg(r_i2c, CS5368_I2C_ADDR, reg, data, 1);}
#define DAC_REGWRITE(reg, val) {result = i2c.write_reg(CS4384_I2C_ADDR, reg, val);}
#define ADC_REGWRITE(reg, val) {result = i2c.write_reg(CS5368_I2C_ADDR, reg, val);}
#ifdef USE_FRACTIONAL_N
@@ -44,14 +39,15 @@ extern struct r_i2c r_i2c;
#define PLL_SYNC_FREQ 300
#endif
#define CS2100_REGREAD(reg, data) {data[0] = 0xAA; i2c_master_read_reg(CS2100_I2C_DEVICE_ADDR, reg, data, 1, r_i2c);}
#define CS2100_REGREAD_ASSERT(reg, data, expected) {data[0] = 0xAA; i2c_master_read_reg(CS2100_I2C_DEVICE_ADDR, reg, data, 1, r_i2c); assert(data[0] == expected);}
#define CS2100_REGWRITE(reg, val) {data[0] = val; i2c_master_write_reg(CS2100_I2C_DEVICE_ADDR, reg, data, 1, r_i2c);}
#define CS2100_REGREAD(reg, data) {data[0] = i2c.read_reg(CS2100_I2C_DEVICE_ADDR, reg, result);}
#define CS2100_REGREAD_ASSERT(reg, data, expected) {data[0] = i2c.read_reg(CS2100_I2C_DEVICE_ADDR, reg, result); assert(data[0] == expected);}
#define CS2100_REGWRITE(reg, val) {result = i2c.write_reg(CS2100_I2C_DEVICE_ADDR, reg, val);}
/* Init of CS2100 */
void PllInit(void)
void PllInit(client interface i2c_master_if i2c)
{
unsigned char data[1] = {0};
i2c_regop_res_t result;
#if XCORE_200_MC_AUDIO_HW_VERSION < 2
/* Enable init */
@@ -72,12 +68,15 @@ void PllInit(void)
CS2100_REGREAD_ASSERT(CS2100_GLOBAL_CONFIG, data, 0x01);
CS2100_REGREAD_ASSERT(CS2100_FUNC_CONFIG_1, data, 0x08);
CS2100_REGREAD_ASSERT(CS2100_FUNC_CONFIG_2, data, 0x00);
i2c.shutdown();
}
/* Setup PLL multiplier */
void PllMult(unsigned output, unsigned ref)
void PllMult(unsigned output, unsigned ref, client interface i2c_master_if i2c)
{
unsigned char data[1] = {0};
i2c_regop_res_t result;
/* PLL expects 12:20 format, convert output and ref to 12:20 */
/* Shift up the dividend by 12 to retain format... */
@@ -119,9 +118,6 @@ void AudioHwInit(chanend ?c_codec)
start_clock(clk_pll_sync);
#endif
/* Init the i2c module */
i2c_shared_master_init(r_i2c);
/* Assert reset to ADC and DAC */
set_gpio(P_GPIO_DAC_RST_N, 0);
set_gpio(P_GPIO_ADC_RST_N, 0);
@@ -142,7 +138,12 @@ void AudioHwInit(chanend ?c_codec)
set_gpio(P_GPIO_PLL_SEL, 1);
/* Initialise external PLL */
PllInit();
i2c_master_if i2c[1];
par
{
i2c_master_single_port(i2c, 1, p_i2c, 10, 0, 1, 0);
PllInit(i2c[0]);
}
#endif
#ifdef IAP
@@ -154,10 +155,11 @@ void AudioHwInit(chanend ?c_codec)
/* Configures the external audio hardware for the required sample frequency.
* See gpio.h for I2C helper functions and gpio access
*/
void AudioHwConfig(unsigned samFreq, unsigned mClk, chanend ?c_codec, unsigned dsdMode,
unsigned sampRes_DAC, unsigned sampRes_ADC)
void AudioHwConfig2(unsigned samFreq, unsigned mClk, chanend ?c_codec, unsigned dsdMode,
unsigned sampRes_DAC, unsigned sampRes_ADC, client interface i2c_master_if i2c)
{
unsigned char data[1] = {0};
unsigned char data[1] = {0};
i2c_regop_res_t result;
/* Put ADC and DAC into reset */
set_gpio(P_GPIO_ADC_RST_N, 0);
@@ -166,7 +168,7 @@ void AudioHwConfig(unsigned samFreq, unsigned mClk, chanend ?c_codec, unsigned d
/* Set master clock select appropriately */
#if defined(USE_FRACTIONAL_N)
/* Configure external fractional-n clock multiplier for 300Hz -> mClkFreq */
PllMult(mClk, PLL_SYNC_FREQ);
PllMult(mClk, PLL_SYNC_FREQ, i2c);
#endif
/* Allow some time for mclk to lock and MCLK to stabilise - this is important to avoid glitches at start of stream */
{
@@ -364,8 +366,20 @@ void AudioHwConfig(unsigned samFreq, unsigned mClk, chanend ?c_codec, unsigned d
DAC_REGWRITE(CS4384_MODE_CTRL, 0b10000000);
}
#endif
i2c.shutdown();
return;
}
//:
void AudioHwConfig(unsigned samFreq, unsigned mClk, chanend ?c_codec, 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, c_codec, dsdMode, sampRes_DAC, sampRes_ADC, i2c[0]);
}
}
#endif

View File

@@ -1,4 +1,5 @@
// Copyright (c) 2018, XMOS Ltd, All rights reserved
// Copyright 2018-2021 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.
#define CS2100_I2C_DEVICE_ADDR (0x9c>>1)
#define CS2100_DEVICE_CONTROL 0x02

View File

@@ -1,4 +1,5 @@
// Copyright (c) 2017-2018, XMOS Ltd, All rights reserved
// 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_

View File

@@ -1,4 +1,5 @@
// Copyright (c) 2017-2018, XMOS Ltd, All rights reserved
// 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_

View File

@@ -1,4 +1,5 @@
// Copyright (c) 2016-2018, XMOS Ltd, All rights reserved
// Copyright 2016-2021 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.
#ifdef HARDWARE
#include <xs1.h>
#include "gpio_access.h"

View File

@@ -1,4 +1,5 @@
// Copyright (c) 2016-2018, XMOS Ltd, All rights reserved
// Copyright 2016-2021 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.
#ifndef __gpio_access_h__
#define __gpio_access_h__

View File

@@ -83,10 +83,12 @@
</Link>
</Links>
<ExternalDevices>
<Device NodeId="0" Tile="0" Class="SQIFlash" Name="bootFlash" Type="S25FL116K">
<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"/>
<Attribute Name="QE_REGISTER" Value="flash_qe_location_status_reg_0"/>
<Attribute Name="QE_BIT" Value="flash_qe_bit_6"/>
</Device>
</ExternalDevices>
<JTAGChain>

View File

@@ -1,9 +1,10 @@
// Copyright (c) 2016-2018, XMOS Ltd, All rights reserved
// Copyright 2016-2021 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.
#ifndef __custom_defines_h__
#define __custom_defines_h__
#define EXCLUDE_USB_AUDIO_MAIN
#define NUM_PDM_MICS 0
#define XUA_NUM_PDM_MICS 0
#define XUD_TILE 1
#define AUDIO_IO_TILE 0
#define MIXER 0
@@ -22,5 +23,7 @@
#define AUDIO_CLASS_FALLBACK 0
#define BCD_DEVICE 0x1234
#define XUA_DFU_EN 0
#define MIC_DUAL_ENABLED 1 //Use single thread, dual PDM mic
#define XUA_MIC_FRAME_SIZE 240
#endif // __custom_defines_h__

View File

@@ -1,4 +1,6 @@
#!/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

View File

@@ -1,11 +1,13 @@
#!/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 = 'i2s_loopback/bin/{env}_{format}_{i2s_role}_{num_chans_in}in_{num_chans_out}out_{sample_rate}/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)
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',

5
lib_xua/.gitignore vendored Normal file
View File

@@ -0,0 +1,5 @@
.cproject
.makefile
.project
.settings
.xproject

8
lib_xua/.makefile Normal file
View File

@@ -0,0 +1,8 @@
all:
@echo "** Module only - only builds as part of application **"
clean:
@echo "** Module only - only builds as part of application **"

84
lib_xua/LICENSE.rst Normal file
View File

@@ -0,0 +1,84 @@
*******************************
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,135 +0,0 @@
Software Release License Agreement
Copyright (c) 2017-2018, XMOS, All rights reserved.
BY ACCESSING, USING, INSTALLING OR DOWNLOADING THE XMOS SOFTWARE, YOU AGREE TO BE BOUND BY THE FOLLOWING TERMS. IF YOU DO NOT AGREE TO THESE, DO NOT ATTEMPT TO DOWNLOAD, ACCESS OR USE THE XMOS Software.
Parties:
(1) XMOS Limited, incorporated and registered in England and Wales with company number 5494985 whose registered office is 107 Cheapside, London, EC2V 6DN (XMOS).
(2) An individual or legal entity exercising permissions granted by this License (Customer).
If you are entering into this Agreement on behalf of another legal entity such as a company, partnership, university, college etc. (for example, as an employee, student or consultant), you warrant that you have authority to bind that entity.
1. Definitions
"License" means this Software License and any schedules or annexes to it.
"License Fee" means the fee for the XMOS Software as detailed in any schedules or annexes to this Software License
"Licensee Modifications" means all developments and modifications of the XMOS Software developed independently by the Customer.
"XMOS Modifications" means all developments and modifications of the XMOS Software developed or co-developed by XMOS.
"XMOS Hardware" means any XMOS hardware devices supplied by XMOS from time to time and/or the particular XMOS devices detailed in any schedules or annexes to this Software License.
"XMOS Software" comprises the XMOS owned circuit designs, schematics, source code, object code, reference designs, (including related programmer comments and documentation, if any), error corrections, improvements, modifications (including XMOS Modifications) and updates.
The headings in this License do not affect its interpretation. Save where the context otherwise requires, references to clauses and schedules are to clauses and schedules of this License.
Unless the context otherwise requires:
- references to XMOS and the Customer include their permitted successors and assigns;
- references to statutory provisions include those statutory provisions as amended or re-enacted; and
- references to any gender include all genders.
Words in the singular include the plural and in the plural include the singular.
2. License
XMOS grants the Customer a non-exclusive license to use, develop, modify and distribute the XMOS Software with, or for the purpose of being used with, XMOS Hardware.
Open Source Software (OSS) must be used and dealt with in accordance with any license terms under which OSS is distributed.
3. Consideration
In consideration of the mutual obligations contained in this License, the parties agree to its terms.
4. Term
Subject to clause 12 below, this License shall be perpetual.
5. Restrictions on Use
The Customer will adhere to all applicable import and export laws and regulations of the country in which it resides and of the United States and United Kingdom, without limitation. The Customer agrees that it is its responsibility to obtain copies of and to familiarise itself fully with these laws and regulations to avoid violation.
6. Modifications
The Customer will own all intellectual property rights in the Licensee Modifications but will undertake to provide XMOS with any fixes made to correct any bugs found in the XMOS Software on a non-exclusive, perpetual and royalty free license basis.
XMOS will own all intellectual property rights in the XMOS Modifications.
The Customer may only use the Licensee Modifications and XMOS Modifications on, or in relation to, XMOS Hardware.
7. Support
Support of the XMOS Software may be provided by XMOS pursuant to a separate support agreement.
8. Warranty and Disclaimer
The XMOS Software is provided "AS IS" without a warranty of any kind. XMOS and its licensors' entire liability and Customer's exclusive remedy under this warranty to be determined in XMOS's sole and absolute discretion, will be either (a) the corrections of defects in media or replacement of the media, or (b) the refund of the license fee paid (if any).
Whilst XMOS gives the Customer the ability to load their own software and applications onto XMOS devices, the security of such software and applications when on the XMOS devices is the Customer's own responsibility and any breach of security shall not be deemed a defect or failure of the hardware. XMOS shall have no liability whatsoever in relation to any costs, damages or other losses Customer may incur as a result of any breaches of security in relation to your software or applications.
XMOS AND ITS LICENSORS DISCLAIM ALL OTHER WARRANTIES, EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY/ SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT EXCEPT TO THE EXTENT THAT THESE DISCLAIMERS ARE HELD TO BE LEGALLY INVALID UNDER APPLICABLE LAW.
9. High Risk Activities
The XMOS Software is not designed or intended for use in conjunction with on-line control equipment in hazardous environments requiring fail-safe performance, including without limitation the operation of nuclear facilities, aircraft navigation or communication systems, air traffic control, life support machines, or weapons systems (collectively "High Risk Activities") in which the failure of the XMOS Software could lead directly to death, personal injury, or severe physical or environmental damage. XMOS and its licensors specifically disclaim any express or implied warranties relating to use of the XMOS Software in connection with High Risk Activities.
10. Liability
TO THE EXTENT NOT PROHIBITED BY APPLICABLE LAW, NEITHER XMOS NOR ITS LICENSORS SHALL BE LIABLE FOR ANY LOST REVENUE, BUSINESS, PROFIT, CONTRACTS OR DATA, ADMINISTRATIVE OR OVERHEAD EXPENSES, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES HOWEVER CAUSED AND REGARDLESS OF THEORY OF LIABILITY ARISING OUT OF THIS LICENSE, EVEN IF XMOS HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. In no event shall XMOS's liability to the Customer whether in contract, tort (including negligence), or otherwise exceed the License Fee.
Customer agrees to indemnify, hold harmless, and defend XMOS and its licensors from and against any claims or lawsuits, including attorneys' fees and any other liabilities, demands, proceedings, damages, losses, costs, expenses fines and charges which are made or brought against or incurred by XMOS as a result of your use or distribution of the Licensee Modifications or your use or distribution of XMOS Software, or any development of it, other than in accordance with the terms of this License.
11. Ownership
The copyrights and all other intellectual and industrial property rights for the protection of information with respect to the XMOS Software (including the methods and techniques on which they are based) are retained by XMOS and/or its licensors. Nothing in this Agreement serves to transfer such rights. Customer may not sell, mortgage, underlet, sublease, sublicense, lend or transfer possession of the XMOS Software in any way whatsoever to any third party who is not bound by this Agreement.
12. Termination
Either party may terminate this License at any time on written notice to the other if the other:
- is in material or persistent breach of any of the terms of this License and either that breach is incapable of remedy, or the other party fails to remedy that breach within 30 days after receiving written notice requiring it to remedy that breach; or
- is unable to pay its debts (within the meaning of section 123 of the Insolvency Act 1986), or becomes insolvent, or is subject to an order or a resolution for its liquidation, administration, winding-up or dissolution (otherwise than for the purposes of a solvent amalgamation or reconstruction), or has an administrative or other receiver, manager, trustee, liquidator, administrator or similar officer appointed over all or any substantial part of its assets, or enters into or proposes any composition or arrangement with its creditors generally, or is subject to any analogous event or proceeding in any applicable jurisdiction.
Termination by either party in accordance with the rights contained in clause 12 shall be without prejudice to any other rights or remedies of that party accrued prior to termination.
On termination for any reason:
- all rights granted to the Customer under this License shall cease;
- the Customer shall cease all activities authorised by this License;
- the Customer shall immediately pay any sums due to XMOS under this License; and
- the Customer shall immediately destroy or return to the XMOS (at the XMOS's option) all copies of the XMOS Software then in its possession, custody or control and, in the case of destruction, certify to XMOS that it has done so.
Clauses 5, 8, 9, 10 and 11 shall survive any effective termination of this Agreement.
13. Third party rights
No term of this License is intended to confer a benefit on, or to be enforceable by, any person who is not a party to this license.
14. Confidentiality and publicity
Each party shall, during the term of this License and thereafter, keep confidential all, and shall not use for its own purposes nor without the prior written consent of the other disclose to any third party any, information of a confidential nature (including, without limitation, trade secrets and information of commercial value) which may become known to such party from the other party and which relates to the other party, unless such information is public knowledge or already known to such party at the time of disclosure, or subsequently becomes public knowledge other than by breach of this license, or subsequently comes lawfully into the possession of such party from a third party.
The terms of this license are confidential and may not be disclosed by the Customer without the prior written consent of XMOS.
The provisions of clause 14 shall remain in full force and effect notwithstanding termination of this license for any reason.
15. Entire agreement
This License and the documents annexed as appendices to this License or otherwise referred to herein contain the whole agreement between the parties relating to the subject matter hereof and supersede all prior agreements, arrangements and understandings between the parties relating to that subject matter.
16. Assignment
The Customer shall not assign this License or any of the rights granted under it without XMOS's prior written consent.
17. Governing law and jurisdiction
This License shall be governed by and construed in accordance with English law and each party hereby submits to the non-exclusive jurisdiction of the English courts.
This License has been entered into on the date stated at the beginning of it.
Schedule
XMOS lib_xua software

View File

@@ -1,4 +1,5 @@
// Copyright (c) 2017-2018, XMOS Ltd, All rights reserved
// Copyright 2017-2021 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.
#ifndef __XUA_H__
#define __XUA_H__
@@ -6,13 +7,17 @@
#include "xua_conf_full.h"
#if __XC__ || __STDC__
#include "xua_audiohub.h"
#include "xua_audiohub.h"
#include "xua_endpoint0.h"
#include "xua_endpoint0.h"
#include "xua_buffer.h"
#include "xua_buffer.h"
#endif
//#include "xua_dfu.h"
#if __XC__
#if XUA_NUM_PDM_MICS > 0
#include "xua_pdm_mic.h"
#endif
#endif
#endif

View File

@@ -1,12 +1,14 @@
// Copyright (c) 2011-2018, XMOS Ltd, All rights reserved
// Copyright 2011-2022 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.
#ifndef __XUA_AUDIOHUB_H__
#define __XUA_AUDIOHUB_H__
#if __XC__
#include "xccompat.h"
#include "xs1.h"
#ifndef NO_USB
#if XUA_USB_EN
#include "dfu_interface.h"
#endif
@@ -15,24 +17,44 @@
* This function drives I2S ports and handles samples to/from other digital
* I/O threads.
*
* \param c_aud Audio sample channel connected to the mixer() thread or the
* decouple() thread
* \param c_dig channel connected to the clockGen() thread for
* receiving/transmitting samples
* \param c_config An optional channel that will be passed on to the
* CODEC configuration functions.
* \param c_aud Audio sample channel connected to the mixer() thread or the
* decouple() thread
*
* \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 p_mclk_in Master clock inport port (must be 1-bit)
*
* \param p_lrclk Nullable port for I2S sample clock
*
* \param p_bclk Nullable port for I2S bit
*
* \param p_i2s_dac Nullable array of ports for I2S data output lines
*
* \param p_i2s_adc Nullable array of ports for I2S data input lines
*
* \param c_dig channel connected to the clockGen() thread for
* receiving/transmitting samples
*/
void XUA_AudioHub(chanend ?c_aud
#if (XUA_SPDIF_TX_EN) && (SPDIF_TX_TILE != AUDIO_IO_TILE)
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 in port:32 (&?p_i2s_adc)[I2S_WIRES_ADC]
#if (XUA_SPDIF_TX_EN) //&& (SPDIF_TX_TILE != AUDIO_IO_TILE)
, chanend c_spdif_tx
#endif
#if(defined(SPDIF_RX) || defined(ADAT_RX))
#if((SPDIF_RX) || (ADAT_RX))
, chanend c_dig
#endif
#if (XUD_TILE != 0) && (AUDIO_IO_TILE == 0) && (XUA_DFU_EN == 1)
, server interface i_dfu ?dfuInterface
#endif
#if (NUM_PDM_MICS > 0)
#if (XUA_NUM_PDM_MICS > 0)
, chanend c_pdm_in
#endif
);

View File

@@ -1,4 +1,5 @@
// Copyright (c) 2011-2018, XMOS Ltd, All rights reserved
// Copyright 2011-2021 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.
#ifndef __XUA_BUFFER_H__
#define __XUA_BUFFER_H__
@@ -51,14 +52,14 @@ void XUA_Buffer(
chanend c_iap_ea_native_data,
#endif
#endif
#if defined(SPDIF_RX) || defined(ADAT_RX)
#if (SPDIF_RX) || (ADAT_RX)
chanend ?c_int,
chanend ?c_clk_int,
#endif
chanend c_sof,
chanend c_aud_ctl,
in port p_off_mclk
#ifdef HID_CONTROLS
#if( 0 < HID_CONTROLS )
, chanend c_hid
#endif
, chanend c_aud
@@ -90,14 +91,14 @@ void XUA_Buffer_Ep(chanend c_aud_out,
chanend c_iap_ea_native_data,
#endif
#endif
#if defined(SPDIF_RX) || defined(ADAT_RX)
#if (SPDIF_RX) || (ADAT_RX)
chanend ?c_int,
chanend ?c_clk_int,
#endif
chanend c_sof,
chanend c_aud_ctl,
in port p_off_mclk
#ifdef HID_CONTROLS
#if( 0 < HID_CONTROLS )
, chanend c_hid
#endif
#ifdef CHAN_BUFF_CTRL

View File

@@ -1,4 +1,5 @@
// Copyright (c) 2011-2018, XMOS Ltd, All rights reserved
// Copyright 2011-2022 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
* @author Ross Owen, XMOS Limited
@@ -56,6 +57,13 @@
#define PDM_TILE AUDIO_IO_TILE
#endif
/**
* @brief Disable USB functionalty just leaving AudioHub
*/
#ifndef XUA_USB_EN
#define XUA_USB_EN 1
#endif
/**
* @brief Number of input channels (device to host). Default: NONE (Must be defined by app)
*/
@@ -75,7 +83,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
@@ -235,10 +243,6 @@
#define AUDIO_CLASS_FALLBACK 0 /* Default to not falling back to UAC 1 */
#endif
#if defined(AUDIO_CLASS_FALLBACK) && (AUDIO_CLASS_FALLBACK==0)
#undef AUDIO_CLASS_FALLBACK
#endif
/**
* @brief Whether or not to run UAC2 in full-speed. When disabled device can either operate in
* UAC1 mode in full-speed (if AUDIO_CLASS_FALLBACK enabled) or return "null" descriptors.
@@ -247,7 +251,7 @@
*/
#if (AUDIO_CLASS == 2)
/* Whether to run in Audio Class 2.0 mode in USB Full-speed */
#if !defined(FULL_SPEED_AUDIO_2) && !defined(AUDIO_CLASS_FALLBACK)
#if !defined(FULL_SPEED_AUDIO_2) && (AUDIO_CLASS_FALLBACK == 0)
#define FULL_SPEED_AUDIO_2 1 /* Default to falling back to UAC2 */
#endif
#endif
@@ -257,7 +261,7 @@
#endif
/* Some checks on full-speed functionality */
#if defined(FULL_SPEED_AUDIO_2) && defined(AUDIO_CLASS_FALLBACK)
#if defined(FULL_SPEED_AUDIO_2) && (AUDIO_CLASS_FALLBACK)
#error FULL_SPEED_AUDIO_2 and AUDIO_CLASS_FALLBACK enabled!
#endif
@@ -271,20 +275,27 @@
/**
* @brief Number of PDM microphones in the design. Default: None
*/
#ifndef NUM_PDM_MICS
#define NUM_PDM_MICS (0)
#ifndef XUA_NUM_PDM_MICS
#define XUA_NUM_PDM_MICS (0)
#endif
/**
* @brief PDM Microphone first channel index, defines which channels microphones will be input on.
* Note, indexed from 0.
*
* Default: 0 (i.e. channels [0:NUM_PDM_MICS-1])
* Default: 0 (i.e. channels [0:XUA_NUM_PDM_MICS-1])
* */
#ifndef PDM_MIC_INDEX
#define PDM_MIC_INDEX (0)
#endif
/**
* @brief Size of a frame of microphone data samples. Default: 1
*/
#ifndef XUA_MIC_FRAME_SIZE
#define XUA_MIC_FRAME_SIZE (1)
#endif
/**
* @brief Enable MIDI functionality including buffering, descriptors etc. Default: DISABLED
*/
@@ -347,11 +358,6 @@
#define SPDIF_RX (0)
#endif
/* Tidy up old SPDIF_RX usage */
#if defined(SPDIF_RX) && (SPDIF_RX == 0)
#undef SPDIF_RX
#endif
/**
* @brief Enables ADAT Rx. Default: 0 (Disabled)
*/
@@ -359,17 +365,13 @@
#define ADAT_RX (0)
#endif
#if defined(ADAT_RX) && (ADAT_RX == 0)
#undef ADAT_RX
#endif
/**
* @brief S/PDIF Rx first channel index, defines which channels S/PDIF will be input on.
* Note, indexed from 0.
*
* Default: NONE (Must be defined by app when SPDIF_RX enabled)
*/
#if defined (SPDIF_RX) || defined (__DOXYGEN__)
#if (SPDIF_RX) || defined (__DOXYGEN__)
#ifndef SPDIF_RX_INDEX
#error SPDIF_RX_INDEX not defined and SPDIF_RX defined
#define SPDIF_RX_INDEX 0 /* Default define for doxygen */
@@ -382,7 +384,7 @@
*
* Default: NONE (Must be defined by app when ADAT_RX enabled)
*/
#if defined(ADAT_RX) || defined(__DOXYGEN__)
#if (ADAT_RX) || defined(__DOXYGEN__)
#ifndef ADAT_RX_INDEX
#error ADAT_RX_INDEX not defined and ADAT_RX defined
#define ADAT_RX_INDEX (0) /* Default define for doxygen */
@@ -393,7 +395,7 @@
#endif
#endif
#ifdef ADAT_RX
#if ADAT_RX
/* Setup input stream formats for ADAT */
#if(MAX_FREQ > 96000)
@@ -431,10 +433,6 @@
#define HID_CONTROLS (0)
#endif
#if defined(HID_CONTROLS) && (HID_CONTROLS == 0)
#undef HID_CONTROLS
#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.
@@ -445,6 +443,16 @@
#define CODEC_MASTER (0)
#endif
/**
* @brief Serial Number String used by the device
*
* Default: ""
*/
#ifndef SERIAL_STR
#define SERIAL_STR ""
#endif
/**
* @brief Vendor String used by the device. This is also pre-pended to various strings used by the design.
*
@@ -500,7 +508,7 @@
*
* Default: 0x0003
*/
#if (AUDIO_CLASS==1) || defined(AUDIO_CLASS_FALLBACK) || defined(__DOXYGEN__)
#if (AUDIO_CLASS == 1) || (AUDIO_CLASS_FALLBACK) || defined(__DOXYGEN__)
#ifndef PID_AUDIO_1
#define PID_AUDIO_1 (0x0003)
#endif
@@ -519,21 +527,21 @@
* @brief Device firmware version number in Binary Coded Decimal format: 0xJJMN where JJ: major, M: minor, N: sub-minor version number.
*/
#ifndef BCD_DEVICE_J
#define BCD_DEVICE_J (0)
#define BCD_DEVICE_J (1)
#endif
/**
* @brief Device firmware version number in Binary Coded Decimal format: 0xJJMN where JJ: major, M: minor, N: sub-minor version number.
*/
#ifndef BCD_DEVICE_M
#define BCD_DEVICE_M (1)
#define BCD_DEVICE_M (2)
#endif
/**
* @brief Device firmware version number in Binary Coded Decimal format: 0xJJMN where JJ: major, M: minor, N: sub-minor version number.
*/
#ifndef BCD_DEVICE_N
#define BCD_DEVICE_N (1)
#define BCD_DEVICE_N (0)
#endif
/**
@@ -1132,38 +1140,15 @@
#endif
#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
#if (defined(UAC_FORCE_FEEDBACK_EP) && UAC_FORCE_FEEDBACK_EP == 0)
#undef UAC_FORCE_FEEDBACK_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
#ifndef __ASSEMBLER__
/* Endpoint addresses enums */
enum USBEndpointNumber_In
@@ -1173,13 +1158,13 @@ enum USBEndpointNumber_In
ENDPOINT_NUMBER_IN_FEEDBACK,
#endif
ENDPOINT_NUMBER_IN_AUDIO,
#if defined(SPDIF_RX) || defined(ADAT_RX)
#if (SPDIF_RX) || (ADAT_RX)
ENDPOINT_NUMBER_IN_INTERRUPT, /* Audio interrupt/status EP */
#endif
#ifdef MIDI
ENDPOINT_NUMBER_IN_MIDI,
#endif
#ifdef HID_CONTROLS
#if( 0 < HID_CONTROLS )
ENDPOINT_NUMBER_IN_HID,
#endif
#ifdef IAP
@@ -1216,7 +1201,7 @@ enum USBEndpointNumber_Out
#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)
@@ -1232,10 +1217,6 @@ enum USBEndpointNumber_Out
#define MAX_VOL (0x20000000)
#if defined(SU1_ADC_ENABLE) && (SU1_ADC_ENABLE == 0)
#undef SU1_ADC_ENABLE
#endif
#if defined(LEVEL_METER_LEDS) && !defined(LEVEL_UPDATE_RATE)
#define LEVEL_UPDATE_RATE 400000
#endif
@@ -1251,9 +1232,9 @@ enum USBEndpointNumber_Out
#endif
/* Length of clock unit/clock-selector units */
#if defined(SPDIF_RX) && defined(ADAT_RX)
#if (SPDIF_RX) && (ADAT_RX)
#define NUM_CLOCKS (3)
#elif defined(SPDIF_RX) || defined(ADAT_RX)
#elif (SPDIF_RX) || (ADAT_RX)
#define NUM_CLOCKS (2)
#else
#define NUM_CLOCKS (1)
@@ -1444,6 +1425,12 @@ enum USBEndpointNumber_Out
#error Bad DEFAULT_MCLK_FREQ
#endif
/* DFU functional descriptor wDetachTimeOut field (milliseconds)
* Time for device to wait for bus reset after DETACH request before reverting to idle state */
#ifndef DFU_DETACH_TIME_OUT
#define DFU_DETACH_TIME_OUT 250
#endif
#if ((MCLK_441 % MIN_FREQ) == 0)
#define MIN_FREQ_44 MIN_FREQ
#define MIN_FREQ_48 ((48000 * 512)/((44100 * 512)/MIN_FREQ))
@@ -1455,3 +1442,13 @@ enum USBEndpointNumber_Out
#define MIN_FREQ_44 (((44100*512)/((48000 * 512)/MIN_FREQ))*2)
#endif
/* Internal define for port declaration */
#if CODEC_MASTER
#define _XUA_CLK_DIR in
#else
#define _XUA_CLK_DIR out
#endif
#if (CODEC_MASTER == 1) && (DSD_CHANS_DAC != 0)
#error CODEC_MASTER with DSD is currently unsupported
#endif

View File

@@ -1,4 +1,5 @@
// Copyright (c) 2017-2018, XMOS Ltd, All rights reserved
// Copyright 2017-2022 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__

View File

@@ -1,4 +1,5 @@
// Copyright (c) 2011-2018, XMOS Ltd, All rights reserved
// Copyright 2011-2021 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.
#ifndef _XUA_ENDPOINT0_H_
#define _XUA_ENDPOINT0_H_
@@ -14,7 +15,10 @@
* \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.)
* 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
@@ -24,9 +28,109 @@
* \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,
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_);
/** Function to set the Vendor ID value
*
* \param vid vendor ID value to set
*/
void XUA_Endpoint0_setVendorId(unsigned short vid);
/** Function to set the Product ID value
*
* \param pid Product ID value to set
*/
void XUA_Endpoint0_setProductId(unsigned short pid);
/** Function to set the Vendor string
*
* \param vendor_str Vendor string to set
*/
#ifdef __XC__
void XUA_Endpoint0_setVendorStr(char * unsafe vendor_str);
#else
void XUA_Endpoint0_setVendorStr(char * vendor_str);
#endif
/** Function to set the Product string
*
* \param product_str Product string to set
*/
#ifdef __XC__
void XUA_Endpoint0_setProductStr(char * unsafe product_str);
#else
void XUA_Endpoint0_setProductStr(char * product_str);
#endif
/** Function to set the Serial string
*
* \param serial_str Serial string to set
*/
#ifdef __XC__
void XUA_Endpoint0_setSerialStr(char * unsafe serial_str);
#else
void XUA_Endpoint0_setSerialStr(char * serial_str);
#endif
/** Function to set the BCD device
*
* \param bcdDevice BCD device to set
*/
void XUA_Endpoint0_setBcdDevice(unsigned short bcdDevice);
/** Function to get the Vendor string
*
* \return vendor string
*/
#ifdef __XC__
char * unsafe XUA_Endpoint0_getVendorStr();
#else
char * XUA_Endpoint0_getVendorStr();
#endif
/** Function to get the Product string
*
* \return Product string
*/
#ifdef __XC__
char * unsafe XUA_Endpoint0_getProductStr();
#else
char * XUA_Endpoint0_getProductStr();
#endif
/** Function to get the Serial Number string
*
* \return Serial string
*/
#ifdef __XC__
char * unsafe XUA_Endpoint0_getSerialStr();
#else
char * XUA_Endpoint0_getSerialStr();
#endif
/** Function to get the Vendor ID
*
* \return Vendor ID
*/
unsigned short XUA_Endpoint0_getVendorId();
/** Function to get the Product ID
*
* \return Product ID
*/
unsigned short XUA_Endpoint0_getProductId();
/** Function to get the BCD device
*
* \return BCD device
*/
unsigned short XUA_Endpoint0_getBcdDevice();
#endif
#endif

View File

@@ -1,7 +1,16 @@
// Copyright (c) 2015-2018, XMOS Ltd, All rights reserved
// Copyright 2015-2021 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.
#ifndef XUA_PDM_MIC_H
#define XUA_PDM_MIC_H
/* Included from lib_mic_array */
#include "mic_array.h"
/* Configures PDM ports/clocks */
void xua_pdm_mic_config(in port p_pdm_mclk, in port p_pdm_clk, buffered in port:32 p_pdm_mics, clock clk_pdm);
#ifdef MIC_PROCESSING_USE_INTERFACE
/* Interface based user processing */
typedef interface mic_process_if
@@ -12,7 +21,7 @@ typedef interface mic_process_if
[[combinable]]
void pdm_buffer(streaming chanend c_ds_output[2], chanend c_audio
void XUA_PdmBuffer(streaming chanend c_ds_output[2], chanend c_audio
#ifdef MIC_PROCESSING_USE_INTERFACE
, client mic_process_if i_mic_process
#endif
@@ -22,7 +31,7 @@ void pdm_buffer(streaming chanend c_ds_output[2], chanend c_audio
void user_pdm_process(server mic_process_if i_mic_data);
/* PDM interface and decimation cores */
void pdm_mic(streaming chanend c_ds_output[2]);
void xua_pdm_mic(streaming chanend c_ds_output[2], buffered in port:32 p_pdm_mics);
#else
@@ -33,10 +42,11 @@ void user_pdm_init();
/* PDM interface and decimation cores */
[[combinable]]
void pdm_buffer(streaming chanend c_ds_output[2], chanend c_audio);
void XUA_PdmBuffer(streaming chanend c_ds_output[2], chanend c_audio);
/* PDM interface and decimation cores */
void pdm_mic(streaming chanend c_ds_output[2]);
void xua_pdm_mic(streaming chanend c_ds_output[2], buffered in port:32 p_pdm_mics);
#endif
#endif

View File

@@ -0,0 +1,19 @@
// Copyright 2017-2021 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.
#ifndef __XUA_API_H__
#define __XUA_API_H__
#include <stdint.h>
void set_usb_to_device_rate(uint32_t rate);
void set_device_to_usb_rate(uint32_t rate);
void set_usb_to_device_bit_res(uint32_t rate);
void set_device_to_usb_bit_res(uint32_t rate);
uint32_t get_usb_to_device_rate();
uint32_t get_device_to_usb_rate();
uint32_t get_usb_to_device_bit_res();
uint32_t get_device_to_usb_bit_res();
#endif //__XUA_API_H__

1
lib_xua/doc/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
pdf

1
lib_xua/doc/rst/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
_build

117
lib_xua/doc/rst/feat.rst Normal file
View File

@@ -0,0 +1,117 @@
Features & Options
------------------
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.

62
lib_xua/doc/rst/hw.rst Normal file
View File

@@ -0,0 +1,62 @@
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.
Please also see application note AN00246.
xCORE-200 Multi-Channel 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 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.
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.
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.
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.
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
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.
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.
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.
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.
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.
A standard XMOS xSYS interface is provided to allow host debug of the board via JTAG.
|newpage|

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

1319
lib_xua/doc/rst/images/spdif.pdf Executable file

File diff suppressed because one or more lines are too long

BIN
lib_xua/doc/rst/images/spdif.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

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