forked from PAWPAW-Mirror/lib_xua
Compare commits
825 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
073bc9552a | ||
|
|
39fda0a178 | ||
|
|
91d16b13a2 | ||
|
|
ad889247a0 | ||
|
|
a7675ba997 | ||
|
|
41c6b90549 | ||
|
|
b62782faa0 | ||
|
|
8c30ce60f2 | ||
|
|
b3d66f4ca4 | ||
|
|
bdb5c56f7c | ||
|
|
a08f5d78fb | ||
|
|
515ec9c022 | ||
|
|
c0104fcf48 | ||
|
|
f88e5877be | ||
|
|
d33397164b | ||
|
|
a087e31b0f | ||
|
|
418622c593 | ||
|
|
6b0688d23e | ||
|
|
37ce235594 | ||
|
|
64cbd072f4 | ||
|
|
9b0e541e95 | ||
|
|
4d68b26b42 | ||
|
|
662b24386d | ||
|
|
c60da7fd82 | ||
|
|
45ab345521 | ||
|
|
692c4ee7ed | ||
|
|
5fa86dabbb | ||
|
|
9863b37ead | ||
|
|
46f516ddbc | ||
|
|
a404138903 | ||
|
|
147b5fb7f7 | ||
|
|
ebb3a0bfcb | ||
|
|
ec87a43dbf | ||
|
|
b0a8735623 | ||
|
|
93721f3144 | ||
|
|
d7b41cd35f | ||
|
|
d3560ca7fe | ||
|
|
ff86ac8d2a | ||
|
|
eebd438620 | ||
|
|
5bb44c54e1 | ||
|
|
36d325a457 | ||
|
|
d40ede1525 | ||
|
|
4f37069efb | ||
|
|
9f667d96f8 | ||
|
|
c352ed1132 | ||
|
|
a18e5a976f | ||
|
|
737c5bd7d0 | ||
|
|
7a0cfca280 | ||
|
|
3988906e39 | ||
|
|
cd0248c162 | ||
|
|
55de7a8abd | ||
|
|
911c8c51f2 | ||
|
|
fa9d483d2f | ||
|
|
1ae9c55477 | ||
|
|
94a05a8ece | ||
|
|
a93987d281 | ||
|
|
4f35551547 | ||
|
|
cb774f3c11 | ||
|
|
66a611f4fd | ||
|
|
b61ea63d40 | ||
|
|
8c132af069 | ||
|
|
93229a7509 | ||
|
|
466cc0abbb | ||
|
|
d5d5bd0637 | ||
|
|
ee6c22bd37 | ||
|
|
703a277059 | ||
|
|
b88342ab2b | ||
|
|
e7f9428731 | ||
|
|
6400e146d0 | ||
|
|
da114a1dea | ||
|
|
77398218b5 | ||
|
|
244a7718a1 | ||
|
|
e71ffdba00 | ||
|
|
625123e4a6 | ||
|
|
548992ab5c | ||
|
|
ccc1ee4021 | ||
|
|
ab96a726d6 | ||
|
|
d3d9b5ba23 | ||
|
|
c3e95a379f | ||
|
|
5be97ac227 | ||
|
|
8799f5f36e | ||
|
|
71dd8b5409 | ||
|
|
e41aed6ffb | ||
|
|
548ccebb27 | ||
|
|
3895b486ab | ||
|
|
ebeae1fa17 | ||
|
|
f328deb336 | ||
|
|
353d7c3c8d | ||
|
|
5f971af054 | ||
|
|
2b5dab51b5 | ||
|
|
19be25809b | ||
|
|
26cac1abb1 | ||
|
|
03a5024520 | ||
|
|
08ed5ee668 | ||
|
|
2b96ea0171 | ||
|
|
1b186a0c2f | ||
|
|
ed7a33b40f | ||
|
|
459ce6bd63 | ||
|
|
3819f30ad0 | ||
|
|
79e256f829 | ||
|
|
be90779db5 | ||
|
|
de382e5cc0 | ||
|
|
6dfc934d36 | ||
|
|
7dfd78deb4 | ||
|
|
fac0542920 | ||
|
|
8c9e8b11b9 | ||
|
|
21b259bc88 | ||
|
|
589c16d56c | ||
|
|
b4d5cb93f1 | ||
|
|
1d22975fd2 | ||
|
|
5354d94987 | ||
|
|
171ef30f42 | ||
|
|
8c175187c8 | ||
|
|
53f80dfba4 | ||
|
|
21c1e661ae | ||
|
|
d515458b83 | ||
|
|
b853589120 | ||
|
|
966d8db9a9 | ||
|
|
dc22b0593f | ||
|
|
0892ff9a8b | ||
|
|
65b1b41ec4 | ||
|
|
3b6f1c80e2 | ||
|
|
bf9e150310 | ||
|
|
1857ddbc67 | ||
|
|
145c0cb80f | ||
|
|
1fe4fc6771 | ||
|
|
88a3d6b20d | ||
|
|
33ec43134c | ||
|
|
2bbebc0a39 | ||
|
|
32af5b7b20 | ||
|
|
fc6915be6f | ||
|
|
d9dc7cc7c7 | ||
|
|
898a6c2410 | ||
|
|
da758f48fa | ||
|
|
2923f7574b | ||
|
|
436a268781 | ||
|
|
8233ef1d47 | ||
|
|
1109e08dd8 | ||
|
|
15f1d4de59 | ||
|
|
911a82cd83 | ||
|
|
ec657d1e8d | ||
|
|
9e82d613bb | ||
|
|
eb62940dc6 | ||
|
|
ef46bd72b9 | ||
|
|
7abcb487a9 | ||
|
|
e87a53ff83 | ||
|
|
8e05595710 | ||
|
|
ffee831f5d | ||
|
|
ad88e3342e | ||
|
|
d0986cb37f | ||
|
|
9d148f68a3 | ||
|
|
3b1b7f81dc | ||
|
|
1e4bcf01c7 | ||
|
|
46ce681a88 | ||
|
|
0cb3aab9c2 | ||
|
|
4c6fb9f271 | ||
|
|
2bc36947a8 | ||
|
|
7f001e1780 | ||
|
|
a04d06303b | ||
|
|
9b153bbda5 | ||
|
|
9d55c315c8 | ||
|
|
36a5163f4f | ||
|
|
e8e31ed8ff | ||
|
|
afeac0fa81 | ||
|
|
46d8201ba6 | ||
|
|
5910638bed | ||
|
|
f25a765e82 | ||
|
|
e3068ad245 | ||
|
|
1a5280ad14 | ||
|
|
4033b26587 | ||
|
|
65103d8c88 | ||
|
|
364efa72c3 | ||
|
|
3da2b12b59 | ||
|
|
8c397b1514 | ||
|
|
55cfb7b7da | ||
|
|
32e4fb55d3 | ||
|
|
687c06864c | ||
|
|
8c7dfab9f2 | ||
|
|
b711b3adf6 | ||
|
|
5c402f26c9 | ||
|
|
bec7111cfd | ||
|
|
20cba85383 | ||
|
|
01c2874953 | ||
|
|
5ea315fee8 | ||
|
|
4dbe332b2c | ||
|
|
0f0e8506b3 | ||
|
|
ada99bd1d9 | ||
|
|
a3617a641f | ||
|
|
f01bf03605 | ||
|
|
a237472efb | ||
|
|
5fe76d3720 | ||
|
|
0130d3fb32 | ||
|
|
45671148d5 | ||
|
|
6f146cccbc | ||
|
|
00eb07e637 | ||
|
|
a411b864c2 | ||
|
|
1f6140c912 | ||
|
|
e98c0b11bc | ||
|
|
285be1cd7a | ||
|
|
3f3007c3ac | ||
|
|
32e06c1ad2 | ||
|
|
95b80ebf72 | ||
|
|
25d4a74b59 | ||
|
|
99be4c9005 | ||
|
|
05bf241ab8 | ||
|
|
e401895314 | ||
|
|
ea5575a621 | ||
|
|
066231d86a | ||
|
|
108c551cef | ||
|
|
008508c8ae | ||
|
|
6636e2f505 | ||
|
|
b47a30a04c | ||
|
|
567e5cc0e0 | ||
|
|
382b1a8754 | ||
|
|
4446ab89c0 | ||
|
|
b871b4c046 | ||
|
|
fd45908ff6 | ||
|
|
dab84e56df | ||
|
|
64805d203e | ||
|
|
9d41387b8a | ||
|
|
162c9a14ce | ||
|
|
345f5dc369 | ||
|
|
bc957cb593 | ||
|
|
12789a1bee | ||
|
|
4c9130166c | ||
|
|
aec5bb8daa | ||
|
|
3106ccefcf | ||
|
|
7b43785816 | ||
|
|
0b9d970f75 | ||
|
|
f2b09522b8 | ||
|
|
d0b2c77177 | ||
|
|
cafdd8c93d | ||
|
|
13abe0e9e1 | ||
|
|
8a9d8cdd3e | ||
|
|
3c129ab521 | ||
|
|
dd7a8f423e | ||
|
|
a9e97b33b9 | ||
|
|
6adc94642a | ||
|
|
33fcac9c47 | ||
|
|
7b433a40fc | ||
|
|
b81d096a5a | ||
|
|
fc8a7a1ec9 | ||
|
|
fcee74d912 | ||
|
|
d1650afd37 | ||
|
|
02596cc5a9 | ||
|
|
a9dddfab2f | ||
|
|
f3e8a1937f | ||
|
|
b1f3cc0024 | ||
|
|
46cac9afb9 | ||
|
|
b552d60567 | ||
|
|
3ae4a4e456 | ||
|
|
728980e7dc | ||
|
|
29ab72e614 | ||
|
|
f1a1ee077f | ||
|
|
eb6d3b0869 | ||
|
|
fbef825a3b | ||
|
|
9cdbe9c62d | ||
|
|
0e27c7f2ff | ||
|
|
c0dade0156 | ||
|
|
ede81bd5f7 | ||
|
|
7836aacf47 | ||
|
|
4ffe3d94c7 | ||
|
|
0f47ef96be | ||
|
|
496dd16431 | ||
|
|
cbf2320de6 | ||
|
|
ae5d364226 | ||
|
|
bd805acf04 | ||
|
|
9b2efd07ad | ||
|
|
1ddbfdd8c1 | ||
|
|
2c5058d953 | ||
|
|
294d3a469e | ||
|
|
f66ddc53eb | ||
|
|
e55aa3ca8e | ||
|
|
368031064a | ||
|
|
e6c8766bb7 | ||
|
|
844cfb2ec2 | ||
|
|
a44d5466b5 | ||
|
|
0ed4ed0974 | ||
|
|
a8ba18094f | ||
|
|
89fe6c4d5d | ||
|
|
4b6a3697ac | ||
|
|
703ba4975a | ||
|
|
8a869ce230 | ||
|
|
6b9249507d | ||
|
|
c31f1521c2 | ||
|
|
35fe4fadeb | ||
|
|
7d7ec6858d | ||
|
|
cf5c486c62 | ||
|
|
d765ba1dfb | ||
|
|
49f1739098 | ||
|
|
5bdfc61c3b | ||
|
|
679a8bb0e3 | ||
|
|
3a2497c8bf | ||
|
|
70748bd106 | ||
|
|
0f09ae47e8 | ||
|
|
21eee27d64 | ||
|
|
8c2dea71dc | ||
|
|
c3a45b2cba | ||
|
|
39fab60a61 | ||
|
|
0f392ffbb6 | ||
|
|
700ba975e7 | ||
|
|
abf9f5e1a2 | ||
|
|
45c5f35165 | ||
|
|
7ca9bc22fd | ||
|
|
0aa60035a4 | ||
|
|
6f75a44d9c | ||
|
|
06e3439452 | ||
|
|
d161ed168c | ||
|
|
53e0fbdcc8 | ||
|
|
2e86563274 | ||
|
|
f3063fdfc3 | ||
|
|
90f8ede387 | ||
|
|
c9299fce96 | ||
|
|
30e8ba3717 | ||
|
|
17bd4939a8 | ||
|
|
04a991b37e | ||
|
|
9bdaf7ece6 | ||
|
|
05888a715f | ||
|
|
5d66159b40 | ||
|
|
b9aae2092c | ||
|
|
23252ac323 | ||
|
|
4a966aaa82 | ||
|
|
b31c9c6ab1 | ||
|
|
16a927d63b | ||
|
|
7fc1f254b7 | ||
|
|
7e7c557f38 | ||
|
|
6dbff06dce | ||
|
|
46a304d545 | ||
|
|
eb9a90574e | ||
|
|
60e23eb5cd | ||
|
|
7465bc057b | ||
|
|
3920ab831c | ||
|
|
a57a45fd67 | ||
|
|
3a917e5161 | ||
|
|
a496040de0 | ||
|
|
b85cb85205 | ||
|
|
bf40fee271 | ||
|
|
3076bdffcf | ||
|
|
32fd9c652b | ||
|
|
baa853985b | ||
|
|
758de74946 | ||
|
|
e6f6856df9 | ||
|
|
871ffbc5dd | ||
|
|
dde097b130 | ||
|
|
e8731a554c | ||
|
|
0766275a9a | ||
|
|
ce4424c471 | ||
|
|
740f1250c7 | ||
|
|
45d699321d | ||
|
|
e0b8cdf5f7 | ||
|
|
ecaeb89ea8 | ||
|
|
c4f32aceab | ||
|
|
2164d8d023 | ||
|
|
a08060896d | ||
|
|
948546e0d0 | ||
|
|
ab2519ab4f | ||
|
|
94ea3ba306 | ||
|
|
3a4e626472 | ||
|
|
a61f0e7a5f | ||
|
|
cd29ca91e3 | ||
|
|
7ccd5b526d | ||
|
|
5c2a69288c | ||
|
|
fda4c3afb1 | ||
|
|
05dacde043 | ||
|
|
b7cbc5fe9e | ||
|
|
468b69cb62 | ||
|
|
74772d864e | ||
|
|
c18ca44768 | ||
|
|
801e3fbe4e | ||
|
|
57932ee0df | ||
|
|
82f651d930 | ||
|
|
44d3e08305 | ||
|
|
da3da9b422 | ||
|
|
3d9266a080 | ||
|
|
4ac07b2df4 | ||
|
|
afcf576d43 | ||
|
|
bb73f2140e | ||
|
|
c260039d0b | ||
|
|
a89371c143 | ||
|
|
f3ab9a8532 | ||
|
|
fff1568c6f | ||
|
|
5a13a1b751 | ||
|
|
2ada7e7534 | ||
|
|
c9989e4d87 | ||
|
|
a1cb1336cd | ||
|
|
bd71651cc4 | ||
|
|
ae599686ac | ||
|
|
045059ad1e | ||
|
|
572bbdc8ff | ||
|
|
4d0de4e01a | ||
|
|
5fd34acab5 | ||
|
|
c786b846d0 | ||
|
|
09a81f5c1f | ||
|
|
ee1feb6c48 | ||
|
|
3f2d0eb6f7 | ||
|
|
b5d2aae3d6 | ||
|
|
d146435d07 | ||
|
|
ae27cfa89b | ||
|
|
e8bdaf8004 | ||
|
|
db005a08ed | ||
|
|
1dbad0ff89 | ||
|
|
40ab0b563c | ||
|
|
2175103510 | ||
|
|
73015bc44f | ||
|
|
8b52c83b4c | ||
|
|
0978f0d50d | ||
|
|
cd8e46308f | ||
|
|
dbaf66fdb2 | ||
|
|
d3f2220be4 | ||
|
|
d125860552 | ||
|
|
11c8d56657 | ||
|
|
abbafba3a7 | ||
|
|
b31028a3d6 | ||
|
|
4ae9956a13 | ||
|
|
be45d04423 | ||
|
|
0b5ddbd85e | ||
|
|
c63df2e961 | ||
|
|
050d7757bc | ||
|
|
ee239ba18c | ||
|
|
1efe7c8822 | ||
|
|
dac808e9fa | ||
|
|
6402051165 | ||
|
|
07b829cd7e | ||
|
|
76f12ccad6 | ||
|
|
cb842df492 | ||
|
|
27c99623ac | ||
|
|
18cef82b06 | ||
|
|
23cf086b84 | ||
|
|
ed6ad4ce9f | ||
|
|
40a2ac6d73 | ||
|
|
0a8db236f1 | ||
|
|
035970c7a9 | ||
|
|
c8da4ca8f6 | ||
|
|
f1b6a0b903 | ||
|
|
86c8bc9128 | ||
|
|
d5d9c6ebc4 | ||
|
|
bef8fad109 | ||
|
|
2c44f2c323 | ||
|
|
e99d1cc486 | ||
|
|
03b5dd6319 | ||
|
|
a46c8b134a | ||
|
|
f6d5bffad5 | ||
|
|
ad7ce6369e | ||
|
|
a4507a172e | ||
|
|
5c5d7cb077 | ||
|
|
8666722798 | ||
|
|
ae2f19224e | ||
|
|
75efab4a41 | ||
|
|
4e13f9e442 | ||
|
|
b324bb04c8 | ||
|
|
6485830a73 | ||
|
|
dac71e8b38 | ||
|
|
90edaebc6e | ||
|
|
97e6ae4269 | ||
|
|
27bf0e4fc4 | ||
|
|
16138c2d42 | ||
|
|
7530591a64 | ||
|
|
6e184af899 | ||
|
|
c2f2ef1999 | ||
|
|
2f4da7f262 | ||
|
|
1ef566a570 | ||
|
|
f6d0ede133 | ||
|
|
8f2509845a | ||
|
|
eae62a9e3c | ||
|
|
95f39ae590 | ||
|
|
4d5c0ec394 | ||
|
|
f189f02c02 | ||
|
|
a2ff2897f9 | ||
|
|
5361ef8866 | ||
|
|
6b1da7610f | ||
|
|
ad453c8a82 | ||
|
|
67764fb0e8 | ||
|
|
3b80f63cb9 | ||
|
|
6eb30c5646 | ||
|
|
edb020da9d | ||
|
|
d81af18d1f | ||
|
|
538f2be5b4 | ||
|
|
02185f6701 | ||
|
|
8b6f6bc8e1 | ||
|
|
9f1e9735b8 | ||
|
|
1ee146ef60 | ||
|
|
e5389e4348 | ||
|
|
31bb86c161 | ||
|
|
d8f34aa64d | ||
|
|
746635b2eb | ||
|
|
83284620cc | ||
|
|
255e9f75b5 | ||
|
|
3a5b982774 | ||
|
|
daf378e4a5 | ||
|
|
471ab4548a | ||
|
|
f22027564d | ||
|
|
82404f539c | ||
|
|
a85cbc06b8 | ||
|
|
6d01aa5cb8 | ||
|
|
82d364a25d | ||
|
|
3a1c1b0265 | ||
|
|
eeca5fdd60 | ||
|
|
241afbe7e6 | ||
|
|
2aaa12e60b | ||
|
|
6b454b0ebe | ||
|
|
4ff6815d07 | ||
|
|
e097b5dc3d | ||
|
|
f594d1d423 | ||
|
|
c8299998c8 | ||
|
|
f91728485c | ||
|
|
9674ae3328 | ||
|
|
192d8f54d7 | ||
|
|
3b6f6b6a10 | ||
|
|
5c3cff6a91 | ||
|
|
fecc01d203 | ||
|
|
e0c7272190 | ||
|
|
23e5094e50 | ||
|
|
ec396961be | ||
|
|
b0a26351ce | ||
|
|
3f03dae23d | ||
|
|
c7cce77fb2 | ||
|
|
41654b17a9 | ||
|
|
861d20827b | ||
|
|
94afffe517 | ||
|
|
c640829d9f | ||
|
|
a865f4bc51 | ||
|
|
0ef1fe81a1 | ||
|
|
bc6a0cbcd8 | ||
|
|
955301ca76 | ||
|
|
a2094e8953 | ||
|
|
5bb5998788 | ||
|
|
28cce8b51c | ||
|
|
92019d851a | ||
|
|
6dd1853094 | ||
|
|
7fce471fd9 | ||
|
|
734e585044 | ||
|
|
5a0bc319ea | ||
|
|
8768bb0ee0 | ||
|
|
0af60c3eff | ||
|
|
75abc71cd7 | ||
|
|
aea89a4cd6 | ||
|
|
102d1b4e3a | ||
|
|
9fb073a2b0 | ||
|
|
a6f3daf581 | ||
|
|
a7c0ac6234 | ||
|
|
024c0304f1 | ||
|
|
21ec3cf7bd | ||
|
|
9a7c2d85b2 | ||
|
|
8820ddf269 | ||
|
|
6afb4ab7e4 | ||
|
|
5caca37177 | ||
|
|
a5f17c46fc | ||
|
|
e4f0b73a88 | ||
|
|
3331c9e97b | ||
|
|
aeb1d58bf3 | ||
|
|
97e3233120 | ||
|
|
962e91adec | ||
|
|
9f98e13342 | ||
|
|
1808d7affa | ||
|
|
8ba9a0064c | ||
|
|
b592c943f8 | ||
|
|
2a960700c5 | ||
|
|
f08e79197d | ||
|
|
1690c4eff6 | ||
|
|
75fea9ed84 | ||
|
|
34ebbc8509 | ||
|
|
5b87efb5a7 | ||
|
|
22323daa5f | ||
|
|
211a49f26f | ||
|
|
74564edde8 | ||
|
|
e7e8b58275 | ||
|
|
ce24c73dc0 | ||
|
|
0440020c2f | ||
|
|
17317093d5 | ||
|
|
2fb0bdfcc2 | ||
|
|
d32235d0f0 | ||
|
|
e1b72c47bc | ||
|
|
660b483d1e | ||
|
|
d7be8419d8 | ||
|
|
b68c192ad9 | ||
|
|
0b30ba0cb7 | ||
|
|
37bbea3726 | ||
|
|
ba666fb314 | ||
|
|
9472bd7dce | ||
|
|
3c86da7c09 | ||
|
|
d491eb2da9 | ||
|
|
960333ca09 | ||
|
|
3131b89a1d | ||
|
|
958d52b5eb | ||
|
|
35393d3739 | ||
|
|
75422de6d1 | ||
|
|
017d937ec7 | ||
|
|
bb5757e099 | ||
|
|
8ff44c553c | ||
|
|
b3331c9d47 | ||
|
|
a2895a013b | ||
|
|
a1aca010fb | ||
|
|
eb1ca1eb8d | ||
|
|
508c62af00 | ||
|
|
a682ed7d19 | ||
|
|
eafcc89a6b | ||
|
|
244232d3e1 | ||
|
|
a7a577acad | ||
|
|
8d3cc039f7 | ||
|
|
f1ba1dace8 | ||
|
|
9d84debefd | ||
|
|
e1f8a8c521 | ||
|
|
5b05e4e32e | ||
|
|
3fc2729db8 | ||
|
|
a120d7a83e | ||
|
|
5a13171a40 | ||
|
|
204c695434 | ||
|
|
40f4c2f8ab | ||
|
|
636803d5d4 | ||
|
|
344d87342c | ||
|
|
9cb697f5de | ||
|
|
c0c4117b8e | ||
|
|
e56af33aa3 | ||
|
|
3987224d50 | ||
|
|
37ef88a602 | ||
|
|
786ce134c6 | ||
|
|
7339ceca19 | ||
|
|
06317b0b17 | ||
|
|
0588ea2d18 | ||
|
|
0b926fd907 | ||
|
|
b12aeac264 | ||
|
|
86b4ab89ea | ||
|
|
ee5e1095c2 | ||
|
|
0e362dab46 | ||
|
|
d4300f0e5c | ||
|
|
87d2a3db26 | ||
|
|
533ec7b5df | ||
|
|
b6b26f252e | ||
|
|
1d09916b54 | ||
|
|
8340c4054b | ||
|
|
868b17a5ff | ||
|
|
1460b610a4 | ||
|
|
532c872902 | ||
|
|
600ec0da92 | ||
|
|
5830b75c0f | ||
|
|
3f1fd3db37 | ||
|
|
4ff0713e59 | ||
|
|
7b4ff40b25 | ||
|
|
a2498dacd8 | ||
|
|
6f295d388a | ||
|
|
68d1455ed8 | ||
|
|
a8fa274230 | ||
|
|
21c18c0599 | ||
|
|
abd3141b0d | ||
|
|
ca48783f78 | ||
|
|
45d84a2b84 | ||
|
|
0b2839c9fc | ||
|
|
d7c96c717a | ||
|
|
19e6dca445 | ||
|
|
7b7a85ae6b | ||
|
|
8e7e1bfc51 | ||
|
|
25f94fe430 | ||
|
|
436e8f4bd4 | ||
|
|
ad5c2e8583 | ||
|
|
d92614ced9 | ||
|
|
6333ca5621 | ||
|
|
ca7ee58883 | ||
|
|
28b012aa60 | ||
|
|
8dd33cf33b | ||
|
|
e93901f0cc | ||
|
|
7af92668f5 | ||
|
|
4262cc81ac | ||
|
|
4d5049a47a | ||
|
|
1251425ee6 | ||
|
|
f014922e98 | ||
|
|
3debc9fef4 | ||
|
|
a72885634d | ||
|
|
409da256d6 | ||
|
|
54f42a37fe | ||
|
|
c662acaa3b | ||
|
|
3214d4ea9f | ||
|
|
0709860f48 | ||
|
|
05f16da222 | ||
|
|
a49aad644e | ||
|
|
c352a08c55 | ||
|
|
90d1a60595 | ||
|
|
9be45c7e89 | ||
|
|
239f9b9cb7 | ||
|
|
c0d80b665a | ||
|
|
5643d2b675 | ||
|
|
018576cda5 | ||
|
|
35468c7d77 | ||
|
|
40ea575589 | ||
|
|
12327505e5 | ||
|
|
fc68acae6e | ||
|
|
3f1e612d67 | ||
|
|
eaf190b485 | ||
|
|
4b73f17997 | ||
|
|
f0c6b22ddc | ||
|
|
44ea92e229 | ||
|
|
5cfbd550fe | ||
|
|
6046dc905e | ||
|
|
b3fe0cb172 | ||
|
|
f097e0a016 | ||
|
|
491b3936ac | ||
|
|
35b43c0762 | ||
|
|
78f9e890d6 | ||
|
|
2405b2f4f1 | ||
|
|
1db927601a | ||
|
|
6fbbbedc28 | ||
|
|
35042e742f | ||
|
|
161b934b8f | ||
|
|
770c11b3f0 | ||
|
|
0b15179219 | ||
|
|
7bac8d1d77 | ||
|
|
2aa502f999 | ||
|
|
56d7c7c94c | ||
|
|
a0191c733c | ||
|
|
e6d45ff3cc | ||
|
|
f64b1c4ed9 | ||
|
|
38de67054e | ||
|
|
ab127f2eb2 | ||
|
|
09b1cdf610 | ||
|
|
a8b03de538 | ||
|
|
cde4a6e41c | ||
|
|
973a4d9fd5 | ||
|
|
6b000cf249 | ||
|
|
bbafb21049 | ||
|
|
50e44447ae | ||
|
|
366031e662 | ||
|
|
02ddea2c3c | ||
|
|
142f217fcd | ||
|
|
949ff83687 | ||
|
|
f83a09ce5a | ||
|
|
817e385f74 | ||
|
|
2da4cb3096 | ||
|
|
4fb444306c | ||
|
|
4d86346fcf | ||
|
|
5f84b66615 | ||
|
|
f779ee1b88 | ||
|
|
42a619d911 | ||
|
|
06e18c293c | ||
|
|
96a800c3d4 | ||
|
|
558e49354a | ||
|
|
aaf3944d18 | ||
|
|
a3c7ff3dd5 | ||
|
|
e378d70c4e | ||
|
|
ae132c2e94 | ||
|
|
b3afeaccda | ||
|
|
72c32e2828 | ||
|
|
14af847ddb | ||
|
|
e5ed3e88d6 | ||
|
|
7b7d7f7e98 | ||
|
|
daa3fd2992 | ||
|
|
d835f58bbc | ||
|
|
9b132c25a0 | ||
|
|
e50477cb1c | ||
|
|
650cedeec7 | ||
|
|
6a879ec52b | ||
|
|
5af1420e68 | ||
|
|
c109d3db81 | ||
|
|
548cb700c5 | ||
|
|
093beb302b | ||
|
|
6ee02cbfe2 | ||
|
|
6e8ec4b25e | ||
|
|
1832d8c870 | ||
|
|
6e6cb30aca | ||
|
|
5ea3222e90 | ||
|
|
dc62349472 | ||
|
|
d1681dc37f | ||
|
|
26fef5eeb2 | ||
|
|
53b1ebe371 | ||
|
|
f4d0bb24c9 | ||
|
|
df039bc664 | ||
|
|
4e5e7dbe42 | ||
|
|
2197cbdef6 | ||
|
|
c4d2462c98 | ||
|
|
b4090602ad | ||
|
|
f1aca129f2 | ||
|
|
a0b0c40c7f | ||
|
|
f9e90823b7 | ||
|
|
e1c0731c42 | ||
|
|
248eeffbaa | ||
|
|
f4dcb77427 | ||
|
|
c4a2b86c0d | ||
|
|
44b154f578 | ||
|
|
41a78ed7bf | ||
|
|
101bbea74d | ||
|
|
63cc3d9db6 | ||
|
|
275be0c269 | ||
|
|
de1572004d | ||
|
|
74b44502a5 | ||
|
|
178f420c87 | ||
|
|
41cf4e8c21 | ||
|
|
5a631a327b | ||
|
|
891ae562ea | ||
|
|
b66e9cdc60 | ||
|
|
961d890b2c | ||
|
|
4ec8e85737 | ||
|
|
2f1b72055a | ||
|
|
6824657b4f | ||
|
|
39acd6cf17 | ||
|
|
a7645a9b0f | ||
|
|
a33950f675 | ||
|
|
2729d9a34a | ||
|
|
a7678f8916 | ||
|
|
756a81ad14 | ||
|
|
16ba8deacf | ||
|
|
fdff48b706 | ||
|
|
bfe281a311 | ||
|
|
da969fa610 | ||
|
|
1e8392730d | ||
|
|
a80e4716f4 | ||
|
|
3192b2ee0b | ||
|
|
88c2c03501 | ||
|
|
ee83fcaf4f | ||
|
|
5663b90a40 | ||
|
|
b2ee519ab8 | ||
|
|
bff169463f | ||
|
|
90aa19d351 | ||
|
|
db68680ebf | ||
|
|
13b84c07fa | ||
|
|
2da23a58af | ||
|
|
a4966597cb | ||
|
|
a8562ad56a | ||
|
|
04b08c9213 | ||
|
|
eef832df7d | ||
|
|
53e8fe4f57 | ||
|
|
9563e6a98b | ||
|
|
77d1de14aa | ||
|
|
ef364c9d59 | ||
|
|
b6dd33076a | ||
|
|
72f7a1d153 | ||
|
|
9a8910121f | ||
|
|
43648638ba |
15
.gitignore
vendored
15
.gitignore
vendored
@@ -1,5 +1,4 @@
|
||||
*.log
|
||||
module_dfu/host/xmosdfu/xmosdfu
|
||||
*.dSYM
|
||||
*/.build_*/*
|
||||
*/bin/*
|
||||
@@ -11,15 +10,23 @@ module_dfu/host/xmosdfu/xmosdfu
|
||||
*.xi
|
||||
*.i
|
||||
*.bin
|
||||
.build*
|
||||
*/.venv/*
|
||||
*~
|
||||
*.a
|
||||
*.swp
|
||||
*.*~
|
||||
*.pyc
|
||||
.build*
|
||||
.DS_Store
|
||||
test_results.csv
|
||||
_build*
|
||||
**/.venv/**
|
||||
**/.vscode/**
|
||||
**.egg-info
|
||||
|
||||
# waf build files
|
||||
.lock-waf_*
|
||||
.waf-*/
|
||||
build/
|
||||
host/xmosdfu/xmosdfu
|
||||
.build*
|
||||
*.pyc
|
||||
xscope.xmt
|
||||
|
||||
157
CHANGELOG.rst
157
CHANGELOG.rst
@@ -1,26 +1,161 @@
|
||||
lib_xua Change Log
|
||||
==================
|
||||
|
||||
0.1.4
|
||||
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
|
||||
* REMOVED: Support for HID Reports containing controls from mixed Usage
|
||||
pages
|
||||
* CHANGED: Renamed the HID API file xua_hid_report_descriptor.h to
|
||||
xua_hid_report.h
|
||||
|
||||
* Changes to dependencies:
|
||||
|
||||
- lib_locks: Added dependency 2.1.0
|
||||
|
||||
2.1.1
|
||||
-----
|
||||
|
||||
* CHANGED: Setting of HID report items
|
||||
|
||||
2.1.0
|
||||
-----
|
||||
|
||||
* CHANGED: Updated clock blocks to support lib_xud v2.0.0
|
||||
* CHANGED: Updated dependency on lib_xud to v2.0.0 for use by XVF3600
|
||||
|
||||
2.0.1
|
||||
-----
|
||||
|
||||
* CHANGED: Reverted dependency on lib_xud to v1.2.0 for use by XVF3510
|
||||
|
||||
2.0.0
|
||||
-----
|
||||
|
||||
* ADDED: Function to get a Report item description
|
||||
* CHANGED: Check HID Usage Page when changing a Report item description
|
||||
* CHANGED: HID event ID from list to bit and byte location in HID Report
|
||||
* CHANGED: Interface to UserHIDRecordEvent()
|
||||
* ADDED: Support for multiple flash specs defined by DFU_FLASH_DEVICE
|
||||
* ADDED: Nullable c_aud_ctl chan-end optimisation for fixed rate devices
|
||||
|
||||
1.3.0
|
||||
-----
|
||||
|
||||
* CHANGED: Move HID descriptors to ease maintenance
|
||||
* CHANGED: Move legacy tests to separate directory
|
||||
* CHANGED: Replace unused GPI-specific HID event names with generic ones
|
||||
* ADDED: Build default HID Report descriptor at boot-time
|
||||
* ADDED: Function to return length of HID Report
|
||||
* CHANGED: HID Report to return multiple bytes
|
||||
* CHANGED: NO_USB conditional compilation switch with XUA_USB_EN
|
||||
* REMOVED: XS1 support
|
||||
* CHANGED: Clock blocks used for BCLK and MCLK
|
||||
* REMOVED: Arguments no longer supported by XUD_Main
|
||||
|
||||
1.2.0
|
||||
-----
|
||||
|
||||
* ADDED: Updates for xcore.ai/XS3 compatibility
|
||||
* ADDED: Makefile.Win32 for xmosdfu on Windows
|
||||
* FIXED: Bump default BCD device number to v1.2.0
|
||||
* FIXED: xmosdfu now fails with an error when given a directory (#119)
|
||||
* FIXED: Compilation errors related to HID code
|
||||
* FIXED: Runtime error when using mic array interface
|
||||
* CHANGED: Use XMOS Public Licence Version 1
|
||||
* FIXED: Automate HID Report Descriptor length in AC1 HID Descriptor
|
||||
|
||||
1.1.1
|
||||
-----
|
||||
|
||||
* RESOLVED: Zero length input packets generated before enumeration causing I2S
|
||||
timing pushout at startup
|
||||
* CHANGED: Pin Python package versions
|
||||
* REMOVED: not necessary cpanfile
|
||||
|
||||
0.1.3
|
||||
1.1.0
|
||||
-----
|
||||
|
||||
* CHANGED: Remove sharing of global master clock port variable for
|
||||
compatibility with tools 14.4 (API change but preserve 0.1 version as this
|
||||
is maintenance branch)
|
||||
* CHANGED: Remove obsolete -fsubword-select to clear warning in tools 14.4
|
||||
* 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
|
||||
* FIXED: Descriptors for XUA_ADAPTIVE incorrectly defined for IN endpoint
|
||||
* ADDED: Guards to user_hid.h and xua_hid.h
|
||||
* ADDED: UAC1 HID support for AC Stop (End Call), Volume Increment and
|
||||
Volume Decrement
|
||||
* CHANGE: UAC1 HID to report function keys f21 through f24 as specified by
|
||||
customer
|
||||
* CHANGE: 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
|
||||
|
||||
0.2.1
|
||||
-----
|
||||
|
||||
* HOTFIX: Fix descriptors for XUA_ADAPTIVE
|
||||
|
||||
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
|
||||
* CHANGE: I2S hardware resources no longer used globally and must be passed
|
||||
to XUA_AudioHub()
|
||||
* CHANGE: XUA_AudioHub() no longer pars S/PDIF transmitter task
|
||||
* CHANGE: Moved to lib_spdif (from module_spdif_tx & module_spdif_rx)
|
||||
* CHANGE: Define NUM_PDM_MICS renamed to XUA_NUM_PDM_MICS
|
||||
* CHANGE: Define NO_USB renamed to XUA_USB_EN
|
||||
* CHANGE: Build files updated to support new "xcommon" behaviour in xwaf.
|
||||
* RESOLVED: wChannelConfig in UAC1 descriptor set according to output channel
|
||||
count
|
||||
* RESOLVED: Indexing of ADAT channel strings (#18059)
|
||||
* RESOLVED: 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
|
||||
* ADDED: Application note AN00246: Simple USB Audio Device using lib_xua
|
||||
* CHANGE: xmosdfu emits warning if empty image read via upload
|
||||
* CHANGE: Simplified mclk port sharing - no longer uses unsafe pointer
|
||||
* RESOLVED: Runtime exception issues when incorrect feedback calculated
|
||||
(introduced in sc_xud 6.13)
|
||||
(introduced in sc_usb_audio 6.13)
|
||||
* RESOLVED: Output sample counter reset on stream start. Caused playback
|
||||
issues on some Linux based hosts
|
||||
|
||||
@@ -69,7 +204,7 @@ lib_xua Change Log
|
||||
|
||||
|
||||
Legacy release history
|
||||
======================
|
||||
----------------------
|
||||
|
||||
(Note: Forked from sc_usb_audio at this point)
|
||||
|
||||
@@ -85,7 +220,7 @@ Legacy release history
|
||||
|
||||
7.3.0
|
||||
-----
|
||||
- CHANGE: Example OSX DFU host app updated to now take PID as runtime
|
||||
- CHANGE: 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
|
||||
|
||||
@@ -346,7 +481,7 @@ Legacy release history
|
||||
|
||||
|
||||
Legacy release history
|
||||
======================
|
||||
----------------------
|
||||
|
||||
Please see changelog in sw_usb_audio for changes prior to 6.8.0 release.
|
||||
|
||||
|
||||
131
Jenkinsfile
vendored
131
Jenkinsfile
vendored
@@ -1,4 +1,4 @@
|
||||
@Library('xmos_jenkins_shared_library@develop') _
|
||||
@Library('xmos_jenkins_shared_library@v0.16.2') _
|
||||
|
||||
getApproval()
|
||||
|
||||
@@ -6,7 +6,7 @@ pipeline {
|
||||
agent none
|
||||
environment {
|
||||
REPO = 'lib_xua'
|
||||
VIEW = 'lib_xua_release_0_1_3'
|
||||
VIEW = getViewName(REPO)
|
||||
}
|
||||
options {
|
||||
skipDefaultCheckout()
|
||||
@@ -27,11 +27,70 @@ pipeline {
|
||||
xcoreLibraryChecks("${REPO}")
|
||||
}
|
||||
}
|
||||
stage('Tests') {
|
||||
steps {
|
||||
runXmostest("${REPO}", 'tests')
|
||||
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}") {
|
||||
@@ -84,34 +143,50 @@ pipeline {
|
||||
}
|
||||
}
|
||||
}
|
||||
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('Release and update') {
|
||||
stage('Update') {
|
||||
agent {
|
||||
label 'x86_64&&brew'
|
||||
}
|
||||
stages {
|
||||
stage('Get view') {
|
||||
steps {
|
||||
xcorePrepareSandbox("${VIEW}", "${REPO}")
|
||||
}
|
||||
}
|
||||
stage('Release') {
|
||||
when {
|
||||
expression {
|
||||
isReleaseBranchOfOrganisation('xmos')
|
||||
}
|
||||
}
|
||||
steps {
|
||||
sh "mkdir ${REPO}/empty"
|
||||
xcoreReleaseToGithub("${WORKSPACE}/${REPO}","${WORKSPACE}/${REPO}/empty")
|
||||
}
|
||||
}
|
||||
stage('Update') {
|
||||
steps {
|
||||
updateViewfiles()
|
||||
}
|
||||
}
|
||||
steps {
|
||||
updateViewfiles()
|
||||
}
|
||||
post {
|
||||
cleanup {
|
||||
|
||||
84
LICENSE.rst
Normal file
84
LICENSE.rst
Normal 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 doesn’t 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 XMOS’s 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 XMOS’s 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.
|
||||
135
LICENSE.txt
135
LICENSE.txt
@@ -1,135 +0,0 @@
|
||||
Software Release License Agreement
|
||||
|
||||
Copyright (c) 2011-2020, 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
|
||||
7
Pipfile
7
Pipfile
@@ -1,7 +0,0 @@
|
||||
[[source]]
|
||||
name = "pypi"
|
||||
url = "https://pypi.org/simple"
|
||||
verify_ssl = true
|
||||
|
||||
[dev-packages]
|
||||
flake8 = "*"
|
||||
60
README.rst
60
README.rst
@@ -1,18 +1,62 @@
|
||||
lib_xua
|
||||
=======
|
||||
|
||||
USB Audio Shared Components. For use in the XMOS USB Audio Refererence Designs.
|
||||
Summary
|
||||
-------
|
||||
|
||||
USB Audio Shared Components for use in the XMOS USB Audio Refererence Designs.
|
||||
|
||||
Required software (dependencies)
|
||||
--------------------------------
|
||||
This library enables the development of USB Audio devices on the XMOS xCORE architecture.
|
||||
|
||||
* lib_logging
|
||||
* lib_xud
|
||||
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
|
||||
|
||||
- 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.
|
||||
|
||||
Checking dependent libs
|
||||
|
||||
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
|
||||
|
||||
1
doc_dfu/.gitignore
vendored
Normal file
1
doc_dfu/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
_build
|
||||
84
doc_dfu/LICENSE.rst
Normal file
84
doc_dfu/LICENSE.rst
Normal 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 doesn’t 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 XMOS’s 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 XMOS’s 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.
|
||||
@@ -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
|
||||
@@ -1,7 +1,7 @@
|
||||
.. _usb_audiosec_building_xmos_dfu:
|
||||
|
||||
Building the XMOS DFU loader - macOS
|
||||
====================================
|
||||
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.
|
||||
@@ -9,10 +9,48 @@ 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.OSX all``
|
||||
``make -f Makefile.OSX64 all``
|
||||
|
||||
This Makefile contains the following:
|
||||
|
||||
.. literalinclude:: Makefile.OSX
|
||||
.. 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
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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.
|
||||
|
||||
84
examples/AN00246_xua_example/LICENSE.rst
Normal file
84
examples/AN00246_xua_example/LICENSE.rst
Normal 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 doesn’t 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 XMOS’s 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 XMOS’s 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.
|
||||
@@ -1,135 +0,0 @@
|
||||
Software Release License Agreement
|
||||
|
||||
Copyright (c) 2018-2019, XMOS, All rights reserved.
|
||||
|
||||
BY ACCESSING, USING, INSTALLING OR DOWNLOADING THE XMOS SOFTWARE, YOU AGREE TO BE BOUND BY THE FOLLOWING TERMS. IF YOU DO NOT AGREE TO THESE, DO NOT ATTEMPT TO DOWNLOAD, ACCESS OR USE THE XMOS Software.
|
||||
|
||||
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 application note AN00246 software
|
||||
@@ -4,13 +4,15 @@ 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 -DUSB_TILE=tile[1] \
|
||||
-DSDA_HIGH=2 -DSCL_HIGH=1 -fxscope
|
||||
-g -Wno-unused-function -Wno-timing -DXUD_SERIES_SUPPORT=XUD_X200_SERIES \
|
||||
-DXUD_CORE_CLOCK=600 -DUSB_TILE=tile[1] -fxscope
|
||||
|
||||
#-DSDA_HIGH=2 -DSCL_HIGH=1 -fxscope
|
||||
|
||||
# The USED_MODULES variable lists other module used by the application. These
|
||||
# modules will extend the SOURCE_DIRS, INCLUDE_DIRS and LIB_DIRS variables.
|
||||
# Modules are expected to be in the directory above the BASE_DIR directory.
|
||||
USED_MODULES = lib_xua lib_xud module_i2c_shared module_i2c_single_port
|
||||
USED_MODULES = lib_xua lib_device_control lib_xud lib_i2c
|
||||
|
||||
#=============================================================================
|
||||
# The following part of the Makefile includes the common build infrastructure
|
||||
|
||||
@@ -1,16 +1,14 @@
|
||||
|
||||
How to use the lib_xua_library
|
||||
===============================
|
||||
|
||||
.. version:: 0.1.3
|
||||
Simple USB Audio Device using lib_xua
|
||||
=====================================
|
||||
|
||||
Summary
|
||||
-------
|
||||
|
||||
Required tools and libraries
|
||||
............................
|
||||
Software dependencies
|
||||
.....................
|
||||
|
||||
.. appdeps::
|
||||
For a list of direct dependencies, look for USED_MODULES in the Makefile.
|
||||
|
||||
Required hardware
|
||||
.................
|
||||
|
||||
2
examples/AN00246_xua_example/doc/.gitignore
vendored
2
examples/AN00246_xua_example/doc/.gitignore
vendored
@@ -1,2 +0,0 @@
|
||||
rst/_build
|
||||
pdf
|
||||
@@ -1,5 +1,4 @@
|
||||
.. include:: ../../README.rst
|
||||
.. |I2C| replace:: I\ :sup:`2`\ C
|
||||
|
||||
|newpage|
|
||||
|
||||
@@ -9,29 +8,16 @@ Overview
|
||||
Introduction
|
||||
............
|
||||
|
||||
The XMOS USB Audio (XUA) library provides an implemention of USB Audio Class 2.0
|
||||
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.
|
||||
|
||||
Block diagram
|
||||
.............
|
||||
|
||||
.. .. figure:: images/block_diagram.*
|
||||
.. :width: 80%
|
||||
..
|
||||
.. Application block diagram
|
||||
|
||||
The application uses a single logical core which runs the application and makes
|
||||
calls to the |I2C| master library functions as required.
|
||||
|
||||
How to use lib_xua
|
||||
------------------
|
||||
|
||||
The Makefile
|
||||
............
|
||||
------------
|
||||
|
||||
To start using the lib_xua, you need to add ``lib_xua`` to your Makefile::
|
||||
To start using ``lib_xua``, you need to add ``lib_xua`` to your Makefile::
|
||||
|
||||
USED_MODULES = .. lib_xua ...
|
||||
|
||||
@@ -69,7 +55,7 @@ be included in your code to use the library.
|
||||
Allocating hardware resources
|
||||
.............................
|
||||
|
||||
A most basic implementation of a USB Audio device (i.e. simple stereo input and output via I2S)
|
||||
A basic implementation of a USB Audio device (i.e. simple stereo input and output via I2S)
|
||||
using ``lib_xua`` requires the follow pins:
|
||||
|
||||
- I2S Bit Clock (from xCORE to DAC)
|
||||
@@ -80,20 +66,34 @@ using ``lib_xua`` requires the follow pins:
|
||||
|
||||
.. note::
|
||||
|
||||
ANOO246 assumes xCORE is I2S bus master
|
||||
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: /* Clock-block
|
||||
: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
|
||||
: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
|
||||
..................
|
||||
@@ -110,21 +110,21 @@ These are declared as follows:
|
||||
|
||||
.. literalinclude:: app_xua_simple.xc
|
||||
:start-on: /* Endpoint type tables
|
||||
:end-on: /* XUD_EpType epTypeTableIn
|
||||
:end-on: XUD_EpType epTypeTableIn
|
||||
|
||||
The application main() function
|
||||
...............................
|
||||
-------------------------------
|
||||
|
||||
The ``main()`` function sets up the tasks in the application.
|
||||
|
||||
Various channels are required in order to allow the required tasks to communcate.
|
||||
These must be declared":
|
||||
These must first be declared:
|
||||
|
||||
.. literalinclude:: app_xua_simple.xc
|
||||
:start-on: /* Channels for lib_xud
|
||||
:end-on: /* chan c_aud_ctl
|
||||
:end-on: chan c_aud_ctl
|
||||
|
||||
The rest of the ``main()`` function starts all the tasks in parallel
|
||||
The rest of the ``main()`` function starts all of the tasks in parallel
|
||||
using the xC ``par`` construct:
|
||||
|
||||
.. literalinclude:: app_xua_simple.xc
|
||||
@@ -146,7 +146,15 @@ Configuration
|
||||
- Various product strings
|
||||
- Master clock frequency
|
||||
|
||||
These parameters are set via defines in an optional ``xua_conf.h`` header file.
|
||||
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|
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// Copyright (c) 2017-2019, XMOS Ltd, All rights reserved
|
||||
// Copyright 2017-2021 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)
|
||||
*
|
||||
@@ -22,17 +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 */
|
||||
/* 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_in2 = PORT_MCLK_IN2;
|
||||
in port p_mclk_in_usb = PORT_MCLK_IN_USB; /* Extra master clock input for the USB tile */
|
||||
|
||||
/* Clock-block declarations */
|
||||
clock clk_audio_bclk = on tile[0]: XS1_CLKBLK_4; /* Bit clock */
|
||||
clock clk_audio_mclk = on tile[0]: XS1_CLKBLK_5; /* Master clock */
|
||||
clock clk_audio_mclk2 = on tile[1]: XS1_CLKBLK_1; /* 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 */
|
||||
@@ -48,10 +49,10 @@ 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 communicating 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
|
||||
@@ -59,8 +60,7 @@ int main()
|
||||
/* Low level USB device layer core */
|
||||
on tile[1]: XUD_Main(c_ep_out, 2, c_ep_in, 2,
|
||||
c_sof, epTypeTableOut, epTypeTableIn,
|
||||
null, null, -1 ,
|
||||
XUD_SPEED_HS, XUD_PWR_BUS);
|
||||
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.. */
|
||||
@@ -69,18 +69,18 @@ int main()
|
||||
/* 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]: {
|
||||
set_clock_src(clk_audio_mclk2, p_mclk_in2);
|
||||
set_port_clock(p_for_mclk_count, clk_audio_mclk2);
|
||||
start_clock(clk_audio_mclk2);
|
||||
|
||||
/* 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]: {
|
||||
XUA_AudioHub(c_aud, p_mclk_in);
|
||||
}
|
||||
/* 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;
|
||||
|
||||
@@ -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_
|
||||
|
||||
|
||||
@@ -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_
|
||||
|
||||
|
||||
168
examples/AN00246_xua_example/src/hid_report_descriptor.h
Normal file
168
examples/AN00246_xua_example/src/hid_report_descriptor.h
Normal file
@@ -0,0 +1,168 @@
|
||||
// Copyright 2021 XMOS LIMITED.
|
||||
// This Software is subject to the terms of the XMOS Public Licence: Version 1.
|
||||
#ifndef __hid_report_descriptor_h__
|
||||
#define __hid_report_descriptor_h__
|
||||
|
||||
#include "xua_hid_report.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__
|
||||
@@ -1,16 +1,17 @@
|
||||
// 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.
|
||||
|
||||
#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)
|
||||
@@ -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
|
||||
@@ -90,8 +91,8 @@ void AudioHwConfig(unsigned samFreq, unsigned mClk, unsigned dsdMode,
|
||||
* bit[0] : Power Down (PDN) : Powered down
|
||||
*/
|
||||
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]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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"/>
|
||||
|
||||
@@ -1,24 +1,27 @@
|
||||
// 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.
|
||||
|
||||
#define NUM_USB_CHAN_OUT 2
|
||||
#define NUM_USB_CHAN_IN 2
|
||||
#define I2S_CHANS_DAC 2
|
||||
#define I2S_CHANS_ADC 2
|
||||
#define MCLK_441 (512 * 44100)
|
||||
#define MCLK_48 (512 * 48000)
|
||||
#define MIN_FREQ 48000
|
||||
#define MAX_FREQ 48000
|
||||
#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 SPDIF_TX_INDEX 0
|
||||
#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 AUDIO_CLASS 2
|
||||
#define AUDIO_CLASS_FALLBACK 0
|
||||
#define BCD_DEVICE 0x1234
|
||||
#define XUA_DFU_EN 0
|
||||
#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
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
84
examples/AN00247_xua_example_spdif_tx/LICENSE.rst
Normal file
84
examples/AN00247_xua_example_spdif_tx/LICENSE.rst
Normal 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 doesn’t 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 XMOS’s 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 XMOS’s 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.
|
||||
21
examples/AN00247_xua_example_spdif_tx/Makefile
Normal file
21
examples/AN00247_xua_example_spdif_tx/Makefile
Normal 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] -DSDA_HIGH=2 -DSCL_HIGH=1 -fxscope
|
||||
|
||||
# The USED_MODULES variable lists other module used by the application. These
|
||||
# modules will extend the SOURCE_DIRS, INCLUDE_DIRS and LIB_DIRS variables.
|
||||
# Modules are expected to be in the directory above the BASE_DIR directory.
|
||||
USED_MODULES = lib_xua lib_xud lib_spdif
|
||||
|
||||
#=============================================================================
|
||||
# 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
|
||||
|
||||
32
examples/AN00247_xua_example_spdif_tx/README.rst
Normal file
32
examples/AN00247_xua_example_spdif_tx/README.rst
Normal 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
|
||||
|
||||
|
||||
278
examples/AN00247_xua_example_spdif_tx/doc/rst/AN00247.rst
Normal file
278
examples/AN00247_xua_example_spdif_tx/doc/rst/AN00247.rst
Normal 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 |
2
examples/AN00247_xua_example_spdif_tx/doc/rst/xdoc.conf
Normal file
2
examples/AN00247_xua_example_spdif_tx/doc/rst/xdoc.conf
Normal file
@@ -0,0 +1,2 @@
|
||||
XMOSNEWSTYLE=1
|
||||
SOURCE_INCLUDE_DIRS=../../src
|
||||
106
examples/AN00247_xua_example_spdif_tx/src/app_xua_simple.xc
Normal file
106
examples/AN00247_xua_example_spdif_tx/src/app_xua_simple.xc
Normal file
@@ -0,0 +1,106 @@
|
||||
// Copyright 2017-2021 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;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,168 @@
|
||||
// Copyright 2021 XMOS LIMITED.
|
||||
// This Software is subject to the terms of the XMOS Public Licence: Version 1.
|
||||
#ifndef __hid_report_descriptor_h__
|
||||
#define __hid_report_descriptor_h__
|
||||
|
||||
#include "xua_hid_report.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__
|
||||
52
examples/AN00247_xua_example_spdif_tx/src/hwsupport.xc
Normal file
52
examples/AN00247_xua_example_spdif_tx/src/hwsupport.xc
Normal 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;
|
||||
}
|
||||
|
||||
88
examples/AN00247_xua_example_spdif_tx/src/xk-audio-216-mc.xn
Normal file
88
examples/AN00247_xua_example_spdif_tx/src/xk-audio-216-mc.xn
Normal 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>
|
||||
32
examples/AN00247_xua_example_spdif_tx/src/xua_conf.h
Normal file
32
examples/AN00247_xua_example_spdif_tx/src/xua_conf.h
Normal file
@@ -0,0 +1,32 @@
|
||||
// Copyright 2017-2021 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
|
||||
8
examples/AN00247_xua_example_spdif_tx/src/xud_conf.h
Normal file
8
examples/AN00247_xua_example_spdif_tx/src/xud_conf.h
Normal 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
|
||||
84
examples/AN00248_xua_example_pdm_mics/LICENSE.rst
Normal file
84
examples/AN00248_xua_example_pdm_mics/LICENSE.rst
Normal 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 doesn’t 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 XMOS’s 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 XMOS’s 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.
|
||||
21
examples/AN00248_xua_example_pdm_mics/Makefile
Normal file
21
examples/AN00248_xua_example_pdm_mics/Makefile
Normal file
@@ -0,0 +1,21 @@
|
||||
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
|
||||
|
||||
# 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
|
||||
|
||||
35
examples/AN00248_xua_example_pdm_mics/README.rst
Normal file
35
examples/AN00248_xua_example_pdm_mics/README.rst
Normal 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
|
||||
|
||||
|
||||
315
examples/AN00248_xua_example_pdm_mics/doc/rst/AN00248.rst
Normal file
315
examples/AN00248_xua_example_pdm_mics/doc/rst/AN00248.rst
Normal 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 |
2
examples/AN00248_xua_example_pdm_mics/doc/rst/xdoc.conf
Normal file
2
examples/AN00248_xua_example_pdm_mics/doc/rst/xdoc.conf
Normal file
@@ -0,0 +1,2 @@
|
||||
XMOSNEWSTYLE=1
|
||||
SOURCE_INCLUDE_DIRS=../../src
|
||||
121
examples/AN00248_xua_example_pdm_mics/src/app_xua_simple.xc
Normal file
121
examples/AN00248_xua_example_pdm_mics/src/app_xua_simple.xc
Normal file
@@ -0,0 +1,121 @@
|
||||
// Copyright 2017-2021 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;
|
||||
}
|
||||
|
||||
|
||||
31
examples/AN00248_xua_example_pdm_mics/src/audiohw.xc
Normal file
31
examples/AN00248_xua_example_pdm_mics/src/audiohw.xc
Normal file
@@ -0,0 +1,31 @@
|
||||
// Copyright 2017-2021 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;
|
||||
}
|
||||
//:
|
||||
@@ -0,0 +1,168 @@
|
||||
// Copyright 2021 XMOS LIMITED.
|
||||
// This Software is subject to the terms of the XMOS Public Licence: Version 1.
|
||||
#ifndef __hid_report_descriptor_h__
|
||||
#define __hid_report_descriptor_h__
|
||||
|
||||
#include "xua_hid_report.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__
|
||||
94
examples/AN00248_xua_example_pdm_mics/src/mic_array_ref.xn
Normal file
94
examples/AN00248_xua_example_pdm_mics/src/mic_array_ref.xn
Normal 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>
|
||||
31
examples/AN00248_xua_example_pdm_mics/src/xua_conf.h
Normal file
31
examples/AN00248_xua_example_pdm_mics/src/xua_conf.h
Normal file
@@ -0,0 +1,31 @@
|
||||
// Copyright 2017-2021 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
|
||||
8
examples/AN00248_xua_example_pdm_mics/src/xud_conf.h
Normal file
8
examples/AN00248_xua_example_pdm_mics/src/xud_conf.h
Normal 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
|
||||
@@ -3,7 +3,7 @@ TARGET = xk-audio-216-mc.xn
|
||||
USED_MODULES = lib_xua \
|
||||
module_i2c_shared module_i2c_single_port lib_logging
|
||||
|
||||
BUILD_FLAGS = -O0 -g -lflash -DXUD_SERIES_SUPPORT=4 -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 \
|
||||
@@ -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__
|
||||
|
||||
167
legacy_tests/app_test_i2s_loopback/hid_report_descriptor.h
Normal file
167
legacy_tests/app_test_i2s_loopback/hid_report_descriptor.h
Normal file
@@ -0,0 +1,167 @@
|
||||
// Copyright 2021 XMOS LIMITED.
|
||||
// This Software is subject to the terms of the XMOS Public Licence: Version 1.
|
||||
#ifndef __hid_report_descriptor_h__
|
||||
#define __hid_report_descriptor_h__
|
||||
|
||||
#include "xua_hid_report.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__
|
||||
@@ -1,4 +1,5 @@
|
||||
// Copyright (c) 2016-2019, XMOS Ltd, All rights reserved
|
||||
// Copyright 2016-2021 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,9 +78,7 @@ 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 */
|
||||
in 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 */
|
||||
@@ -205,34 +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
|
||||
{
|
||||
par
|
||||
{
|
||||
XUA_AudioHub(c_out, p_mclk_in);
|
||||
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;
|
||||
}
|
||||
@@ -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 SIMULATION
|
||||
|
||||
#include <platform.h>
|
||||
@@ -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__
|
||||
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
@@ -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
|
||||
@@ -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_
|
||||
|
||||
@@ -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_
|
||||
|
||||
@@ -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"
|
||||
@@ -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__
|
||||
|
||||
@@ -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>
|
||||
@@ -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__
|
||||
@@ -1,5 +1,6 @@
|
||||
#!/usr/bin/env python2.7
|
||||
# Copyright (c) 2018-2019, XMOS Ltd, All rights reserved
|
||||
# Copyright 2018-2021 XMOS LIMITED.
|
||||
# This Software is subject to the terms of the XMOS Public Licence: Version 1.
|
||||
import xmostest
|
||||
import os.path
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
#!/usr/bin/env python
|
||||
# Copyright (c) 2018-2019, XMOS Ltd, All rights reserved
|
||||
# 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
5
lib_xua/.gitignore
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
.cproject
|
||||
.makefile
|
||||
.project
|
||||
.settings
|
||||
.xproject
|
||||
8
lib_xua/.makefile
Normal file
8
lib_xua/.makefile
Normal 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
84
lib_xua/LICENSE.rst
Normal 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 doesn’t 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 XMOS’s 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 XMOS’s 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.
|
||||
@@ -1,135 +0,0 @@
|
||||
Software Release License Agreement
|
||||
|
||||
Copyright (c) 2017-2020, 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
|
||||
@@ -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
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
// Copyright (c) 2011-2019, 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_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,26 +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 p_mclk_in Master clock port
|
||||
* \param c_dig channel connected to the clockGen() thread for
|
||||
* receiving/transmitting samples
|
||||
* \param c_config An optional channel that will be passed on to the
|
||||
* CODEC configuration functions.
|
||||
* \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
|
||||
, in port p_mclk_in
|
||||
#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
|
||||
);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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.
|
||||
/*
|
||||
* @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)
|
||||
*/
|
||||
@@ -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
|
||||
|
||||
/**
|
||||
@@ -1164,6 +1172,10 @@
|
||||
#endif
|
||||
|
||||
|
||||
#if (defined(UAC_FORCE_FEEDBACK_EP) && UAC_FORCE_FEEDBACK_EP == 0)
|
||||
#undef UAC_FORCE_FEEDBACK_EP
|
||||
#endif
|
||||
|
||||
#ifndef __ASSEMBLER__
|
||||
/* Endpoint addresses enums */
|
||||
enum USBEndpointNumber_In
|
||||
@@ -1173,13 +1185,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
|
||||
@@ -1232,10 +1244,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 +1259,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 +1452,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 +1469,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
|
||||
|
||||
@@ -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_CONF_FULL_H__
|
||||
#define __XUA_CONF_FULL_H__
|
||||
|
||||
@@ -8,4 +9,6 @@
|
||||
|
||||
#include "xua_conf_default.h"
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,7 +1,13 @@
|
||||
// Copyright (c) 2015-2019, 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);
|
||||
|
||||
@@ -15,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
|
||||
@@ -36,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 xua_pdm_mic(streaming chanend c_ds_output[2], buffered in port:32 p_pdm_mics);
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
19
lib_xua/api/xua_usb_params_funcs.h
Normal file
19
lib_xua/api/xua_usb_params_funcs.h
Normal 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
1
lib_xua/doc/.gitignore
vendored
@@ -1,2 +1 @@
|
||||
rst/_build
|
||||
pdf
|
||||
|
||||
BIN
lib_xua/doc/pdf/index.pdf
Normal file
BIN
lib_xua/doc/pdf/index.pdf
Normal file
Binary file not shown.
1
lib_xua/doc/rst/.gitignore
vendored
Normal file
1
lib_xua/doc/rst/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
_build
|
||||
117
lib_xua/doc/rst/feat.rst
Normal file
117
lib_xua/doc/rst/feat.rst
Normal 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
62
lib_xua/doc/rst/hw.rst
Normal 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|
|
||||
|
||||
BIN
lib_xua/doc/rst/images/pdm_chan4.pdf
Normal file
BIN
lib_xua/doc/rst/images/pdm_chan4.pdf
Normal file
Binary file not shown.
BIN
lib_xua/doc/rst/images/pdm_chan8.pdf
Normal file
BIN
lib_xua/doc/rst/images/pdm_chan8.pdf
Normal file
Binary file not shown.
BIN
lib_xua/doc/rst/images/port_config.pdf
Executable file
BIN
lib_xua/doc/rst/images/port_config.pdf
Executable file
Binary file not shown.
BIN
lib_xua/doc/rst/images/port_config.png
Normal file
BIN
lib_xua/doc/rst/images/port_config.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
1319
lib_xua/doc/rst/images/spdif.pdf
Executable file
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
BIN
lib_xua/doc/rst/images/spdif.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 6.2 KiB |
489
lib_xua/doc/rst/images/threads-crop.pdf
Executable file
489
lib_xua/doc/rst/images/threads-crop.pdf
Executable file
File diff suppressed because one or more lines are too long
BIN
lib_xua/doc/rst/images/threads-crop.png
Executable file
BIN
lib_xua/doc/rst/images/threads-crop.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 29 KiB |
@@ -2,21 +2,38 @@
|
||||
.. include:: ../../../README.rst
|
||||
|
||||
|
||||
==============
|
||||
XMOS USB Audio
|
||||
==============
|
||||
About This Document
|
||||
-------------------
|
||||
|
||||
This document details the XMOS USB Audio Library. This library
|
||||
enables the development of USB Audio devices on the XMOS xCORE architecture.
|
||||
This document describes the structure of the library, its use and resources required. It also covers some implementation detail.
|
||||
|
||||
This document describes the structure of the library, its basic use
|
||||
and resources required.
|
||||
|
||||
This document assumes familiarity with the XMOS xCORE architecture, the
|
||||
Universal Serial Bus 2.0 Specification (and related specifications),
|
||||
This document assumes familiarity with the XMOS xCORE architecture, the Universal Serial Bus 2.0 Specification (and related specifications),
|
||||
the XMOS tool chain and XC language.
|
||||
|
||||
Known Issues
|
||||
============
|
||||
|
||||
Host System Requirements
|
||||
------------------------
|
||||
|
||||
USB Audio devices built using `lib_xua` have the following host system requirements.
|
||||
|
||||
- Mac OSX version 10.6 or later
|
||||
|
||||
- Windows Vista, 7, 8 or 10 with Thesycon Audio Class 2.0 driver for Windows (Tested against version 3.20). Please contact XMOS for details.
|
||||
|
||||
- Windows Vista, 7, 8 or 10 with built-in USB Audio Class 1.0 driver.
|
||||
|
||||
Older versions of Windows are not guaranteed to operate as expected. Devices are also expected to operate with various Linux distributions including mobile variants.
|
||||
|
||||
.. toctree::
|
||||
|
||||
Overview <overview>
|
||||
Hardware Platforms <hw>
|
||||
Software Overview <sw>
|
||||
Using lib_xua <using>
|
||||
Features <feat>
|
||||
Software Detail <sw_detail>
|
||||
Known Issues <issues>
|
||||
|
||||
|
||||
|
||||
.. include:: ../../../CHANGELOG.rst
|
||||
|
||||
20
lib_xua/doc/rst/issues.rst
Normal file
20
lib_xua/doc/rst/issues.rst
Normal file
@@ -0,0 +1,20 @@
|
||||
|appendix|
|
||||
|
||||
Known Issues
|
||||
------------
|
||||
|
||||
- Quad-SPI DFU will corrupt the factory image with tools version < 14.0.4 due to an issue with libquadflash
|
||||
|
||||
- (#14762) When in DSD mode with S/PDIF output enabled, DSD samples are transmitted over S/PDIF if the DSD and S/PDIF channels are shared, this may or may not be desired
|
||||
|
||||
- (#14173) I2S input is completely disabled when DSD output is active - any input stream to the host will contain 0 samples
|
||||
|
||||
- (#14780) Operating the design at a sample rate of less than or equal to the SOF rate (i.e. 8kHz at HS, 1kHz at FS) may expose a corner case relating to 0 length packet handling in both the driver and device and should be considered un-supported at this time.
|
||||
|
||||
- (#14883) Before DoP mode is detected a small number of DSD samples will be played out as PCM via I2S
|
||||
|
||||
- (#14887) Volume control settings currently affect samples in both DSD and PCM modes. This results in invalid DSD output if volume control not set to 0
|
||||
|
||||
- Windows XP volume control very sensitive. The Audio 1.0 driver built into Windows XP (usbaudio.sys) does not properly support master volume AND channel volume controls, leading to a very sensitive control. Descriptors can be easily modified to disable master volume control if required (one byte - bmaControls(0) in Feature Unit descriptors)
|
||||
|
||||
- 88.2kHz and 176.4kHz sample frequencies are not exposed in Windows control panels. These are known OS restrictions.
|
||||
77
lib_xua/doc/rst/overview.rst
Normal file
77
lib_xua/doc/rst/overview.rst
Normal file
@@ -0,0 +1,77 @@
|
||||
USB Audio Solution Overview
|
||||
---------------------------
|
||||
|
||||
|
||||
.. table::
|
||||
:class: vertical-borders
|
||||
|
||||
+-------------------------------------------------------------------------------------------------------------------------------+
|
||||
| **Functionality** |
|
||||
+-------------------------------------------------------------------------------------------------------------------------------+
|
||||
+-------------------------------------------------------------------------------------------------------------------------------+
|
||||
| Provides USB interface to audio I/O. |
|
||||
| |
|
||||
+-------------------------------------------------------------------------------------------------------------------------------+
|
||||
+-------------------------------------------------------------------------------------------------------------------------------+
|
||||
| **Supported Standards** |
|
||||
+-------------------------------------------------------------------------------------------------------------------------------+
|
||||
+---------------------------------+---------------------------------------------------------------------------------------------+
|
||||
| USB | USB 2.0 (Full-speed and High-speed) |
|
||||
| +---------------------------------------------------------------------------------------------+
|
||||
| | `USB Audio Class 1.0 <http://www.usb.org/developers/devclass_docs/audio10.pdf>`_ |
|
||||
| +---------------------------------------------------------------------------------------------+
|
||||
| | `USB Audio Class 2.0 <http://www.usb.org/developers/devclass_docs/Audio2.0_final.zip>`_ |
|
||||
| +---------------------------------------------------------------------------------------------+
|
||||
| | `USB Firmware Upgrade (DFU) 1.1 <http://www.usb.org/developers/devclass_docs/DFU_1.1.pdf>`_ |
|
||||
| +---------------------------------------------------------------------------------------------+
|
||||
| | `USB Midi Device Class 1.0 <http://www.usb.org/developers/devclass_docs/midi10.pdf>`_ |
|
||||
+---------------------------------+---------------------------------------------------------------------------------------------+
|
||||
| Audio | I2S/TDM |
|
||||
| +---------------------------------------------------------------------------------------------+
|
||||
| | S/PDIF |
|
||||
| +---------------------------------------------------------------------------------------------+
|
||||
| | ADAT |
|
||||
| +---------------------------------------------------------------------------------------------+
|
||||
| | Direct Stream Digital (DSD) |
|
||||
| +---------------------------------------------------------------------------------------------+
|
||||
| | PDM Microphones |
|
||||
| +---------------------------------------------------------------------------------------------+
|
||||
| | MIDI |
|
||||
+---------------------------------+---------------------------------------------------------------------------------------------+
|
||||
+-------------------------------------------------------------------------------------------------------------------------------+
|
||||
| **Supported Sample Frequencies** |
|
||||
+-------------------------------------------------------------------------------------------------------------------------------+
|
||||
+-------------------------------------------------------------------------------------------------------------------------------+
|
||||
| 44.1kHz, 48kHz, 88.2kHz, 96kHz, 176.4kHz, 192kHz, 352.8kHz, 384kHz |
|
||||
+-------------------------------------------------------------------------------------------------------------------------------+
|
||||
+-------------------------------------------------------------------------------------------------------------------------------+
|
||||
| **Supported Devices** |
|
||||
+-------------------------------------------------------------------------------------------------------------------------------+
|
||||
+---------------------------------+---------------------------------------------------------------------------------------------+
|
||||
| XMOS Devices | xCORE-200 Series |
|
||||
+---------------------------------+---------------------------------------------------------------------------------------------+
|
||||
+-------------------------------------------------------------------------------------------------------------------------------+
|
||||
| **Requirements** |
|
||||
+-------------------------------------------------------------------------------------------------------------------------------+
|
||||
+---------------------------------+---------------------------------------------------------------------------------------------+
|
||||
| Development Tools | xTIMEcomposer Development Tools v14 or later |
|
||||
+---------------------------------+---------------------------------------------------------------------------------------------+
|
||||
| USB | xCORE-200 Series device with integrated USB Phy |
|
||||
+---------------------------------+---------------------------------------------------------------------------------------------+
|
||||
| Audio | External audio DAC/ADC/CODECs (and required supporting componentry) supporting I2S/TDM |
|
||||
+---------------------------------+---------------------------------------------------------------------------------------------+
|
||||
| Boot/Storage | Compatible SPI Flash device (or xCORE-200 device with internal flash) |
|
||||
+---------------------------------+---------------------------------------------------------------------------------------------+
|
||||
+-------------------------------------------------------------------------------------------------------------------------------+
|
||||
| **Licensing and Support** |
|
||||
+-------------------------------------------------------------------------------------------------------------------------------+
|
||||
+-------------------------------------------------------------------------------------------------------------------------------+
|
||||
| Reference code provided without charge under license from XMOS. |
|
||||
+-------------------------------------------------------------------------------------------------------------------------------+
|
||||
| Please visit http://www.xmos.com/support/contact for support. |
|
||||
+-------------------------------------------------------------------------------------------------------------------------------+
|
||||
| Reference code is maintained by XMOS Limited. |
|
||||
+-------------------------------------------------------------------------------------------------------------------------------+
|
||||
|
||||
|
||||
|
||||
89
lib_xua/doc/rst/sw.rst
Normal file
89
lib_xua/doc/rst/sw.rst
Normal file
@@ -0,0 +1,89 @@
|
||||
|
||||
.. _usb_audio_sec_architecture:
|
||||
|
||||
USB Audio Software Overview
|
||||
---------------------------
|
||||
|
||||
This section describes the software architecture of a USB Audio device implemented using `lib_xua`, its dependencies and other supporting libraries.
|
||||
|
||||
`lib_xua` provides fundamental building blocks for producing USB Audio products on XMOS devices. Every system is required to have the components from `lib_xua` listed in :ref:`usb_audio_shared_components`.
|
||||
|
||||
.. _usb_audio_shared_components:
|
||||
|
||||
.. list-table:: Required XUA Components
|
||||
:header-rows: 1
|
||||
:widths: 40 60
|
||||
|
||||
* - Component
|
||||
- Description
|
||||
* - Endpoint 0
|
||||
- Provides the logic for Endpoint 0 which handles
|
||||
enumeration and control of the device including DFU related requests.
|
||||
* - Endpoint buffer
|
||||
- Buffers endpoint data packets to and from the host. Manages delivery of audio packets between the endpoint buffer
|
||||
component and the audio components. It can also handle volume control processing.Note, this currently utlises two cores
|
||||
* - AudioHub
|
||||
- Handles audio I/O over I2S and manages audio data
|
||||
to/from other digital audio I/O components.
|
||||
|
||||
In addition low-level USB I/0 is required and is provided by the external dependency `lib_xud`
|
||||
|
||||
.. list-table:: Additional Components Required
|
||||
:header-rows: 1
|
||||
:widths: 100 60
|
||||
|
||||
* - Component
|
||||
- Description
|
||||
* - XMOS USB Device Driver (XUD)
|
||||
- Handles the low level USB I/O.
|
||||
|
||||
In addition :ref:`usb_audio_optional_components` shows optional components that can be added/enabled from within `lib_xua`
|
||||
|
||||
.. _usb_audio_optional_components:
|
||||
|
||||
.. list-table:: Optional Components
|
||||
:header-rows: 1
|
||||
:widths: 40 60
|
||||
|
||||
* - Component
|
||||
- Description
|
||||
* - Mixer
|
||||
- Allows digital mixing of input and output channels. It can also
|
||||
handle volume control instead of the decoupler.
|
||||
* - Clockgen
|
||||
- Drives an external frequency generator (PLL) and manages
|
||||
changes between internal clocks and external clocks arising
|
||||
from digital input.
|
||||
* - MIDI
|
||||
- Outputs and inputs MIDI over a serial UART interface.
|
||||
|
||||
`lib_xua` also provides optional support for integrating with the following eternal dependencies:
|
||||
|
||||
.. list-table:: Optional Components
|
||||
:header-rows: 1
|
||||
:widths: 40 60
|
||||
|
||||
* - Component
|
||||
- Description
|
||||
* - S/PDIF Transmitter (lib_spdif)
|
||||
- Outputs samples of an S/PDIF digital audio interface.
|
||||
* - S/PDIF Receiver (lib_spdif)
|
||||
- Inputs samples of an S/PDIF digital audio interface (requires the
|
||||
clockgen component).
|
||||
* - ADAT Receiver (lib_adat)
|
||||
- Inputs samples of an ADAT digital audio interface (requires the
|
||||
clockgen component).
|
||||
* - PDM Microphones (lib_mic_array)
|
||||
- Receives PDM data from microphones and performs PDM to PCM conversion
|
||||
|
||||
.. _usb_audio_threads:
|
||||
|
||||
.. figure:: images/threads-crop.*
|
||||
:width: 100%
|
||||
|
||||
USB Audio Core Diagram
|
||||
|
||||
:ref:`usb_audio_threads` shows how the components interact with each
|
||||
other in a typical system. The green circles represent cores with arrows indicating inter-core communications.
|
||||
|
||||
|
||||
54
lib_xua/doc/rst/sw_adat.rst
Normal file
54
lib_xua/doc/rst/sw_adat.rst
Normal file
@@ -0,0 +1,54 @@
|
||||
ADAT Receive
|
||||
------------
|
||||
|
||||
The ADAT receive component receives up to eight channels of audio at a sample rate
|
||||
of 44.1kHz or 48kHz. The API for calling the receiver functions is
|
||||
described in :ref:`usb_audio_sec_component_api`.
|
||||
|
||||
The component outputs 32 bits words split into nine word frames. The
|
||||
frames are laid out in the following manner:
|
||||
|
||||
* Control byte
|
||||
* Channel 0 sample
|
||||
* Channel 1 sample
|
||||
* Channel 2 sample
|
||||
* Channel 3 sample
|
||||
* Channel 4 sample
|
||||
* Channel 5 sample
|
||||
* Channel 6 sample
|
||||
* Channel 7 sample
|
||||
|
||||
Example of code show how to read the output of the ADAT component is shown below::
|
||||
|
||||
control = inuint(oChan);
|
||||
|
||||
for(int i = 0; i < 8; i++)
|
||||
{
|
||||
sample[i] = inuint(oChan);
|
||||
}
|
||||
|
||||
Samples are 24-bit values contained in the lower 24 bits of the word.
|
||||
|
||||
The control word comprises four control bits in bits [11..8] and the value 0b00000001 in bits [7..0].
|
||||
This control word enables synchronization at a higher level, in that on the channel a single odd
|
||||
word is always read followed by eight words of data.
|
||||
|
||||
.. Timing Requirements
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. The data samples are outputted onto the channel every 2.4 us. The
|
||||
.. control sample follows 1.7 us after the last data sample, and is
|
||||
.. followed 2.4 us later by the first data sample. Given that a channel
|
||||
.. can hold two words of data, when data appears on the channel, it
|
||||
.. should be input within 4.1 us otherwise the ADAT receiver will block,
|
||||
.. and data will be lost. Between data samples a window of 4.8 us is
|
||||
.. available.
|
||||
|
||||
Integration
|
||||
~~~~~~~~~~~
|
||||
|
||||
Since the ADAT is a digital stream the devices master clock must synchronised to it. This is
|
||||
typically achieved with an external fractional-n clock multiplier.
|
||||
|
||||
The ADAT receive function communicates with the clockGen component which passes audio data onto the
|
||||
audio driver and handles locking to the ADAT clock source if required.
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user