Compare commits
584 commits
pi_rev1_i2
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2364d94be2 | ||
|
|
c395d84ca3 | ||
|
|
1dae37baa3 | ||
|
|
2572f684e6 | ||
|
|
cf7aecda03 | ||
|
|
5b7c6d66a8 | ||
|
|
a3ae13407a | ||
|
|
8273fc647a | ||
|
|
568c30950b | ||
|
|
0849361858 | ||
|
|
68ddeb18d3 | ||
|
|
8e86ab591f | ||
|
|
35311d8f41 | ||
|
|
e322c4735a | ||
|
|
540ca76e59 | ||
|
|
a89095cf1f | ||
|
|
89ef03ef43 | ||
|
|
1a0457524e | ||
|
|
3d56974939 | ||
|
|
b8231c8307 | ||
|
|
3b57f98703 | ||
|
|
bb34ccd22c | ||
|
|
82a94cd5ba | ||
|
|
084beca285 | ||
|
|
d07e69b47c | ||
|
|
36d7ba682b | ||
|
|
41de8f0b02 | ||
|
|
b5c2c19322 | ||
|
|
6c82519435 | ||
|
|
1639b90c94 | ||
|
|
9a2678c8a2 | ||
|
|
1775ade3bf | ||
|
|
fd6b194d47 | ||
|
|
1a7e2819f8 | ||
|
|
bd1cf31128 | ||
|
|
72d4f20a19 | ||
|
|
8137d6f95a | ||
|
|
67df25c8ff | ||
|
|
e068d9bae4 | ||
|
|
bb0f4840e3 | ||
|
|
344f7b9808 | ||
|
|
76c093908d | ||
|
|
ec2711421f | ||
|
|
08d7ada8f6 | ||
|
|
5b7de464ad | ||
|
|
3b1ab02a14 | ||
|
|
7e059ba8dc | ||
|
|
122bbedb8b | ||
|
|
85132dc280 | ||
|
|
3588271b3a | ||
|
|
b5919dcf36 | ||
|
|
dcfb0393ba | ||
|
|
bdd86c7e4f | ||
|
|
021b4e28a4 | ||
|
|
dca4937cad | ||
|
|
11d2b8cca3 | ||
|
|
48a8b0cfe0 | ||
|
|
e5b92aa5a7 | ||
|
|
c4519b174b | ||
|
|
222e7b7517 | ||
|
|
b6c24fde44 | ||
|
|
294537307c | ||
|
|
d53b0510d4 | ||
|
|
15891fa3df | ||
|
|
b140479315 | ||
|
|
c7717c16ea | ||
|
|
7acbef54fa | ||
|
|
75ee720cb2 | ||
|
|
16e37ce651 | ||
|
|
4305b552ea | ||
|
|
a8bd55cc42 | ||
|
|
ab388f5533 | ||
|
|
43c1b03bba | ||
|
|
510aedeac6 | ||
|
|
b668b5c9a2 | ||
|
|
c9f3456d10 | ||
|
|
a125f690ad | ||
|
|
ff230422c7 | ||
|
|
403d322054 | ||
|
|
77cdce0bc6 | ||
|
|
0bc5711e69 | ||
|
|
98f22066ba | ||
|
|
b901c0161f | ||
|
|
e8e5f2752a | ||
|
|
ae22d0b266 | ||
|
|
888b41c53a | ||
|
|
44a5eff6d0 | ||
|
|
e812739ff6 | ||
|
|
d2e5f1c73d | ||
|
|
283f57c033 | ||
|
|
bd66d6f572 | ||
|
|
29f7058916 | ||
|
|
0b13559157 | ||
|
|
346f0b0713 | ||
|
|
c8d79678f1 | ||
|
|
49d059eeb6 | ||
|
|
cb2ad665e3 | ||
|
|
fa80f7d2ef | ||
|
|
ec8239878f | ||
|
|
de082d32a6 | ||
|
|
7f741786de | ||
|
|
6c6e58152c | ||
|
|
f8a13c038c | ||
|
|
d63da131bc | ||
|
|
623bb42818 | ||
|
|
8a75cddf1b | ||
|
|
df5e872de6 | ||
|
|
de652f72b1 | ||
|
|
d2e478aaa0 | ||
|
|
644968a5e7 | ||
|
|
ad7c0ada00 | ||
|
|
f783eaa220 | ||
|
|
52ed0be9ab | ||
|
|
19e15050e2 | ||
|
|
8a3f42530b | ||
|
|
e2bf5f8c78 | ||
|
|
e30741d369 | ||
|
|
1f00f20cf6 | ||
|
|
903af5f46a | ||
|
|
ce2c5ad1e0 | ||
|
|
a0a6151d40 | ||
|
|
750aa0f1b4 | ||
|
|
1c7e433546 | ||
|
|
df96dea96e | ||
|
|
ad309deabe | ||
|
|
a6b34f7666 | ||
|
|
5189fd3e50 | ||
|
|
6a80505216 | ||
|
|
21cee0d1ec | ||
|
|
802860668b | ||
|
|
71bf7896ed | ||
|
|
cd909fb3d1 | ||
|
|
62062074a5 | ||
|
|
d581f608ce | ||
|
|
f73c450270 | ||
|
|
0ab99d44db | ||
|
|
5622ff8da7 | ||
|
|
6db3142005 | ||
|
|
0ed2c1b09e | ||
|
|
18bc57adc6 | ||
|
|
8072ee88e2 | ||
|
|
f5efceca66 | ||
|
|
8f24038e8a | ||
|
|
2381e9f34d | ||
|
|
35751fe3f3 | ||
|
|
fb3a7c52bc | ||
|
|
5346e2eeee | ||
|
|
f03eb7b98d | ||
|
|
b64fb9de3d | ||
|
|
bb8f8b71f4 | ||
|
|
f96e673beb | ||
|
|
aa859c73e2 | ||
|
|
6d1bf89081 | ||
|
|
61d0fc3e10 | ||
|
|
98f4a43784 | ||
|
|
f3bc592818 | ||
|
|
3f6a2b8d75 | ||
|
|
63577fd6b7 | ||
|
|
8ad7245903 | ||
|
|
ce21899a15 | ||
|
|
85fcfc9f69 | ||
|
|
539962c4c3 | ||
|
|
079c1515b8 | ||
|
|
eb3e8b6ba7 | ||
|
|
80a2f37a06 | ||
|
|
a3770186a9 | ||
|
|
82ffe24730 | ||
|
|
d08345657d | ||
|
|
a79e37b272 | ||
|
|
85e40fd98d | ||
|
|
c2eda22067 | ||
|
|
7f5891e146 | ||
|
|
9ba370bd6d | ||
|
|
0548bc42eb | ||
|
|
bce35dbe37 | ||
|
|
aa64c74fd9 | ||
|
|
90390bc7eb | ||
|
|
9e3e74b111 | ||
|
|
1e22972224 | ||
|
|
c7e3b1b74d | ||
|
|
51df1333e1 | ||
|
|
9f54be1eed | ||
|
|
9e870e0ecb | ||
|
|
2bb7cbf33c | ||
|
|
a902c58e07 | ||
|
|
7170cfb4b8 | ||
|
|
770e016ef7 | ||
|
|
3efa2cadf0 | ||
|
|
d7d53b105d | ||
|
|
b00aa958d4 | ||
|
|
1aed617dd2 | ||
|
|
e32430db5b | ||
|
|
dc7dc8d494 | ||
|
|
53235694da | ||
|
|
be0bb1456b | ||
|
|
1427ab7f50 | ||
|
|
838b5e223f | ||
|
|
5c3bee52b3 | ||
|
|
70b891367f | ||
|
|
62e559d1f5 | ||
|
|
c2d0c076eb | ||
|
|
2aa8db3251 | ||
|
|
4777de8330 | ||
|
|
3e2e9b6def | ||
|
|
aa7b754969 | ||
|
|
fc9f166f3d | ||
|
|
0f7431224c | ||
|
|
bd7b612b3f | ||
|
|
b5c457265c | ||
|
|
f5a8e6d89f | ||
|
|
f5900b8595 | ||
|
|
a71e2db31b | ||
|
|
3404422093 | ||
|
|
5729000108 | ||
|
|
a2a3e0abcb | ||
|
|
c723c064ab | ||
|
|
0162c2e0b5 | ||
|
|
cedbfbb6ce | ||
|
|
2f5223f400 | ||
|
|
e009837d76 | ||
|
|
e7d49e4694 | ||
|
|
1e8ffdb01b | ||
|
|
f1fc945c2c | ||
|
|
cba0d7c7df | ||
|
|
11a1aa9404 | ||
|
|
35579e2e78 | ||
|
|
f8cfb17611 | ||
|
|
3315db0995 | ||
|
|
35b21e53ac | ||
|
|
7fef76c707 | ||
|
|
26ae921894 | ||
|
|
296c710426 | ||
|
|
017545698d | ||
|
|
1fd47d6bae | ||
|
|
185317b1ae | ||
|
|
cffea8ba1d | ||
|
|
0b2acaef6b | ||
|
|
e2a087d9b1 | ||
|
|
d9b23f5e50 | ||
|
|
1c6cd98137 | ||
|
|
2dd005fc67 | ||
|
|
47a2c58696 | ||
|
|
3375e0d4fe | ||
|
|
12b3e038ff | ||
|
|
c2997be92c | ||
|
|
ff954c5a6e | ||
|
|
f829cd29db | ||
|
|
93494ec17f | ||
|
|
a774d91cac | ||
|
|
104bf0c9e9 | ||
|
|
0247ac4c6e | ||
|
|
3339c0ad51 | ||
|
|
86cf635264 | ||
|
|
cbe6edb276 | ||
|
|
9a882d0125 | ||
|
|
9bbe1795fb | ||
|
|
b5d5219e93 | ||
|
|
9974b969b2 | ||
|
|
a0f6cbc4e7 | ||
|
|
92f204a2a6 | ||
|
|
acce5df66d | ||
|
|
fa382db0f1 | ||
|
|
029237ed31 | ||
|
|
01b2c25ee1 | ||
|
|
6f90e8bf17 | ||
|
|
8c5b643fca | ||
|
|
0c03ed70fa | ||
|
|
7aba6e53dc | ||
|
|
db6967806d | ||
|
|
9cfdf08bd5 | ||
|
|
22dc03d4ea | ||
|
|
3f9a3c8429 | ||
|
|
82ff2f40b5 | ||
|
|
acd42dc865 | ||
|
|
31ce09daee | ||
|
|
1eb4048cf6 | ||
|
|
e80aa09fdb | ||
|
|
fbee79f774 | ||
|
|
94b8f61cb2 | ||
|
|
beee1735fc | ||
|
|
5c0c8e17aa | ||
|
|
3306ddab1a | ||
|
|
df3fdc7b5c | ||
|
|
45448a15aa | ||
|
|
09ef935976 | ||
|
|
599f21f375 | ||
|
|
4f258c680c | ||
|
|
540bc6828f | ||
|
|
2b3753b9e5 | ||
|
|
8b62f3a780 | ||
|
|
cac0d65a5a | ||
|
|
c9773de558 | ||
|
|
32f25f5a75 | ||
|
|
d9b60d51d9 | ||
|
|
d01c3ff0c9 | ||
|
|
ef6cc4fb46 | ||
|
|
3d560dbd63 | ||
|
|
b37fca8bab | ||
|
|
d0f634a400 | ||
|
|
0deaef8349 | ||
|
|
6ebd41ca7f | ||
|
|
444e463111 | ||
|
|
c447548b55 | ||
|
|
dbdceb69b0 | ||
|
|
612427cab1 | ||
|
|
b7889ed694 | ||
|
|
069a670a4c | ||
|
|
887665d34a | ||
|
|
1a8f73f1ae | ||
|
|
76728de104 | ||
|
|
102ba2251d | ||
|
|
77aca4cf9e | ||
|
|
021c1242f9 | ||
|
|
c72b2913f8 | ||
|
|
449de22b8a | ||
|
|
4376a296bd | ||
|
|
0926764617 | ||
|
|
c228c4a5d5 | ||
|
|
56a6f4cba2 | ||
|
|
e3d5915646 | ||
|
|
44e8428184 | ||
|
|
94a57801c1 | ||
|
|
be55fe4c51 | ||
|
|
f813f1ef2d | ||
|
|
4df933191e | ||
|
|
ffd3c408c9 | ||
|
|
a6837a9dad | ||
|
|
990be458b9 | ||
|
|
9584ded68b | ||
|
|
28f9b9ec68 | ||
|
|
76cf829673 | ||
|
|
de61c37283 | ||
|
|
76c0534aa7 | ||
|
|
ff4752dfb4 | ||
|
|
881b18508a | ||
|
|
75639a87c5 | ||
|
|
c0b17665b1 | ||
|
|
a8662a122f | ||
|
|
f3a8911346 | ||
|
|
d9920ff157 | ||
|
|
76ebb04b49 | ||
|
|
08c09ff9d4 | ||
|
|
dfc9078e35 | ||
|
|
f41e4ffee1 | ||
|
|
a4185d6881 | ||
|
|
3b0f167719 | ||
|
|
f66f0884c2 | ||
|
|
65ce2c9ee4 | ||
|
|
1e9d6aaced | ||
|
|
8ab94af6ad | ||
|
|
82eaa9922d | ||
|
|
3395c53b23 | ||
|
|
d6f98c20c8 | ||
|
|
2e04dd7db9 | ||
|
|
7f1793b45c | ||
|
|
2b4662736a | ||
|
|
c12a47fcd8 | ||
|
|
a3be941f77 | ||
|
|
240cf176db | ||
|
|
b3f89e9439 | ||
|
|
99269b02e2 | ||
|
|
ca39fe22c8 | ||
|
|
fff2c1191a | ||
|
|
3172479ec8 | ||
|
|
be4461beb4 | ||
|
|
738d6d910c | ||
|
|
e89ea27c8b | ||
|
|
bffc7f4883 | ||
|
|
23217b2b16 | ||
|
|
43e5a7eebb | ||
|
|
5d1689e965 | ||
|
|
b6048fa532 | ||
|
|
8f602e5050 | ||
|
|
a445da57a7 | ||
|
|
935bd66a7b | ||
|
|
8009b93320 | ||
|
|
61fc643d64 | ||
|
|
5c0fd36804 | ||
|
|
c15c344e74 | ||
|
|
5732569ec9 | ||
|
|
8710bd63a4 | ||
|
|
b8ddd303bf | ||
|
|
6f36409bfa | ||
|
|
1b1794b488 | ||
|
|
bf74dc0324 | ||
|
|
2c6d236a71 | ||
|
|
5634db4de7 | ||
|
|
4825537d3e | ||
|
|
7c00bb4d52 | ||
|
|
8a4686cbc7 | ||
|
|
87673ef187 | ||
|
|
cf07b4274f | ||
|
|
76ca3e6a3c | ||
|
|
d573afb20d | ||
|
|
65a43f8930 | ||
|
|
824d525493 | ||
|
|
cc3f8eccf2 | ||
|
|
1198b4bab3 | ||
|
|
24371e8c6b | ||
|
|
d77877bbb8 | ||
|
|
8e938ca344 | ||
|
|
cbaee77564 | ||
|
|
92493840e9 | ||
|
|
b512639955 | ||
|
|
150f00e4e6 | ||
|
|
81993c470d | ||
|
|
b148cfd0ca | ||
|
|
bf49679028 | ||
|
|
10b0b4094a | ||
|
|
36a01e28d2 | ||
|
|
40e172cb06 | ||
|
|
2146f116d5 | ||
|
|
ecba441c03 | ||
|
|
93f393a931 | ||
|
|
cb1be808d6 | ||
|
|
d01f39b87d | ||
|
|
e9a8350d95 | ||
|
|
05efa3b9e3 | ||
|
|
2660fec711 | ||
|
|
49b6feff70 | ||
|
|
2852c836b8 | ||
|
|
657b7f0781 | ||
|
|
d5c115ba24 | ||
|
|
a322e55fdb | ||
|
|
fafe6bc929 | ||
|
|
83696cab4a | ||
|
|
0a8ed0be0f | ||
|
|
f454d3a956 | ||
|
|
b9413fc299 | ||
|
|
1b2ea6f955 | ||
|
|
ce4be6a395 | ||
|
|
12a576f51b | ||
|
|
5189e2d75d | ||
|
|
8f13ca9766 | ||
|
|
fe2e855197 | ||
|
|
c4584b6146 | ||
|
|
aaa44944ff | ||
|
|
e7f1835cfa | ||
|
|
d70ea3bf4d | ||
|
|
0cb9e9b989 | ||
|
|
d29e815f8a | ||
|
|
9c964de681 | ||
|
|
2fd866e9f2 | ||
|
|
a16a662e6f | ||
|
|
34848455e4 | ||
|
|
5ea80f2276 | ||
|
|
41e943ab29 | ||
|
|
f0069bad6b | ||
|
|
a1630f67d3 | ||
|
|
7e80afdafb | ||
|
|
e74f5cd9dd | ||
|
|
05b9efc122 | ||
|
|
6558bfd141 | ||
|
|
a00f734e8d | ||
|
|
2a77f95745 | ||
|
|
0e2dc89dc9 | ||
|
|
159dfdf5dc | ||
|
|
ec5c8562f5 | ||
|
|
54bbb49af6 | ||
|
|
9b432b0734 | ||
|
|
641a3ddb81 | ||
|
|
672c3c9b02 | ||
|
|
b650fd0ef7 | ||
|
|
134de36517 | ||
|
|
75c6520992 | ||
|
|
9eefb44141 | ||
|
|
99ca49e38e | ||
|
|
e44c78efb8 | ||
|
|
a7bcbc4bc8 | ||
|
|
a25d8090c8 | ||
|
|
fd244650a0 | ||
|
|
d8ae080562 | ||
|
|
44b924f726 | ||
|
|
6c1002e28a | ||
|
|
2b20109539 | ||
|
|
48f5328f9f | ||
|
|
53959329dd | ||
|
|
ff45bec4c6 | ||
|
|
40d5678000 | ||
|
|
f02d248811 | ||
|
|
22277bfa78 | ||
|
|
3395c82189 | ||
|
|
a71eed7406 | ||
|
|
d256bff874 | ||
|
|
7518159b47 | ||
|
|
d21a7c54ef | ||
|
|
dce152a287 | ||
|
|
ba7ff5ed3d | ||
|
|
3e3bb11471 | ||
|
|
3678f1e186 | ||
|
|
64b83c2f5a | ||
|
|
310cae1bc3 | ||
|
|
8a62a97b54 | ||
|
|
f26df231ba | ||
|
|
0de62bd1a6 | ||
|
|
61d13d919e | ||
|
|
6c3b6d116a | ||
|
|
b781b3d304 | ||
|
|
7a1bd2ff2d | ||
|
|
f24cd41e8d | ||
|
|
e3dc1b9e23 | ||
|
|
5f2c3fb5ad | ||
|
|
1835dbc434 | ||
|
|
9691d8101f | ||
|
|
8fe9bc8bda | ||
|
|
9c06591f47 | ||
|
|
b8336372c7 | ||
|
|
d3e13f5511 | ||
|
|
0591c8b9e0 | ||
|
|
71ae054f5f | ||
|
|
6b3d427cab | ||
|
|
0bbb2072fa | ||
|
|
f1bad7c21f | ||
|
|
e9a63ce0eb | ||
|
|
62ec1c2cb3 | ||
|
|
26aa82ba6a | ||
|
|
5949e5c39d | ||
|
|
9547963191 | ||
|
|
5e19dab4dd | ||
|
|
34520b4477 | ||
|
|
f599d177e9 | ||
|
|
5d2dc04c0d | ||
|
|
565b39d41b | ||
|
|
64ad0980a2 | ||
|
|
b7608603f3 | ||
|
|
124b166a7e | ||
|
|
d1402cafbd | ||
|
|
bef832218d | ||
|
|
0b9e819a62 | ||
|
|
ceb9335735 | ||
|
|
e1a58c650c | ||
|
|
b4a2b3bf7d | ||
|
|
636a602fb0 | ||
|
|
42d260d7f2 | ||
|
|
16ec072493 | ||
|
|
d7709fa4de | ||
|
|
1d32b1f741 | ||
|
|
a4da48ebb1 | ||
|
|
2a3db5e5ad | ||
|
|
e9fa25d10e | ||
|
|
9c86483850 | ||
|
|
ca0464a7cb | ||
|
|
3dcba681e1 | ||
|
|
d75169ff76 | ||
|
|
22c95860ea | ||
|
|
3a970aeed2 | ||
|
|
c9a4871284 | ||
|
|
97c59ec580 | ||
|
|
498d8fb1e9 | ||
|
|
f74cf67e17 | ||
|
|
a8b87ecacf | ||
|
|
6eaaf3282e | ||
|
|
006d3af59f | ||
|
|
9fceae3ffb | ||
|
|
cbfa2eb4cc | ||
|
|
6a728ed07f | ||
|
|
41571b65a7 | ||
|
|
02f6cd6160 | ||
|
|
2b1c154295 | ||
|
|
917313bfea | ||
|
|
b1791118aa | ||
|
|
a8bd0c058b | ||
|
|
fe2eaf883f | ||
|
|
81790ff48c | ||
|
|
cca1d6aa65 | ||
|
|
50c34129cf | ||
|
|
c8052d0b60 | ||
|
|
a27980cb38 | ||
|
|
b3f05c0616 | ||
|
|
49fca60d04 | ||
|
|
b459cd119e | ||
|
|
0871344b5b | ||
|
|
60a0754b73 | ||
|
|
2a9fbc820b | ||
|
|
88fea48836 | ||
|
|
31e8ce37f3 | ||
|
|
830fcdc559 | ||
|
|
a97887fedc | ||
|
|
58519a70ce | ||
|
|
678dd7bad7 | ||
|
|
3da8771eba | ||
|
|
e54aad88cc | ||
|
|
1fa1c964b2 | ||
|
|
72b5d1f78a |
202 changed files with 10040 additions and 825 deletions
50
.github/workflows/build.yml
vendored
Normal file
50
.github/workflows/build.yml
vendored
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
name: Build CI
|
||||
|
||||
on: [pull_request, push]
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Dump GitHub context
|
||||
env:
|
||||
GITHUB_CONTEXT: ${{ toJson(github) }}
|
||||
run: echo "$GITHUB_CONTEXT"
|
||||
- name: Translate Repo Name For Build Tools filename_prefix
|
||||
id: repo-name
|
||||
run: echo ::set-output name=repo-name::Adafruit-Blinka
|
||||
- name: Set up Python 3.6
|
||||
uses: actions/setup-python@v1
|
||||
with:
|
||||
python-version: 3.6
|
||||
- name: Versions
|
||||
run: |
|
||||
python3 --version
|
||||
- name: Checkout Current Repo
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: true
|
||||
- name: Checkout tools repo
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
repository: adafruit/actions-ci-circuitpython-libs
|
||||
path: actions-ci
|
||||
- name: Install dependencies
|
||||
# (e.g. - apt-get: gettext, etc; pip: circuitpython-build-tools, requirements.txt; etc.)
|
||||
run: |
|
||||
source actions-ci/install.sh
|
||||
- name: Pip install pylint, black, & Sphinx
|
||||
run: |
|
||||
pip install --force-reinstall pylint black Sphinx sphinx-rtd-theme
|
||||
- name: Library version
|
||||
run: git describe --dirty --always --tags
|
||||
- name: Check formatting
|
||||
run: |
|
||||
black --check --target-version=py35 .
|
||||
- name: PyLint
|
||||
run: |
|
||||
pylint $( find src -name '*.py' )
|
||||
([[ ! -d "examples" ]] || pylint --disable=missing-docstring,invalid-name,bad-whitespace $( find . -path "./examples/*.py" ))
|
||||
- name: Build docs
|
||||
working-directory: docs
|
||||
run: sphinx-build -E -W -b html . _build/html
|
||||
33
.github/workflows/release.yml
vendored
Normal file
33
.github/workflows/release.yml
vendored
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
name: Release Actions
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
|
||||
jobs:
|
||||
upload-pypi:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Check For setup.py
|
||||
id: need-pypi
|
||||
run: |
|
||||
echo ::set-output name=setup-py::$( find . -wholename './setup.py' )
|
||||
- name: Set up Python
|
||||
if: contains(steps.need-pypi.outputs.setup-py, 'setup.py')
|
||||
uses: actions/setup-python@v1
|
||||
with:
|
||||
python-version: '3.x'
|
||||
- name: Install dependencies
|
||||
if: contains(steps.need-pypi.outputs.setup-py, 'setup.py')
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install setuptools wheel twine
|
||||
- name: Build and publish
|
||||
if: contains(steps.need-pypi.outputs.setup-py, 'setup.py')
|
||||
env:
|
||||
TWINE_USERNAME: ${{ secrets.pypi_username }}
|
||||
TWINE_PASSWORD: ${{ secrets.pypi_password }}
|
||||
run: |
|
||||
python setup.py sdist
|
||||
twine upload dist/*
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -4,7 +4,6 @@ __pycache__
|
|||
_build
|
||||
*.pyc
|
||||
.env
|
||||
build*
|
||||
bundles
|
||||
*.DS_Store
|
||||
.eggs
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
# A comma-separated list of package or module names from where C extensions may
|
||||
# be loaded. Extensions are loading into the active Python interpreter and may
|
||||
# run arbitrary code
|
||||
extension-pkg-whitelist=
|
||||
extension-pkg-whitelist=hid
|
||||
|
||||
# Add files or directories to the blacklist. They should be base names, not
|
||||
# paths.
|
||||
|
|
@ -52,7 +52,7 @@ confidence=
|
|||
# no Warning level messages displayed, use"--disable=all --enable=classes
|
||||
# --disable=W"
|
||||
# disable=import-error,print-statement,parameter-unpacking,unpacking-in-except,old-raise-syntax,backtick,long-suffix,old-ne-operator,old-octal-literal,import-star-module-level,raw-checker-failed,bad-inline-option,locally-disabled,locally-enabled,file-ignored,suppressed-message,useless-suppression,deprecated-pragma,apply-builtin,basestring-builtin,buffer-builtin,cmp-builtin,coerce-builtin,execfile-builtin,file-builtin,long-builtin,raw_input-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,no-absolute-import,old-division,dict-iter-method,dict-view-method,next-method-called,metaclass-assignment,indexing-exception,raising-string,reload-builtin,oct-method,hex-method,nonzero-method,cmp-method,input-builtin,round-builtin,intern-builtin,unichr-builtin,map-builtin-not-iterating,zip-builtin-not-iterating,range-builtin-not-iterating,filter-builtin-not-iterating,using-cmp-argument,eq-without-hash,div-method,idiv-method,rdiv-method,exception-message-attribute,invalid-str-codec,sys-max-int,bad-python3-import,deprecated-string-function,deprecated-str-translate-call
|
||||
disable=print-statement,parameter-unpacking,unpacking-in-except,old-raise-syntax,backtick,long-suffix,old-ne-operator,old-octal-literal,import-star-module-level,raw-checker-failed,bad-inline-option,locally-disabled,locally-enabled,file-ignored,suppressed-message,useless-suppression,deprecated-pragma,apply-builtin,basestring-builtin,buffer-builtin,cmp-builtin,coerce-builtin,execfile-builtin,file-builtin,long-builtin,raw_input-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,no-absolute-import,old-division,dict-iter-method,dict-view-method,next-method-called,metaclass-assignment,indexing-exception,raising-string,reload-builtin,oct-method,hex-method,nonzero-method,cmp-method,input-builtin,round-builtin,intern-builtin,unichr-builtin,map-builtin-not-iterating,zip-builtin-not-iterating,range-builtin-not-iterating,filter-builtin-not-iterating,using-cmp-argument,eq-without-hash,div-method,idiv-method,rdiv-method,exception-message-attribute,invalid-str-codec,sys-max-int,bad-python3-import,deprecated-string-function,deprecated-str-translate-call,import-error
|
||||
disable=print-statement,parameter-unpacking,unpacking-in-except,old-raise-syntax,backtick,long-suffix,old-ne-operator,old-octal-literal,import-star-module-level,raw-checker-failed,bad-inline-option,locally-disabled,locally-enabled,file-ignored,suppressed-message,useless-suppression,deprecated-pragma,apply-builtin,basestring-builtin,buffer-builtin,cmp-builtin,coerce-builtin,execfile-builtin,file-builtin,long-builtin,raw_input-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,no-absolute-import,old-division,dict-iter-method,dict-view-method,next-method-called,metaclass-assignment,indexing-exception,raising-string,reload-builtin,oct-method,hex-method,nonzero-method,cmp-method,input-builtin,round-builtin,intern-builtin,unichr-builtin,map-builtin-not-iterating,zip-builtin-not-iterating,range-builtin-not-iterating,filter-builtin-not-iterating,using-cmp-argument,eq-without-hash,div-method,idiv-method,rdiv-method,exception-message-attribute,invalid-str-codec,sys-max-int,bad-python3-import,deprecated-string-function,deprecated-str-translate-call,import-error,bad-continuation,invalid-name
|
||||
|
||||
# Enable the message, report, category or checker with the given id(s). You can
|
||||
# either give multiple identifier separated by comma (,) or put this option
|
||||
|
|
|
|||
26
.travis.yml
26
.travis.yml
|
|
@ -1,26 +0,0 @@
|
|||
dist: trusty
|
||||
sudo: false
|
||||
language: python
|
||||
python:
|
||||
- "3.6"
|
||||
|
||||
cache:
|
||||
pip: true
|
||||
|
||||
deploy:
|
||||
- provider: pypi
|
||||
user: adafruit-travis
|
||||
password:
|
||||
secure: UHEnpdeuxFrqSrrSKheh5fB8M5LA7JKmKkAgTy5YHvk/y3sTHHST5cgHg5s5zYSLG3WRrQgnUcf8ISEs6Sb22wtCi81nIhFfML97o/TD+lUSU+lMmbXiLvkMWhkVjGI6P8f5vXc655XYU0W84z9tI4aTKFVKC4pI4qY4XIDe3X7kvQoeRZdTZX35gCWBw9Hshhfc5AENJvRiQqOK/RXiZN4PS+jVFIG0MjSNZ1oO8/Bks//AGHacZuI+5sl3XTbeefiXLmbKsxqEir754GGs04ZgP7OAY4DHgQC2aigdXfnZEcWoWkfU+Hpz4FicFwYqsKfESVwN0Y/Dx4J06YISPEAagUtm0W63qmZ2GSxLmwWBNZ8hDiLaaVEmK9T6q+iw3CPTicC5/35gL+wab2P7thlCA7GHDYg9QfjthcT35Wc0cS+/iQ1w8uOA3aydjXMgiuzydqpViB+r7GmTxHp8qIwAQIYuy6GIY/tqgUUWZ5sjlkmBZTvtbqXYndQk4uvKifsqdbGJxvZh27+BPGSnAe3fIdxAGvGyLH2Ic58NANHrcV3iXMKkhEG3u7pka78uuZJbTnN1KUvk8XgrTv3Xk3gM5ZIn5HCadcXT6i6VMr0ELZCRmR1cng7d03NsXPFFz3LwjWr4MH34ON5HdQuk/X4bhF/IWxSZvxfSZW8C5mE=
|
||||
on:
|
||||
tags: true
|
||||
|
||||
install:
|
||||
- pip install -r requirements.txt
|
||||
- pip install --force-reinstall pylint==1.9.2
|
||||
- pip install circuitpython-build-tools Sphinx sphinx-rtd-theme
|
||||
|
||||
script:
|
||||
- pylint src/**/*.py
|
||||
- ([[ ! -d "examples" ]] || pylint --disable=missing-docstring,invalid-name,bad-whitespace examples/*.py)
|
||||
- cd docs && sphinx-build -E -W -b html . _build/html && cd ..
|
||||
45
README.rst
45
README.rst
|
|
@ -6,34 +6,66 @@ Introduction
|
|||
:alt: Documentation Status
|
||||
|
||||
.. image:: https://img.shields.io/discord/327254708534116352.svg
|
||||
:target: https://discord.gg/nBQh6qu
|
||||
:target: https://adafru.it/discord
|
||||
:alt: Discord
|
||||
|
||||
.. image:: https://travis-ci.org/adafruit/Adafruit_Blinka.svg?branch=master
|
||||
:target: https://travis-ci.org/adafruit/Adafruit_Blinka
|
||||
.. image:: https://travis-ci.com/adafruit/Adafruit_Blinka.svg?branch=master
|
||||
:target: https://travis-ci.com/adafruit/Adafruit_Blinka
|
||||
:alt: Build Status
|
||||
|
||||
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
|
||||
:target: https://github.com/psf/black
|
||||
:alt: Code Style: Black
|
||||
|
||||
This repository contains a selection of packages mirroring the CircuitPython API
|
||||
on hosts running micropython. Working code exists to emulate the CircuitPython packages;
|
||||
|
||||
* **board** - breakout-specific pin identities
|
||||
* **microcontroller** - chip-specific pin identities
|
||||
* **analogio** - analog input/output pins, using pin identities from board+microcontroller packages
|
||||
* **digitalio** - digital input/output pins, using pin identities from board+microcontroller packages
|
||||
* **bitbangio** - software-driven interfaces for I2C, SPI
|
||||
* **busio** - hardware-driven interfaces for I2C, SPI, UART
|
||||
* **time** * - substitute functions monkey-patched to time module
|
||||
* **pulseio** - contains classes that provide access to basic pulse IO (PWM)
|
||||
|
||||
For details, see the `Blinka API reference
|
||||
<https://circuitpython.readthedocs.io/projects/blinka/en/latest/index.html>`_.
|
||||
|
||||
Dependencies
|
||||
=============
|
||||
|
||||
The Micropython compatibility layers described above are intended to provide a CircuitPython-like API for devices which
|
||||
are running Micropython. Since corresponding packages should be built-in to any standard
|
||||
are running CPython or Micropython. Since corresponding packages should be built-in to any standard
|
||||
CircuitPython image, they have no value on a device already running CircuitPython and would likely conflict in unhappy ways.
|
||||
|
||||
The test suites in the test/src folder under **testing.universal** are by design
|
||||
intended to run on *either* CircuitPython *or* Micropython+compatibility layer to prove conformance.
|
||||
|
||||
Installing from PyPI
|
||||
=====================
|
||||
|
||||
On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally `from
|
||||
PyPI <https://pypi.org/project/Adafruit-Blinka/>`_. To install for current user:
|
||||
|
||||
.. code-block:: shell
|
||||
|
||||
pip3 install Adafruit-Blinka
|
||||
|
||||
To install system-wide (this may be required in some cases):
|
||||
|
||||
.. code-block:: shell
|
||||
|
||||
sudo pip3 install Adafruit-Blinka
|
||||
|
||||
To install in a virtual environment in your current project:
|
||||
|
||||
.. code-block:: shell
|
||||
|
||||
mkdir project-name && cd project-name
|
||||
python3 -m venv .env
|
||||
source .env/bin/activate
|
||||
pip3 install Adafruit-Blinka
|
||||
|
||||
Usage Example
|
||||
=============
|
||||
|
||||
|
|
@ -47,7 +79,6 @@ the following sequence runs through some basic testing of the digitalio compatib
|
|||
|
||||
An example log from running the suites is `here <https://github.com/cefn/Adafruit_Micropython_Blinka/issues/2#issuecomment-366713394>`_ .
|
||||
|
||||
|
||||
Contributing
|
||||
============
|
||||
|
||||
|
|
@ -68,7 +99,7 @@ install dependencies (feel free to reuse the virtual environment from above):
|
|||
|
||||
python3 -m venv .env
|
||||
source .env/bin/activate
|
||||
pip install Sphinx sphinx-rtd-theme
|
||||
pip install Sphinx sphinx-rtd-theme Adafruit-PlatformDetect
|
||||
|
||||
Now, once you have the virtual environment activated:
|
||||
|
||||
|
|
|
|||
11
docs/api.rst
11
docs/api.rst
|
|
@ -24,3 +24,14 @@
|
|||
|
||||
.. automodule:: digitalio
|
||||
:members:
|
||||
|
||||
.. automodule:: analogio
|
||||
:members:
|
||||
|
||||
.. automodule:: pulseio
|
||||
:members:
|
||||
|
||||
.. automodule:: neopixel_write
|
||||
:members:
|
||||
|
||||
|
||||
|
|
|
|||
118
docs/conf.py
118
docs/conf.py
|
|
@ -2,7 +2,8 @@
|
|||
|
||||
import os
|
||||
import sys
|
||||
sys.path.insert(0, os.path.abspath('../src'))
|
||||
|
||||
sys.path.insert(0, os.path.abspath("../src"))
|
||||
|
||||
# -- General configuration ------------------------------------------------
|
||||
|
||||
|
|
@ -10,40 +11,49 @@ sys.path.insert(0, os.path.abspath('../src'))
|
|||
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
|
||||
# ones.
|
||||
extensions = [
|
||||
'sphinx.ext.autodoc',
|
||||
'sphinx.ext.intersphinx',
|
||||
'sphinx.ext.todo',
|
||||
"sphinx.ext.autodoc",
|
||||
"sphinx.ext.intersphinx",
|
||||
"sphinx.ext.todo",
|
||||
]
|
||||
|
||||
# Uncomment the below if you use native CircuitPython modules such as
|
||||
# digitalio, micropython and busio. List the modules you use. Without it, the
|
||||
# autodoc module docs will fail to generate with a warning.
|
||||
autodoc_mock_imports = ["machine", "Adafruit_GPIO"]
|
||||
autodoc_mock_imports = [
|
||||
"machine",
|
||||
"Adafruit_GPIO",
|
||||
"RPi",
|
||||
"RPi.GPIO",
|
||||
"hid",
|
||||
"sysv_ipc",
|
||||
]
|
||||
|
||||
intersphinx_mapping = {'python': ('https://docs.python.org/3.4', None),
|
||||
'CircuitPython': ('https://circuitpython.readthedocs.io/en/latest/', None)}
|
||||
intersphinx_mapping = {
|
||||
"python": ("https://docs.python.org/3.4", None),
|
||||
"CircuitPython": ("https://circuitpython.readthedocs.io/en/latest/", None),
|
||||
}
|
||||
|
||||
# Add any paths that contain templates here, relative to this directory.
|
||||
templates_path = ['_templates']
|
||||
templates_path = ["_templates"]
|
||||
|
||||
source_suffix = '.rst'
|
||||
source_suffix = ".rst"
|
||||
|
||||
# The master toctree document.
|
||||
master_doc = 'index'
|
||||
master_doc = "index"
|
||||
|
||||
# General information about the project.
|
||||
project = u'Adafruit Blinka Library'
|
||||
copyright = u'2017 cefn'
|
||||
author = u'cefn'
|
||||
project = "Adafruit Blinka Library"
|
||||
copyright = "2017 cefn"
|
||||
author = "cefn"
|
||||
|
||||
# The version info for the project you're documenting, acts as replacement for
|
||||
# |version| and |release|, also used in various other places throughout the
|
||||
# built documents.
|
||||
#
|
||||
# The short X.Y version.
|
||||
version = u'1.0.0'
|
||||
version = "1.0.0"
|
||||
# The full version, including alpha/beta/rc tags.
|
||||
release = u'1.0.0'
|
||||
release = "1.0.0"
|
||||
|
||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||
# for a list of supported languages.
|
||||
|
|
@ -55,7 +65,7 @@ language = None
|
|||
# List of patterns, relative to source directory, that match files and
|
||||
# directories to ignore when looking for source files.
|
||||
# This patterns also effect to html_static_path and html_extra_path
|
||||
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', '.env', 'CODE_OF_CONDUCT.md']
|
||||
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store", ".env", "CODE_OF_CONDUCT.md"]
|
||||
|
||||
# The reST default role (used for this markup: `text`) to use for all
|
||||
# documents.
|
||||
|
|
@ -67,7 +77,7 @@ default_role = "any"
|
|||
add_function_parentheses = True
|
||||
|
||||
# The name of the Pygments (syntax highlighting) style to use.
|
||||
pygments_style = 'sphinx'
|
||||
pygments_style = "sphinx"
|
||||
|
||||
# If true, `todo` and `todoList` produce output, else they produce nothing.
|
||||
todo_include_todos = False
|
||||
|
|
@ -81,53 +91,56 @@ todo_emit_warnings = True
|
|||
# The theme to use for HTML and HTML Help pages. See the documentation for
|
||||
# a list of builtin themes.
|
||||
#
|
||||
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
|
||||
on_rtd = os.environ.get("READTHEDOCS", None) == "True"
|
||||
|
||||
if not on_rtd: # only import and set the theme if we're building docs locally
|
||||
try:
|
||||
import sphinx_rtd_theme
|
||||
html_theme = 'sphinx_rtd_theme'
|
||||
html_theme_path = [sphinx_rtd_theme.get_html_theme_path(), '.']
|
||||
|
||||
html_theme = "sphinx_rtd_theme"
|
||||
html_theme_path = [sphinx_rtd_theme.get_html_theme_path(), "."]
|
||||
except:
|
||||
html_theme = 'default'
|
||||
html_theme_path = ['.']
|
||||
html_theme = "default"
|
||||
html_theme_path = ["."]
|
||||
else:
|
||||
html_theme_path = ['.']
|
||||
html_theme_path = ["."]
|
||||
|
||||
# Add any paths that contain custom static files (such as style sheets) here,
|
||||
# relative to this directory. They are copied after the builtin static files,
|
||||
# so a file named "default.css" will overwrite the builtin "default.css".
|
||||
html_static_path = ['_static']
|
||||
html_static_path = ["_static"]
|
||||
|
||||
# Output file base name for HTML help builder.
|
||||
htmlhelp_basename = 'AdafruitBlinkaLibrarydoc'
|
||||
htmlhelp_basename = "AdafruitBlinkaLibrarydoc"
|
||||
|
||||
# -- Options for LaTeX output ---------------------------------------------
|
||||
|
||||
latex_elements = {
|
||||
# The paper size ('letterpaper' or 'a4paper').
|
||||
#
|
||||
# 'papersize': 'letterpaper',
|
||||
|
||||
# The font size ('10pt', '11pt' or '12pt').
|
||||
#
|
||||
# 'pointsize': '10pt',
|
||||
|
||||
# Additional stuff for the LaTeX preamble.
|
||||
#
|
||||
# 'preamble': '',
|
||||
|
||||
# Latex figure (float) alignment
|
||||
#
|
||||
# 'figure_align': 'htbp',
|
||||
# The paper size ('letterpaper' or 'a4paper').
|
||||
#
|
||||
# 'papersize': 'letterpaper',
|
||||
# The font size ('10pt', '11pt' or '12pt').
|
||||
#
|
||||
# 'pointsize': '10pt',
|
||||
# Additional stuff for the LaTeX preamble.
|
||||
#
|
||||
# 'preamble': '',
|
||||
# Latex figure (float) alignment
|
||||
#
|
||||
# 'figure_align': 'htbp',
|
||||
}
|
||||
|
||||
# Grouping the document tree into LaTeX files. List of tuples
|
||||
# (source start file, target name, title,
|
||||
# author, documentclass [howto, manual, or own class]).
|
||||
latex_documents = [
|
||||
(master_doc, 'AdafruitBlinkaLibrary.tex', u'AdafruitBlinka Library Documentation',
|
||||
author, 'manual'),
|
||||
(
|
||||
master_doc,
|
||||
"AdafruitBlinkaLibrary.tex",
|
||||
"AdafruitBlinka Library Documentation",
|
||||
author,
|
||||
"manual",
|
||||
),
|
||||
]
|
||||
|
||||
# -- Options for manual page output ---------------------------------------
|
||||
|
|
@ -135,8 +148,13 @@ latex_documents = [
|
|||
# One entry per manual page. List of tuples
|
||||
# (source start file, name, description, authors, manual section).
|
||||
man_pages = [
|
||||
(master_doc, 'AdafruitBlinkalibrary', u'Adafruit Blinka Library Documentation',
|
||||
[author], 1)
|
||||
(
|
||||
master_doc,
|
||||
"AdafruitBlinkalibrary",
|
||||
"Adafruit Blinka Library Documentation",
|
||||
[author],
|
||||
1,
|
||||
)
|
||||
]
|
||||
|
||||
# -- Options for Texinfo output -------------------------------------------
|
||||
|
|
@ -145,7 +163,13 @@ man_pages = [
|
|||
# (source start file, target name, title, author,
|
||||
# dir menu entry, description, category)
|
||||
texinfo_documents = [
|
||||
(master_doc, 'AdafruitBlinkaLibrary', u'Adafruit Blinka Library Documentation',
|
||||
author, 'AdafruitBlinkaLibrary', 'One line description of project.',
|
||||
'Miscellaneous'),
|
||||
(
|
||||
master_doc,
|
||||
"AdafruitBlinkaLibrary",
|
||||
"Adafruit Blinka Library Documentation",
|
||||
author,
|
||||
"AdafruitBlinkaLibrary",
|
||||
"One line description of project.",
|
||||
"Miscellaneous",
|
||||
),
|
||||
]
|
||||
|
|
|
|||
15
examples/analog_in.py
Normal file
15
examples/analog_in.py
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
"""Analog in demo"""
|
||||
import time
|
||||
import board
|
||||
from analogio import AnalogIn
|
||||
|
||||
analog_in = AnalogIn(board.A1)
|
||||
|
||||
|
||||
def get_voltage(pin):
|
||||
return (pin.value * 3.3) / 4096
|
||||
|
||||
|
||||
while True:
|
||||
print((get_voltage(analog_in),))
|
||||
time.sleep(0.1)
|
||||
13
examples/bbb_digitalio.py
Normal file → Executable file
13
examples/bbb_digitalio.py
Normal file → Executable file
|
|
@ -1,3 +1,6 @@
|
|||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Example of blinking LED on BeagleBone Black
|
||||
# https://www.adafruit.com/product/1876
|
||||
#
|
||||
|
|
@ -5,6 +8,16 @@
|
|||
# 1) connect anode (+) lead of LED to P9.12 pin
|
||||
# 2) connect cathode (-) lead to 1K Ohm resistor
|
||||
# 3) connect that 1K Ohm resistor to DGND (P9.1)
|
||||
#
|
||||
# NOTE: the pin mode can be verified with the command line
|
||||
# utility config-pin on the BeagleBoard.org Debian image
|
||||
#
|
||||
# To verify the pin is in GPIO mode:
|
||||
# debian@beaglebone:~$ config-pin -q p9.12
|
||||
# P9_12 Mode: gpio Direction: out Value: 0
|
||||
#
|
||||
# To set pin to GPIO mode:
|
||||
# $ config-pin p9.12 gpio
|
||||
|
||||
import time
|
||||
import board
|
||||
|
|
|
|||
57
examples/mcps_busio_i2c.py
Executable file
57
examples/mcps_busio_i2c.py
Executable file
|
|
@ -0,0 +1,57 @@
|
|||
import time
|
||||
import hid
|
||||
import busio
|
||||
|
||||
from adafruit_blinka.microcontroller.mcp2221.mcp2221 import mcp2221 as _mcp2221
|
||||
from adafruit_blinka.microcontroller.mcp2221.mcp2221 import MCP2221 as _MCP2221
|
||||
from adafruit_blinka.microcontroller.mcp2221.i2c import I2C as _MCP2221I2C
|
||||
|
||||
MLXADDR = 0x33
|
||||
ADDRID1 = 0x2407
|
||||
|
||||
|
||||
class MCP2221(_MCP2221): # pylint: disable=too-few-public-methods
|
||||
def __init__(self, address):
|
||||
self._hid = hid.device()
|
||||
self._hid.open_path(address)
|
||||
print("Connected to " + str(address))
|
||||
self._gp_config = [0x07] * 4 # "don't care" initial value
|
||||
for pin in range(4):
|
||||
self.gp_set_mode(pin, self.GP_GPIO) # set to GPIO mode
|
||||
self.gpio_set_direction(pin, 1) # set to INPUT
|
||||
|
||||
|
||||
class MCP2221I2C(_MCP2221I2C): # pylint: disable=too-few-public-methods
|
||||
def __init__(self, mcp2221, *, frequency=100000):
|
||||
self._mcp2221 = mcp2221
|
||||
self._mcp2221.i2c_configure(frequency)
|
||||
|
||||
|
||||
class I2C(busio.I2C): # pylint: disable=too-few-public-methods
|
||||
def __init__(self, mcp2221_i2c):
|
||||
self._i2c = mcp2221_i2c
|
||||
|
||||
|
||||
addresses = [mcp["path"] for mcp in hid.enumerate(0x04D8, 0x00DD)]
|
||||
|
||||
i2c_devices = []
|
||||
i2c_devices.append(I2C(MCP2221I2C(_mcp2221)))
|
||||
|
||||
for addr in addresses:
|
||||
try:
|
||||
i2c_device = I2C(MCP2221I2C(MCP2221(addr)))
|
||||
i2c_devices.append(i2c_device)
|
||||
except OSError:
|
||||
print("Device path: " + str(addr) + " is used")
|
||||
|
||||
|
||||
while True:
|
||||
for i2c in i2c_devices:
|
||||
addrbuf = bytearray(2)
|
||||
addrbuf[0] = ADDRID1 >> 8
|
||||
addrbuf[1] = ADDRID1 & 0xFF
|
||||
inbuf = bytearray(6)
|
||||
i2c.writeto_then_readfrom(MLXADDR, addrbuf, inbuf)
|
||||
print("Device " + str(i2c_devices.index(i2c)) + ": ")
|
||||
print(inbuf)
|
||||
time.sleep(0.5)
|
||||
35
examples/pb_digitalio.py
Executable file
35
examples/pb_digitalio.py
Executable file
|
|
@ -0,0 +1,35 @@
|
|||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Example of blinking LED on PocketBeagle
|
||||
# https://www.adafruit.com/product/4179
|
||||
#
|
||||
# Wire the circuit as follows:
|
||||
# 1) connect anode (+) lead of LED to P1_33 pin
|
||||
# 2) connect cathode (-) lead to 1K Ohm resistor
|
||||
# 3) connect that 1K Ohm resistor to GND
|
||||
#
|
||||
# NOTE: the pin mode can be verified with the command line
|
||||
# utility config-pin on the BeagleBoard.org Debian image
|
||||
#
|
||||
# To verify the pin is in GPIO mode:
|
||||
# debian@beaglebone:~$ config-pin -q p1.33
|
||||
# P1_33 Mode: gpio Direction: out Value: 0
|
||||
#
|
||||
# To set pin to GPIO mode:
|
||||
# $ config-pin p1.33 gpio
|
||||
|
||||
import time
|
||||
import board
|
||||
import digitalio
|
||||
|
||||
print("hello blinky!")
|
||||
|
||||
led = digitalio.DigitalInOut(board.P1_33)
|
||||
led.direction = digitalio.Direction.OUTPUT
|
||||
|
||||
while True:
|
||||
led.value = True
|
||||
time.sleep(0.5)
|
||||
led.value = False
|
||||
time.sleep(0.5)
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
import time
|
||||
import sys
|
||||
import board
|
||||
import busio
|
||||
|
||||
|
|
@ -10,7 +11,8 @@ print("I2C devices found: ", [hex(i) for i in i2c.scan()])
|
|||
|
||||
if not 0x18 in i2c.scan():
|
||||
print("Didn't find MCP9808")
|
||||
exit()
|
||||
sys.exit()
|
||||
|
||||
|
||||
def temp_c(data):
|
||||
value = data[0] << 8 | data[1]
|
||||
|
|
@ -19,6 +21,7 @@ def temp_c(data):
|
|||
temp -= 256.0
|
||||
return temp
|
||||
|
||||
|
||||
while True:
|
||||
i2c.writeto(0x18, bytes([0x05]), stop=False)
|
||||
result = bytearray(2)
|
||||
|
|
|
|||
|
|
@ -9,5 +9,5 @@ spi.configure(baudrate=16000000)
|
|||
spi.unlock()
|
||||
|
||||
while True:
|
||||
spi.write(bytes([x for x in range(64)]))
|
||||
spi.write(bytes(range(64)))
|
||||
time.sleep(0.1)
|
||||
|
|
|
|||
|
|
@ -1,16 +1,18 @@
|
|||
import sys
|
||||
import time
|
||||
from adafruit_blinka.agnostic import board as agnostic_board
|
||||
import adafruit_blinka.agnostic as agnostic
|
||||
import board
|
||||
import digitalio
|
||||
|
||||
#from Adafruit_GPIO import Platform
|
||||
#print("Platform = ", Platform.platform_detect(), Platform.pi_version())
|
||||
# from Adafruit_GPIO import Platform
|
||||
# print("Platform = ", Platform.platform_detect(), Platform.pi_version())
|
||||
|
||||
print("hello blinka!")
|
||||
|
||||
print("Found system type: %s (sys.plaform %s implementation %s) " %
|
||||
(agnostic_board, sys.platform, sys.implementation.name))
|
||||
print(
|
||||
"Found system type: %s (sys.platform %s implementation %s) "
|
||||
% (agnostic.board_id, sys.platform, sys.implementation.name)
|
||||
)
|
||||
|
||||
print("board contents: ", dir(board))
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
Adafruit-PlatformDetect
|
||||
Adafruit-PureIO
|
||||
Adafruit-PlatformDetect>=2.18.1
|
||||
Adafruit-PureIO>=1.1.7
|
||||
Jetson.GPIO; platform_machine=='aarch64'
|
||||
RPi.GPIO; platform_machine=='armv7l' or platform_machine=='armv6l'
|
||||
rpi_ws281x>=4.0.0; platform_machine=='armv7l' or platform_machine=='armv6l'
|
||||
spidev; sys_platform == 'linux'
|
||||
sysv_ipc
|
||||
sysv_ipc; sys_platform == 'linux' and platform_machine!='mips'
|
||||
pyftdi>=0.40.0
|
||||
binho-host-adapter>=0.1.6
|
||||
|
|
|
|||
76
setup.py
76
setup.py
|
|
@ -14,41 +14,65 @@ here = os.path.abspath(os.path.dirname(__file__))
|
|||
|
||||
# Import the README and use it as the long-description.
|
||||
# Note: this will only work if 'README.md' is present in your MANIFEST.in file!
|
||||
with io.open(os.path.join(here, 'README.rst'), encoding='utf-8') as f:
|
||||
long_description = '\n' + f.read()
|
||||
with io.open(os.path.join(here, "README.rst"), encoding="utf-8") as f:
|
||||
long_description = "\n" + f.read()
|
||||
|
||||
board_reqs = []
|
||||
if os.path.exists("/proc/device-tree/compatible"):
|
||||
with open("/proc/device-tree/compatible", "rb") as f:
|
||||
compat = f.read()
|
||||
if b"nvidia,tegra" in compat:
|
||||
board_reqs = ["Jetson.GPIO"]
|
||||
if (
|
||||
b"brcm,bcm2835" in compat
|
||||
or b"brcm,bcm2836" in compat
|
||||
or b"brcm,bcm2837" in compat
|
||||
or b"brcm,bcm2838" in compat
|
||||
):
|
||||
board_reqs = ["RPi.GPIO", "rpi_ws281x>=4.0.0", "sysv_ipc"]
|
||||
|
||||
setup(
|
||||
name='Adafruit-Blinka',
|
||||
name="Adafruit-Blinka",
|
||||
use_scm_version=True,
|
||||
setup_requires=["setuptools_scm"],
|
||||
description='CircuitPython APIs for non-CircuitPython versions of Python such as CPython on Linux and MicroPython.',
|
||||
description="CircuitPython APIs for non-CircuitPython versions of Python such as CPython on Linux and MicroPython.",
|
||||
long_description=long_description,
|
||||
long_description_content_type='text/x-rst',
|
||||
author='Adafruit Industries',
|
||||
author_email='circuitpython@adafruit.com',
|
||||
python_requires='>=3.4.0',
|
||||
url='https://github.com/adafruit/Adafruit_Blinka',
|
||||
package_dir={'': 'src'},
|
||||
long_description_content_type="text/x-rst",
|
||||
author="Adafruit Industries",
|
||||
author_email="circuitpython@adafruit.com",
|
||||
python_requires=">=3.5.0",
|
||||
url="https://github.com/adafruit/Adafruit_Blinka",
|
||||
package_dir={"": "src"},
|
||||
packages=find_packages("src"),
|
||||
# This seems to override find_packages above - I suspect but don't know for sure that
|
||||
# we're doing this for a reason -- bpb 2019-01-15:
|
||||
py_modules=['bitbangio', 'board', 'busio', 'digitalio', 'micropython', 'pulseio', 'neopixel_write'],
|
||||
install_requires=[
|
||||
"Adafruit-PlatformDetect",
|
||||
"Adafruit-PureIO",
|
||||
"RPi.GPIO; platform_machine=='armv7l' or platform_machine=='armv6l'",
|
||||
"rpi_ws281x>=4.0.0; platform_machine=='armv7l' or platform_machine=='armv6l'",
|
||||
"spidev; sys_platform=='linux'",
|
||||
"sysv_ipc"
|
||||
# py_modules lists top-level single file packages to include.
|
||||
# find_packages only finds packages in directories with __init__.py files.
|
||||
py_modules=[
|
||||
"analogio",
|
||||
"bitbangio",
|
||||
"board",
|
||||
"busio",
|
||||
"digitalio",
|
||||
"micropython",
|
||||
"pulseio",
|
||||
"neopixel_write",
|
||||
],
|
||||
license='MIT',
|
||||
package_data={
|
||||
"adafruit_blinka.microcontroller.bcm283x.pulseio": ["libgpiod_pulsein"]
|
||||
},
|
||||
install_requires=[
|
||||
"Adafruit-PlatformDetect>=2.18.1",
|
||||
"Adafruit-PureIO>=1.1.7",
|
||||
"pyftdi>=0.40.0",
|
||||
]
|
||||
+ board_reqs,
|
||||
license="MIT",
|
||||
classifiers=[
|
||||
# Trove classifiers
|
||||
# Full list: https://pypi.python.org/pypi?%3Aaction=list_classifiers
|
||||
'License :: OSI Approved :: MIT License',
|
||||
'Programming Language :: Python',
|
||||
'Programming Language :: Python :: 3',
|
||||
'Programming Language :: Python :: 3.4',
|
||||
'Programming Language :: Python :: Implementation :: MicroPython',
|
||||
"License :: OSI Approved :: MIT License",
|
||||
"Programming Language :: Python",
|
||||
"Programming Language :: Python :: 3",
|
||||
"Programming Language :: Python :: 3.5",
|
||||
"Programming Language :: Python :: Implementation :: MicroPython",
|
||||
],
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
"""Return the current version"""
|
||||
VERSION = (1, 0, 0)
|
||||
|
||||
__version__ = '.'.join(map(str, VERSION))
|
||||
__version__ = ".".join(map(str, VERSION))
|
||||
|
|
|
|||
|
|
@ -5,10 +5,11 @@
|
|||
* Author(s): cefn
|
||||
"""
|
||||
|
||||
class Enum():
|
||||
|
||||
class Enum:
|
||||
"""
|
||||
Object supporting CircuitPython-style of static symbols
|
||||
as seen with Direction.OUTPUT, Pull.UP
|
||||
Object supporting CircuitPython-style of static symbols
|
||||
as seen with Direction.OUTPUT, Pull.UP
|
||||
"""
|
||||
|
||||
def __repr__(self):
|
||||
|
|
@ -26,8 +27,8 @@ class Enum():
|
|||
@classmethod
|
||||
def iteritems(cls):
|
||||
"""
|
||||
Inspects attributes of the class for instances of the class
|
||||
and returns as key,value pairs mirroring dict#iteritems
|
||||
Inspects attributes of the class for instances of the class
|
||||
and returns as key,value pairs mirroring dict#iteritems
|
||||
"""
|
||||
for key in dir(cls):
|
||||
val = getattr(cls, key)
|
||||
|
|
@ -37,6 +38,7 @@ class Enum():
|
|||
|
||||
class ContextManaged:
|
||||
"""An object that automatically deinitializes hardware with a context manager."""
|
||||
|
||||
def __enter__(self):
|
||||
return self
|
||||
|
||||
|
|
@ -47,11 +49,13 @@ class ContextManaged:
|
|||
def deinit(self):
|
||||
"""Free any hardware used by the object."""
|
||||
return
|
||||
|
||||
# pylint: enable=no-self-use
|
||||
|
||||
|
||||
class Lockable(ContextManaged):
|
||||
"""An object that must be locked to prevent collisions on a microcontroller resource."""
|
||||
|
||||
_locked = False
|
||||
|
||||
def try_lock(self):
|
||||
|
|
@ -68,8 +72,13 @@ class Lockable(ContextManaged):
|
|||
else:
|
||||
raise ValueError("Not locked")
|
||||
|
||||
|
||||
def patch_system():
|
||||
"""Patch modules that may be different due to the platform."""
|
||||
# pylint: disable=import-outside-toplevel
|
||||
import sys
|
||||
from adafruit_blinka.agnostic import time
|
||||
sys.modules['time'] = time
|
||||
|
||||
# pylint: enable=import-outside-toplevel
|
||||
|
||||
sys.modules["time"] = time
|
||||
|
|
|
|||
|
|
@ -12,28 +12,60 @@ elif agnostic.implementation == "micropython":
|
|||
from utime import sleep
|
||||
|
||||
from ucollections import namedtuple
|
||||
_struct_time = namedtuple("struct_time", ("tm_year", "tm_mon", "tm_mday",
|
||||
"tm_hour", "tm_min", "tm_sec",
|
||||
"tm_wday", "tm_yday", "tm_isdst"))
|
||||
|
||||
#pylint: disable=too-many-arguments
|
||||
def _marshal_time(tm_year, tm_mon, tm_mday, tm_hour=0, tm_min=0, tm_sec=0, tm_wday=-1,
|
||||
tm_yday=-1, tm_isdst=-1):
|
||||
_struct_time = namedtuple(
|
||||
"struct_time",
|
||||
(
|
||||
"tm_year",
|
||||
"tm_mon",
|
||||
"tm_mday",
|
||||
"tm_hour",
|
||||
"tm_min",
|
||||
"tm_sec",
|
||||
"tm_wday",
|
||||
"tm_yday",
|
||||
"tm_isdst",
|
||||
),
|
||||
)
|
||||
|
||||
# pylint: disable=too-many-arguments
|
||||
def _marshal_time(
|
||||
tm_year,
|
||||
tm_mon,
|
||||
tm_mday,
|
||||
tm_hour=0,
|
||||
tm_min=0,
|
||||
tm_sec=0,
|
||||
tm_wday=-1,
|
||||
tm_yday=-1,
|
||||
tm_isdst=-1,
|
||||
):
|
||||
"""Construct struct_time with default values."""
|
||||
_struct_time(tm_year, tm_mon, tm_mday, tm_hour, tm_min, tm_sec, tm_wday, tm_yday, tm_isdst)
|
||||
_struct_time(
|
||||
tm_year,
|
||||
tm_mon,
|
||||
tm_mday,
|
||||
tm_hour,
|
||||
tm_min,
|
||||
tm_sec,
|
||||
tm_wday,
|
||||
tm_yday,
|
||||
tm_isdst,
|
||||
)
|
||||
|
||||
def struct_time(time_tuple):
|
||||
"""Create a struct_time"""
|
||||
return _marshal_time(*time_tuple)
|
||||
|
||||
#pylint: disable=invalid-name
|
||||
# pylint: disable=invalid-name
|
||||
_total_ms = 0
|
||||
_prev_ticks_ms = utime.ticks_ms()
|
||||
|
||||
def monotonic():
|
||||
"""A monotonically increasing time in seconds. No defined start time."""
|
||||
# Assumes that monotonic is called more frequently than the wraparound of micropython's
|
||||
# utime.ticks_ms()
|
||||
global _prev_ticks_ms, _total_ms #pylint: disable=global-statement
|
||||
global _prev_ticks_ms, _total_ms # pylint: disable=global-statement
|
||||
ticks_ms = utime.ticks_ms()
|
||||
_total_ms += utime.ticks_diff(ticks_ms, _prev_ticks_ms)
|
||||
_prev_ticks_ms = ticks_ms
|
||||
|
|
|
|||
1
src/adafruit_blinka/board/bananapi/__init__.py
Normal file
1
src/adafruit_blinka/board/bananapi/__init__.py
Normal file
|
|
@ -0,0 +1 @@
|
|||
"""Boards definition from Banana Pi"""
|
||||
79
src/adafruit_blinka/board/bananapi/bpim2zero.py
Normal file
79
src/adafruit_blinka/board/bananapi/bpim2zero.py
Normal file
|
|
@ -0,0 +1,79 @@
|
|||
"""Pin definitions for the Banana Pi M2 Zero."""
|
||||
|
||||
# The Banana Pi M2 Zero uses the AllWinner H2 SoC, but pins
|
||||
# are the same as the AllWinner H3 SoC, so we import those
|
||||
from adafruit_blinka.microcontroller.allwinner.h3 import pin
|
||||
|
||||
PA12 = pin.PA12
|
||||
SDA = pin.PA12
|
||||
PA11 = pin.PA11
|
||||
SCL = pin.PA11
|
||||
PA6 = pin.PA6
|
||||
PWM1 = pin.PA6
|
||||
PA1 = pin.PA1
|
||||
UART2_RX = pin.PA1
|
||||
PA0 = pin.PA0
|
||||
UART2_TX = pin.PA0
|
||||
PA3 = pin.PA3
|
||||
UART2_CTS = pin.PA3
|
||||
PA10 = pin.PA10
|
||||
PA12 = pin.PA12
|
||||
SDA = pin.PA12
|
||||
PA11 = pin.PA11
|
||||
SCL = pin.PA11
|
||||
PA6 = pin.PA6
|
||||
PWM1 = pin.PA6
|
||||
PA1 = pin.PA1
|
||||
UART2_RX = pin.PA1
|
||||
PA0 = pin.PA0
|
||||
UART2_TX = pin.PA0
|
||||
PA3 = pin.PA3
|
||||
UART2_CTS = pin.PA3
|
||||
PA7 = pin.PA7
|
||||
PA8 = pin.PA8
|
||||
PA9 = pin.PA9
|
||||
PA10 = pin.PA10
|
||||
PA17 = pin.PA17
|
||||
PA18 = pin.PA18
|
||||
PA19 = pin.PA19
|
||||
PA20 = pin.PA20
|
||||
PA21 = pin.PA21
|
||||
PC0 = pin.PC0
|
||||
PC1 = pin.PC1
|
||||
PC2 = pin.PC2
|
||||
PC3 = pin.PC3
|
||||
PC4 = pin.PC4
|
||||
PC7 = pin.PC7
|
||||
|
||||
PA13 = pin.PA13
|
||||
SPI1_CS = pin.PA13
|
||||
PA14 = pin.PA14
|
||||
SPI1_CLK = pin.PA14
|
||||
PA2 = pin.PA2
|
||||
UART2_RTS = pin.PA2
|
||||
PA18 = pin.PA18
|
||||
TWI1_SCK = pin.PA18
|
||||
|
||||
PL2 = pin.PL2
|
||||
PL4 = pin.PL4
|
||||
|
||||
SCLK = pin.PA14
|
||||
MOSI = pin.PA15
|
||||
MISO = pin.PA16
|
||||
|
||||
PA13 = pin.PA13
|
||||
SPI1_CS = pin.PA13
|
||||
PA14 = pin.PA14
|
||||
SPI1_CLK = pin.PA14
|
||||
PA2 = pin.PA2
|
||||
UART2_RTS = pin.PA2
|
||||
PA18 = pin.PA18
|
||||
TWI1_SCK = pin.PA18
|
||||
PG6 = pin.PG6
|
||||
UART1_TX = pin.PG6
|
||||
PG7 = pin.PG7
|
||||
UART1_RX = pin.PG7
|
||||
|
||||
SCLK = pin.PA14
|
||||
MOSI = pin.PA15
|
||||
MISO = pin.PA16
|
||||
1
src/adafruit_blinka/board/beagleboard/__init__.py
Normal file
1
src/adafruit_blinka/board/beagleboard/__init__.py
Normal file
|
|
@ -0,0 +1 @@
|
|||
"""Boards definition from BeagleBoard"""
|
||||
140
src/adafruit_blinka/board/beagleboard/beaglebone_ai.py
Normal file
140
src/adafruit_blinka/board/beagleboard/beaglebone_ai.py
Normal file
|
|
@ -0,0 +1,140 @@
|
|||
"""Pin definitions for the Beaglebone Black."""
|
||||
from adafruit_blinka.microcontroller.dra74x import pin
|
||||
|
||||
# initial pins, to mimic bonescript demo
|
||||
# BeagleBone Black
|
||||
# P8_1 = DGND # DGND
|
||||
# P8_2 = DGND # DGND
|
||||
P8_3 = pin.P8_3 # GPIO1_6 - GPIO_38
|
||||
P8_4 = pin.P8_4 # GPIO1_7 - GPIO_39
|
||||
P8_5 = pin.P8_5 # GPIO1_2 - GPIO_34
|
||||
P8_6 = pin.P8_6 # GPIO1_3 - GPIO_35
|
||||
P8_7 = pin.P8_7 # TIMER4 - GPIO_66
|
||||
P8_8 = pin.P8_8 # TIMER7 - GPIO_67
|
||||
P8_9 = pin.P8_9 # TIMER5 - GPIO_69
|
||||
P8_10 = pin.P8_10 # TIMER6 - GPIO_68
|
||||
P8_11 = pin.P8_11 # GPIO1_13 - GPIO_45
|
||||
P8_12 = pin.P8_12 # GPIO1_12 - GPIO_44
|
||||
P8_13 = pin.P8_13 # EHRPWM2B - GPIO_23
|
||||
P8_14 = pin.P8_14 # GPIO0_26 - GPIO_26
|
||||
P8_15 = pin.P8_15 # GPIO1_15 - GPIO_47
|
||||
P8_16 = pin.P8_16 # GPIO1_14 - GPIO_46
|
||||
P8_17 = pin.P8_17 # GPIO0_27 - GPIO_27
|
||||
P8_18 = pin.P8_18 # GPIO2_1 - GPIO_65
|
||||
P8_19 = pin.P8_19 # EHRPWM2A - GPIO_22
|
||||
P8_20 = pin.P8_20 # GPIO1_31 - GPIO_63
|
||||
P8_21 = pin.P8_21 # GPIO1_30 - GPIO_62
|
||||
P8_22 = pin.P8_22 # GPIO1_5 - GPIO_37
|
||||
P8_23 = pin.P8_23 # GPIO1_4 - GPIO_36
|
||||
P8_24 = pin.P8_24 # GPIO1_1 - GPIO_33
|
||||
P8_25 = pin.P8_25 # GPIO1_0 - GPIO_32
|
||||
P8_26 = pin.P8_26 # GPIO1_29 - GPIO_61
|
||||
P8_27 = pin.P8_27 # GPIO2_22 - GPIO_86
|
||||
P8_28 = pin.P8_28 # GPIO2_24 - GPIO_88
|
||||
P8_29 = pin.P8_29 # GPIO2_23 - GPIO_87
|
||||
P8_30 = pin.P8_30 # GPIO2_25 - GPIO_89
|
||||
P8_31 = pin.P8_31 # UART5_CTSN - GPIO_10
|
||||
P8_32 = pin.P8_32 # UART5_RTSN - GPIO_11
|
||||
P8_33 = pin.P8_33 # UART4_RTSN - GPIO_9
|
||||
P8_34 = pin.P8_34 # UART3_RTSN - GPIO_81
|
||||
P8_35 = pin.P8_35 # UART4_CTSN - GPIO_8
|
||||
P8_36 = pin.P8_36 # UART3_CTSN - GPIO_80
|
||||
P8_37 = pin.P8_37 # UART5_TXD - GPIO_78
|
||||
P8_38 = pin.P8_38 # UART5_RXD - GPIO_79
|
||||
P8_39 = pin.P8_39 # GPIO2_12 - GPIO_76
|
||||
P8_40 = pin.P8_40 # GPIO2_13 - GPIO_77
|
||||
P8_41 = pin.P8_41 # GPIO2_10 - GPIO_74
|
||||
P8_42 = pin.P8_42 # GPIO2_11 - GPIO_75
|
||||
P8_43 = pin.P8_43 # GPIO2_8 - GPIO_72
|
||||
P8_44 = pin.P8_44 # GPIO2_9 - GPIO_73
|
||||
P8_45 = pin.P8_45 # GPIO2_6 - GPIO_70
|
||||
P8_46 = pin.P8_46 # GPIO2_7 - GPIO_71
|
||||
|
||||
# P9_1 = DGND # DGND
|
||||
# P9_2 = DGND # DGND
|
||||
# P9_3 = VDD_3V3 # VDD_3V3
|
||||
# P9_4 = VDD_3V3 # VDD_3V3
|
||||
# P9_5 = VDD_5V # VDD_5V
|
||||
# P9_6 = VDD_5V # VDD_5V
|
||||
# P9_7 = SYS_5V # SYS_5V
|
||||
# P9_8 = SYS_5V # SYS_5V
|
||||
# P9_9 = PWR_BUT # PWR_BUT
|
||||
# P9_10 = SYS_RESETN # SYS_RESETn
|
||||
P9_11 = pin.P9_11 # UART4_RXD - GPIO_30
|
||||
P9_12 = pin.P9_12 # GPIO1_28 - GPIO_60
|
||||
P9_13 = pin.P9_13 # UART4_TXD - GPIO_31
|
||||
P9_14 = pin.P9_14 # EHRPWM1A - GPIO_50
|
||||
P9_15 = pin.P9_15 # GPIO1_16 - GPIO_48
|
||||
P9_16 = pin.P9_16 # EHRPWM1B - GPIO_51
|
||||
P9_17 = pin.P9_17 # I2C1_SCL - GPIO_5
|
||||
P9_18 = pin.P9_18 # I2C1_SDA - GPIO_4
|
||||
P9_19 = pin.P9_19 # I2C2_SCL - GPIO_13
|
||||
P9_20 = pin.P9_20 # I2C2_SDA - GPIO_12
|
||||
P9_21 = pin.P9_21 # UART2_TXD - GPIO_3
|
||||
P9_22 = pin.P9_22 # UART2_RXD - GPIO_2
|
||||
P9_23 = pin.P9_23 # GPIO1_17 - GPIO_49
|
||||
P9_24 = pin.P9_24 # UART1_TXD - GPIO_15
|
||||
P9_25 = pin.P9_25 # GPIO3_21 - GPIO_117
|
||||
P9_26 = pin.P9_26 # UART1_RXD - GPIO_14
|
||||
P9_27 = pin.P9_27 # GPIO3_19 - GPIO_115
|
||||
P9_28 = pin.P9_28 # SPI1_CS0 - GPIO_113
|
||||
P9_29 = pin.P9_29 # SPI1_D0 - GPIO_111
|
||||
P9_30 = pin.P9_30 # SPI1_D1 - GPIO_112
|
||||
P9_31 = pin.P9_31 # SPI1_SCLK - GPIO_110
|
||||
# P9_32 = VDD_ADC # VDD_ADC
|
||||
# P9_33 = AIN4 # AIN4
|
||||
# P9_34 = GNDA_ADC # GNDA_ADC
|
||||
# P9_35 = AIN6 # AIN6
|
||||
# P9_36 = AIN5 # AIN5
|
||||
# P9_37 = AIN2 # AIN2
|
||||
# P9_38 = AIN3 # AIN3
|
||||
# P9_39 = AIN0 # AIN0
|
||||
# P9_40 = AIN1 # AIN1
|
||||
P9_41 = pin.P9_41 # CLKOUT2 - GPIO_20
|
||||
P9_42 = pin.P9_42 # GPIO0_7 - GPIO_7
|
||||
# P9_43 = DGND # DGND
|
||||
# P9_44 = DGND # DGND
|
||||
# P9_45 = DGND # DGND
|
||||
# P9_46 = DGND # DGND
|
||||
|
||||
# common to all beagles
|
||||
LED_USR0 = pin.USR0
|
||||
LED_USR1 = pin.USR1
|
||||
LED_USR2 = pin.USR2
|
||||
LED_USR3 = pin.USR3
|
||||
LED_USR4 = pin.USR4
|
||||
|
||||
# I2C and SPI pins from:
|
||||
# src/adafruit_blinka/board/raspi_40pin.py
|
||||
# SDA = pin.SDA
|
||||
# SCL = pin.SCL
|
||||
# CE1 = pin.D7
|
||||
# CE0 = pin.D8
|
||||
# MISO = pin.D9
|
||||
# MOSI = pin.D10
|
||||
# SCLK = pin.D11
|
||||
# SCK = pin.D11
|
||||
# TXD = pin.D14
|
||||
# RXD = pin.D15
|
||||
# MISO_1 = pin.D19
|
||||
# MOSI_1 = pin.D20
|
||||
# SCLK_1 = pin.D21
|
||||
# SCK_1 = pin.D21
|
||||
|
||||
SDA = pin.I2C4_SDA # P9_19
|
||||
SCL = pin.I2C4_SCL # P9_20
|
||||
|
||||
# Pins for SPI
|
||||
#
|
||||
# To enable SPI and an additional I2C port, add the following line to /boot/uEnv.txt:
|
||||
# dtb=am5729-beagleboneai-roboticscape.dtb
|
||||
#
|
||||
# You can verify the dtb file exists by checking the /boot/dtbs/{kernel_version}/ folder
|
||||
#
|
||||
CE0 = pin.SPI1_CS0 # P9_28
|
||||
CE1 = pin.SPI1_CS1 # P9_42
|
||||
MOSI = pin.SPI1_D1 # P9_29
|
||||
MISO = pin.SPI1_D0 # P9_30
|
||||
SCLK = pin.SPI1_SCLK # P9_31
|
||||
# CircuitPython naming convention for SPI Clock
|
||||
SCK = SCLK
|
||||
176
src/adafruit_blinka/board/beagleboard/beaglebone_black.py
Normal file
176
src/adafruit_blinka/board/beagleboard/beaglebone_black.py
Normal file
|
|
@ -0,0 +1,176 @@
|
|||
"""Pin definitions for the Beaglebone Black."""
|
||||
from adafruit_blinka.microcontroller.am335x import pin
|
||||
|
||||
# initial pins, to mimic bonescript demo
|
||||
# BeagleBone Black
|
||||
# P8_1 = DGND # DGND
|
||||
# P8_2 = DGND # DGND
|
||||
P8_3 = pin.P8_3 # GPIO1_6 - GPIO_38
|
||||
P8_4 = pin.P8_4 # GPIO1_7 - GPIO_39
|
||||
P8_5 = pin.P8_5 # GPIO1_2 - GPIO_34
|
||||
P8_6 = pin.P8_6 # GPIO1_3 - GPIO_35
|
||||
P8_7 = pin.P8_7 # TIMER4 - GPIO_66
|
||||
P8_8 = pin.P8_8 # TIMER7 - GPIO_67
|
||||
P8_9 = pin.P8_9 # TIMER5 - GPIO_69
|
||||
P8_10 = pin.P8_10 # TIMER6 - GPIO_68
|
||||
P8_11 = pin.P8_11 # GPIO1_13 - GPIO_45
|
||||
P8_12 = pin.P8_12 # GPIO1_12 - GPIO_44
|
||||
P8_13 = pin.P8_13 # EHRPWM2B - GPIO_23
|
||||
P8_14 = pin.P8_14 # GPIO0_26 - GPIO_26
|
||||
P8_15 = pin.P8_15 # GPIO1_15 - GPIO_47
|
||||
P8_16 = pin.P8_16 # GPIO1_14 - GPIO_46
|
||||
P8_17 = pin.P8_17 # GPIO0_27 - GPIO_27
|
||||
P8_18 = pin.P8_18 # GPIO2_1 - GPIO_65
|
||||
P8_19 = pin.P8_19 # EHRPWM2A - GPIO_22
|
||||
P8_20 = pin.P8_20 # GPIO1_31 - GPIO_63
|
||||
P8_21 = pin.P8_21 # GPIO1_30 - GPIO_62
|
||||
P8_22 = pin.P8_22 # GPIO1_5 - GPIO_37
|
||||
P8_23 = pin.P8_23 # GPIO1_4 - GPIO_36
|
||||
P8_24 = pin.P8_24 # GPIO1_1 - GPIO_33
|
||||
P8_25 = pin.P8_25 # GPIO1_0 - GPIO_32
|
||||
P8_26 = pin.P8_26 # GPIO1_29 - GPIO_61
|
||||
P8_27 = pin.P8_27 # GPIO2_22 - GPIO_86
|
||||
P8_28 = pin.P8_28 # GPIO2_24 - GPIO_88
|
||||
P8_29 = pin.P8_29 # GPIO2_23 - GPIO_87
|
||||
P8_30 = pin.P8_30 # GPIO2_25 - GPIO_89
|
||||
P8_31 = pin.P8_31 # UART5_CTSN - GPIO_10
|
||||
P8_32 = pin.P8_32 # UART5_RTSN - GPIO_11
|
||||
P8_33 = pin.P8_33 # UART4_RTSN - GPIO_9
|
||||
P8_34 = pin.P8_34 # UART3_RTSN - GPIO_81
|
||||
P8_35 = pin.P8_35 # UART4_CTSN - GPIO_8
|
||||
P8_36 = pin.P8_36 # UART3_CTSN - GPIO_80
|
||||
P8_37 = pin.P8_37 # UART5_TXD - GPIO_78
|
||||
P8_38 = pin.P8_38 # UART5_RXD - GPIO_79
|
||||
P8_39 = pin.P8_39 # GPIO2_12 - GPIO_76
|
||||
P8_40 = pin.P8_40 # GPIO2_13 - GPIO_77
|
||||
P8_41 = pin.P8_41 # GPIO2_10 - GPIO_74
|
||||
P8_42 = pin.P8_42 # GPIO2_11 - GPIO_75
|
||||
P8_43 = pin.P8_43 # GPIO2_8 - GPIO_72
|
||||
P8_44 = pin.P8_44 # GPIO2_9 - GPIO_73
|
||||
P8_45 = pin.P8_45 # GPIO2_6 - GPIO_70
|
||||
P8_46 = pin.P8_46 # GPIO2_7 - GPIO_71
|
||||
|
||||
# P9_1 = DGND # DGND
|
||||
# P9_2 = DGND # DGND
|
||||
# P9_3 = VDD_3V3 # VDD_3V3
|
||||
# P9_4 = VDD_3V3 # VDD_3V3
|
||||
# P9_5 = VDD_5V # VDD_5V
|
||||
# P9_6 = VDD_5V # VDD_5V
|
||||
# P9_7 = SYS_5V # SYS_5V
|
||||
# P9_8 = SYS_5V # SYS_5V
|
||||
# P9_9 = PWR_BUT # PWR_BUT
|
||||
# P9_10 = SYS_RESETN # SYS_RESETn
|
||||
P9_11 = pin.P9_11 # UART4_RXD - GPIO_30
|
||||
P9_12 = pin.P9_12 # GPIO1_28 - GPIO_60
|
||||
P9_13 = pin.P9_13 # UART4_TXD - GPIO_31
|
||||
P9_14 = pin.P9_14 # EHRPWM1A - GPIO_50
|
||||
P9_15 = pin.P9_15 # GPIO1_16 - GPIO_48
|
||||
P9_16 = pin.P9_16 # EHRPWM1B - GPIO_51
|
||||
P9_17 = pin.P9_17 # I2C1_SCL - GPIO_5
|
||||
P9_18 = pin.P9_18 # I2C1_SDA - GPIO_4
|
||||
P9_19 = pin.P9_19 # I2C2_SCL - GPIO_13
|
||||
P9_20 = pin.P9_20 # I2C2_SDA - GPIO_12
|
||||
P9_21 = pin.P9_21 # UART2_TXD - GPIO_3
|
||||
P9_22 = pin.P9_22 # UART2_RXD - GPIO_2
|
||||
P9_23 = pin.P9_23 # GPIO1_17 - GPIO_49
|
||||
P9_24 = pin.P9_24 # UART1_TXD - GPIO_15
|
||||
P9_25 = pin.P9_25 # GPIO3_21 - GPIO_117
|
||||
P9_26 = pin.P9_26 # UART1_RXD - GPIO_14
|
||||
P9_27 = pin.P9_27 # GPIO3_19 - GPIO_115
|
||||
P9_28 = pin.P9_28 # SPI1_CS0 - GPIO_113
|
||||
P9_29 = pin.P9_29 # SPI1_D0 - GPIO_111
|
||||
P9_30 = pin.P9_30 # SPI1_D1 - GPIO_112
|
||||
P9_31 = pin.P9_31 # SPI1_SCLK - GPIO_110
|
||||
# P9_32 = VDD_ADC # VDD_ADC
|
||||
# P9_33 = AIN4 # AIN4
|
||||
# P9_34 = GNDA_ADC # GNDA_ADC
|
||||
# P9_35 = AIN6 # AIN6
|
||||
# P9_36 = AIN5 # AIN5
|
||||
# P9_37 = AIN2 # AIN2
|
||||
# P9_38 = AIN3 # AIN3
|
||||
# P9_39 = AIN0 # AIN0
|
||||
# P9_40 = AIN1 # AIN1
|
||||
P9_41 = pin.P9_41 # CLKOUT2 - GPIO_20
|
||||
P9_42 = pin.P9_42 # GPIO0_7 - GPIO_7
|
||||
# P9_43 = DGND # DGND
|
||||
# P9_44 = DGND # DGND
|
||||
# P9_45 = DGND # DGND
|
||||
# P9_46 = DGND # DGND
|
||||
|
||||
# common to all beagles
|
||||
LED_USR0 = pin.USR0
|
||||
LED_USR1 = pin.USR1
|
||||
LED_USR2 = pin.USR2
|
||||
LED_USR3 = pin.USR3
|
||||
|
||||
# I2C and SPI pins from:
|
||||
# src/adafruit_blinka/board/raspi_40pin.py
|
||||
# SDA = pin.SDA
|
||||
# SCL = pin.SCL
|
||||
# CE1 = pin.D7
|
||||
# CE0 = pin.D8
|
||||
# MISO = pin.D9
|
||||
# MOSI = pin.D10
|
||||
# SCLK = pin.D11
|
||||
# SCK = pin.D11
|
||||
# TXD = pin.D14
|
||||
# RXD = pin.D15
|
||||
# MISO_1 = pin.D19
|
||||
# MOSI_1 = pin.D20
|
||||
# SCLK_1 = pin.D21
|
||||
# SCK_1 = pin.D21
|
||||
|
||||
SDA = pin.I2C2_SDA # P9_19
|
||||
SCL = pin.I2C2_SCL # P9_20
|
||||
|
||||
# Refer to header default pin modes
|
||||
# http://beagleboard.org/static/images/cape-headers.png
|
||||
#
|
||||
# P9_17 (SPI0_CSO => CE0) enables peripheral device
|
||||
# P9_18 (SPI0_D1 => MOSI) outputs data to peripheral device
|
||||
# P9_21 (SPIO_DO => MISO) receives data from peripheral device
|
||||
# P9_22 (SPI0_SCLK => SCLK) outputs clock signal
|
||||
#
|
||||
# Use config-pin to set pin mode for SPI pins
|
||||
# https://github.com/beagleboard/bb.org-overlays/tree/master/tools/beaglebone-universal-io
|
||||
# config-pin p9.17 spi_cs
|
||||
# config-pin p9.18 spi
|
||||
# config-pin p9.21 spi
|
||||
# config-pin p9.22 spi_sclk
|
||||
#
|
||||
CE0 = pin.SPI0_CS0 # P9_17
|
||||
MOSI = pin.SPI0_D1 # P9_18
|
||||
MISO = pin.SPI0_D0 # P9_21
|
||||
SCLK = pin.SPI0_SCLK # P9_22
|
||||
# CircuitPython naming convention for SPI Clock
|
||||
SCK = SCLK
|
||||
|
||||
# Pins for SPI1
|
||||
# refer to:
|
||||
# http://beagleboard.org/static/images/cape-headers-spi.png
|
||||
#
|
||||
# CE1 P9.28 SPI1_CS0
|
||||
# MISO_1 P9.29 SPI1_D0
|
||||
# MOSI_1 P9.30 SPI1_D1
|
||||
# SCLK_1 P9.31 SPI_SCLK
|
||||
#
|
||||
# SPI1 conflicts with HDMI Audio (McASP)
|
||||
#
|
||||
# Refer to:
|
||||
# https://elinux.org/Beagleboard:BeagleBoneBlack_Debian#U-Boot_Overlays
|
||||
#
|
||||
# To Disable HDMI AUDIO, uncomment this line in /boot/uEnv.txt:
|
||||
# disable_uboot_overlay_audio=1
|
||||
#
|
||||
# Set pin modes for SPI1 with:
|
||||
#
|
||||
# config-pin p9.28 spi1_cs
|
||||
# config-pin p9.29 spi1
|
||||
# config-pin p9.30 spi1
|
||||
# config-pin p9.31 spi_sclk
|
||||
CE1 = pin.SPI1_CS0 # P9_28
|
||||
MOSI_1 = pin.SPI1_D0 # P9_29
|
||||
MISO_1 = pin.SPI1_D1 # P9_30
|
||||
SCLK_1 = pin.SPI1_SCLK # P9_31
|
||||
# CircuitPython naming convention for SPI Clock
|
||||
SCK_1 = SCLK_1
|
||||
138
src/adafruit_blinka/board/beagleboard/beaglebone_pocketbeagle.py
Normal file
138
src/adafruit_blinka/board/beagleboard/beaglebone_pocketbeagle.py
Normal file
|
|
@ -0,0 +1,138 @@
|
|||
"""
|
||||
Pin definitions for the Beaglebone PocketBeagle.
|
||||
|
||||
based on
|
||||
https://github.com/beagleboard/pocketbeagle/wiki/System-Reference-Manual#figure-42-expansion-header-popular-functions---color-coded
|
||||
"""
|
||||
from adafruit_blinka.microcontroller.am335x import pin
|
||||
|
||||
# initial pins, to mimic bonescript demo
|
||||
# PocketBeagle
|
||||
# P1_1 = SYS VIN # VIN_AC
|
||||
P1_2 = pin.P1_2 # GPIO2_23 - GPIO_87
|
||||
P1_3 = pin.P1_3 # USB1_VBUS_OUT - (silkscreen: USB1 V_EN)
|
||||
P1_4 = pin.P1_4 # GPIO2_25 - GPIO_89
|
||||
# P1_5 = USB VBUS # USB1_VBUS_IN
|
||||
P1_6 = pin.P1_6 # SPI0_CS0 - GPIO_5
|
||||
# P1_7 = USB VIN # VIN-USB
|
||||
P1_8 = pin.P1_8 # SPI0_SCLK - GPIO_2
|
||||
# P1_9 = USB1 DN # USB1-DN
|
||||
P1_10 = pin.P1_10 # SPI0_D0 - GPIO_3
|
||||
# P1_11 = USB1 DP # USB1-DP
|
||||
P1_12 = pin.P1_12 # SPI0_D1 - GPIO_4
|
||||
# P1_13 = USB1 ID # USB1-ID
|
||||
# P1_14 = SYS 3.3V # VOUT-3.3V
|
||||
# P1_15 = SYS GND # GND
|
||||
# P1_16 = SYS GND # GND
|
||||
# P1_17 = AIN 1.8V REF- # VREFN
|
||||
# P1_18 = AIN 1.8V REF+ # VREFP
|
||||
P1_19 = pin.P1_19 # AIN0
|
||||
P1_20 = pin.P1_20 # GPIO0_20 - GPIO_20
|
||||
P1_21 = pin.P1_21 # AIN1
|
||||
# P1_22 = SYS GND # GND
|
||||
P1_23 = pin.P1_23 # AIN2
|
||||
# P1_22 = SYS VOUT # VOUT-5V
|
||||
P1_25 = pin.P1_25 # AIN3
|
||||
P1_26 = pin.P1_26 # I2C2_SDA - GPIO_12
|
||||
P1_27 = pin.P1_27 # AIN4
|
||||
P1_28 = pin.P1_28 # I2C2_SCL - GPIO_13
|
||||
P1_29 = pin.P1_29 # GPIO3_21 - GPIO_117
|
||||
P1_30 = pin.P1_30 # UART0_TXD - GPIO_43
|
||||
P1_31 = pin.P1_31 # GPIO3_18 - GPIO_114
|
||||
P1_32 = pin.P1_32 # UART0_RXD - GPIO_42
|
||||
P1_33 = pin.P1_33 # GPIO3_15 - GPIO_111 - EHRPWM0B (ehrpwm.0:1)
|
||||
P1_34 = pin.P1_34 # GPIO0_26 - GPIO_26
|
||||
P1_35 = pin.P1_35 # GPIO2_24 - GPIO_88
|
||||
P1_36 = pin.P1_36 # EHRPWM0A - GPIO_110 - EHRPWM0A (ehrpwm.0:0)
|
||||
|
||||
|
||||
P2_1 = pin.P2_1 # EHRPWM1A - GPIO_50
|
||||
P2_2 = pin.P2_2 # GPIO1_27 - GPIO_59
|
||||
P2_3 = pin.P2_3 # GPIO0_23 - GPIO_23
|
||||
P2_4 = pin.P2_4 # GPIO1_26 - GPIO_58
|
||||
P2_5 = pin.P2_5 # UART4_RXD - GPIO_30
|
||||
P2_6 = pin.P2_6 # GPIO1_25 - GPIO_57
|
||||
P2_7 = pin.P2_7 # UART4_TXD - GPIO_31
|
||||
P2_8 = pin.P2_8 # GPIO1_28 - GPIO_60
|
||||
P2_9 = pin.P2_9 # I2C1_SCL - GPIO_15
|
||||
P2_10 = pin.P2_10 # GPIO1_20 - GPIO_52
|
||||
P2_11 = pin.P2_11 # I2C1_SDA - GPIO_14
|
||||
# P2_12 = SYS PWR BTN # POWER_BUTTON
|
||||
# P2_13 = SYS VOUT # VOUT-5V
|
||||
# P2_14 = BAT VIN # BAT-VIN
|
||||
# P2_15 = SYS GND # GND
|
||||
# P2_16 = BAT TEMP # BAT-TEMP
|
||||
P2_17 = pin.P2_17 # GPIO2_1 - GPIO_65
|
||||
P2_18 = pin.P2_18 # GPIO1_15 - GPIO_47
|
||||
P2_19 = pin.P2_19 # GPIO0_27 - GPIO_27
|
||||
P2_20 = pin.P2_20 # GPIO2_0 - GPIO_64
|
||||
# P2_21 = SYS GND # GND
|
||||
P2_22 = pin.P2_22 # GPIO1_14 - GPIO_46
|
||||
# P2_23 = SYS 3.3V # VOUT-3.3V
|
||||
P2_24 = pin.P2_24 # GPIO1_12 - GPIO_44
|
||||
P2_25 = pin.P2_25 # SPI1_CS0 - GPIO_41
|
||||
# P2_26 = SYS NRST # RESET#
|
||||
P2_27 = pin.P2_27 # SPI1_D0 - GPIO_40
|
||||
P2_28 = pin.P2_28 # GPIO3_20 - GPIO_116
|
||||
P2_29 = pin.P2_29 # SPI1_SCLK - GPIO_7
|
||||
P2_30 = pin.P2_30 # GPIO3_17 - GPIO_113
|
||||
P2_31 = pin.P2_31 # SPI1_CS1 - GPIO_19
|
||||
P2_32 = pin.P2_32 # GPIO3_16 - GPIO_112
|
||||
P2_33 = pin.P2_33 # GPIO1_13 - GPIO_45
|
||||
P2_34 = pin.P2_34 # GPIO3_19 - GPIO_115
|
||||
P2_35 = pin.P2_35 # GPIO2_22 - GPIO_86
|
||||
P2_36 = pin.P2_36 # AIN7
|
||||
|
||||
# common to all beagles
|
||||
LED_USR0 = pin.USR0
|
||||
LED_USR1 = pin.USR1
|
||||
LED_USR2 = pin.USR2
|
||||
LED_USR3 = pin.USR3
|
||||
|
||||
##########
|
||||
# Refer to header default pin modes
|
||||
# https://raw.githubusercontent.com/wiki/beagleboard/pocketbeagle/images/PocketBeagle_pinout.png
|
||||
|
||||
# I2C1 pins
|
||||
SDA_1 = pin.I2C1_SDA # P2_11 data signal
|
||||
SCL_1 = pin.I2C1_SCL # P2_9 clock signal
|
||||
# for example compatibility we create a alias
|
||||
SDA = SDA_1
|
||||
SCL = SCL_1
|
||||
|
||||
# I2C2 pins
|
||||
SDA_2 = pin.I2C2_SDA # P1_26 data signal
|
||||
SCL_2 = pin.I2C2_SCL # P1_28 clock signal
|
||||
|
||||
# SPI0 pins
|
||||
CE0 = pin.SPI0_CS0 # P1_6 - enables peripheral device
|
||||
SCLK = pin.SPI0_SCLK # P1_12 - outputs data to peripheral device
|
||||
MOSI = pin.SPI0_D1 # P1_10 - receives data from peripheral device
|
||||
MISO = pin.SPI0_D0 # P1_8 - outputs clock signal
|
||||
# CircuitPython naming convention for SPI Clock
|
||||
SCK = SCLK
|
||||
|
||||
# SPI1 pins
|
||||
CE0_1 = pin.SPI1_CS1 # P2_31 - enables peripheral device
|
||||
SCLK_1 = pin.SPI1_SCLK # P2_25 - outputs data to peripheral device
|
||||
MOSI_1 = pin.SPI1_D1 # P2_27 - receives data from peripheral device
|
||||
MISO_1 = pin.SPI1_D0 # P2_29 - outputs clock signal
|
||||
# CircuitPython naming convention for SPI Clock
|
||||
SCK_1 = SCLK_1
|
||||
|
||||
|
||||
# UART0
|
||||
TX_0 = pin.UART0_TXD # P1_30
|
||||
RX_0 = pin.UART0_RXD # P1_32
|
||||
# create alias for most of the examples
|
||||
TX = TX_0
|
||||
RX = RX_0
|
||||
|
||||
# UART2
|
||||
# pins already in use by SPI0
|
||||
# TX_2 = pin.UART2_TXD # P1_8
|
||||
# RX_2 = pin.UART2_RXD # P1_10
|
||||
|
||||
# UART4
|
||||
TX_4 = pin.UART4_TXD # P2_7
|
||||
RX_4 = pin.UART4_RXD # P2_5
|
||||
|
|
@ -1,118 +0,0 @@
|
|||
"""Pin definitions for the Beaglebone Black."""
|
||||
from adafruit_blinka.microcontroller.am335x import pin
|
||||
|
||||
# initial pins, to mimic bonescript demo
|
||||
P8_3 = pin.P8_3
|
||||
P8_4 = pin.P8_4
|
||||
P8_5 = pin.P8_5
|
||||
P8_6 = pin.P8_6
|
||||
P8_7 = pin.P8_7
|
||||
P8_8 = pin.P8_8
|
||||
P8_9 = pin.P8_9
|
||||
P8_10 = pin.P8_10
|
||||
P8_11 = pin.P8_11
|
||||
P8_12 = pin.P8_12
|
||||
P8_13 = pin.P8_13
|
||||
P8_14 = pin.P8_14
|
||||
P8_15 = pin.P8_15
|
||||
P8_16 = pin.P8_16
|
||||
P8_17 = pin.P8_17
|
||||
P8_18 = pin.P8_18
|
||||
P8_19 = pin.P8_19
|
||||
P8_20 = pin.P8_20
|
||||
P8_21 = pin.P8_21
|
||||
P8_22 = pin.P8_22
|
||||
P8_23 = pin.P8_23
|
||||
P8_24 = pin.P8_24
|
||||
P8_25 = pin.P8_25
|
||||
P8_26 = pin.P8_26
|
||||
P8_27 = pin.P8_27
|
||||
P8_28 = pin.P8_28
|
||||
P8_29 = pin.P8_29
|
||||
P8_30 = pin.P8_30
|
||||
P8_31 = pin.P8_31
|
||||
P8_32 = pin.P8_32
|
||||
P8_33 = pin.P8_33
|
||||
P8_34 = pin.P8_34
|
||||
P8_35 = pin.P8_35
|
||||
P8_36 = pin.P8_36
|
||||
P8_37 = pin.P8_37
|
||||
P8_38 = pin.P8_38
|
||||
P8_39 = pin.P8_39
|
||||
P8_40 = pin.P8_40
|
||||
P8_41 = pin.P8_41
|
||||
P8_42 = pin.P8_42
|
||||
P8_43 = pin.P8_43
|
||||
P8_44 = pin.P8_44
|
||||
P8_45 = pin.P8_45
|
||||
P8_46 = pin.P8_46
|
||||
P9_11 = pin.P9_11
|
||||
P9_12 = pin.P9_12
|
||||
P9_13 = pin.P9_13
|
||||
P9_14 = pin.P9_14
|
||||
P9_15 = pin.P9_15
|
||||
P9_16 = pin.P9_16
|
||||
P9_17 = pin.P9_17
|
||||
P9_18 = pin.P9_18
|
||||
P9_19 = pin.P9_19
|
||||
P9_20 = pin.P9_20
|
||||
P9_21 = pin.P9_21
|
||||
P9_22 = pin.P9_22
|
||||
P9_23 = pin.P9_23
|
||||
P9_24 = pin.P9_24
|
||||
P9_25 = pin.P9_25
|
||||
P9_26 = pin.P9_26
|
||||
P9_27 = pin.P9_27
|
||||
P9_28 = pin.P9_28
|
||||
P9_29 = pin.P9_29
|
||||
P9_30 = pin.P9_30
|
||||
P9_31 = pin.P9_31
|
||||
P9_41 = pin.P9_41
|
||||
P9_42 = pin.P9_42
|
||||
|
||||
LED_USR0 = pin.USR0
|
||||
LED_USR1 = pin.USR1
|
||||
LED_USR2 = pin.USR2
|
||||
LED_USR3 = pin.USR3
|
||||
|
||||
# I2C and SPI pins from:
|
||||
# src/adafruit_blinka/board/raspi_40pin.py
|
||||
# SDA = pin.SDA
|
||||
# SCL = pin.SCL
|
||||
# CE1 = pin.D7
|
||||
# CE0 = pin.D8
|
||||
# MISO = pin.D9
|
||||
# MOSI = pin.D10
|
||||
# SCLK = pin.D11
|
||||
# SCK = pin.D11
|
||||
# TXD = pin.D14
|
||||
# RXD = pin.D15
|
||||
# MISO_1 = pin.D19
|
||||
# MOSI_1 = pin.D20
|
||||
# SCLK_1 = pin.D21
|
||||
# SCK_1 = pin.D21
|
||||
|
||||
SDA = pin.SDA
|
||||
SCL = pin.SCL
|
||||
|
||||
# Refer to header default pin modes
|
||||
# http://beagleboard.org/static/images/cape-headers.png
|
||||
# P9_17 (SPI0_CSO => CE0) enables peripheral device
|
||||
# P9_18 (SPI0_D1 => MOSI) outputs data to peripheral device
|
||||
# P9_21 (SPIO_DO => MISO) receives data from peripheral device
|
||||
# P9_22 (SPI0_SCLK => SCLK) outputs clock signal
|
||||
CE0 = pin.CE0
|
||||
MOSI = pin.MOSI
|
||||
MISO = pin.MISO
|
||||
SCLK = pin.SCLK
|
||||
#CircuitPython naming convention for SPI Clock
|
||||
SCK = pin.SCK
|
||||
|
||||
# SPI1 pins
|
||||
# http://beagleboard.org/static/images/cape-headers-spi.png
|
||||
CE1 = pin.CE1
|
||||
MOSI_1 = pin.MOSI_1
|
||||
MISO_1 = pin.MISO_1
|
||||
SCLK_1 = pin.SCLK_1
|
||||
#CircuitPython naming convention for SPI Clock
|
||||
SCK_1 = pin.SCK_1
|
||||
21
src/adafruit_blinka/board/binho_nova.py
Normal file
21
src/adafruit_blinka/board/binho_nova.py
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
"""Pin definitions for the Binho Nova"""
|
||||
from adafruit_blinka.microcontroller.nova import pin
|
||||
|
||||
IO0 = pin.IO0
|
||||
IO1 = pin.IO1
|
||||
IO2 = pin.IO2
|
||||
IO3 = pin.IO3
|
||||
IO4 = pin.IO4
|
||||
|
||||
TX = IO4
|
||||
RX = IO3
|
||||
|
||||
SDA = pin.SDA
|
||||
SCL = pin.SCL
|
||||
|
||||
SCK = pin.SCK
|
||||
SCLK = pin.SCLK
|
||||
MOSI = pin.MOSI
|
||||
MISO = pin.MISO
|
||||
SS0 = pin.SS0
|
||||
SS1 = pin.SS1
|
||||
33
src/adafruit_blinka/board/clockworkcpi3.py
Normal file
33
src/adafruit_blinka/board/clockworkcpi3.py
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
"""Pin definitions for the Clockwork Pi (CPI3) board."""
|
||||
|
||||
from adafruit_blinka.microcontroller.allwinner.a33 import pin
|
||||
|
||||
# Clockwork Pi GPIO port (DEBUG section in datasheet)
|
||||
|
||||
# Type Pin # (ext.) Pin # (Package) Function 1 Function 2 Pin # (sysfs) Color
|
||||
# 3V0 1 blue
|
||||
# GPIO 2 PB0 UART0/2_TX PB-EINT0 32 green
|
||||
# GPIO 3 PB1 UART0/2_RX PB-EINT1 33 yellow
|
||||
# GND 4 white
|
||||
# GPIO 5 PH5 I2C1-SDA 229 red
|
||||
# GPIO 6 PH4 I2C1-SCL 228 brown
|
||||
# GND 7 black
|
||||
# GPIO 8 PH6 UART3-TX SPI0-CS 230 blue
|
||||
# GPIO 9 PH7 UART3-RX SPI0-CLK 231 green
|
||||
# GPIO 10 PH9 UART3-CTS SPI0-MISO 233 yellow
|
||||
# GPIO 11 PH8 UART3-RTS SPI0-MOSI 232 white
|
||||
# GND 12 red
|
||||
# 5V0 13 brown
|
||||
# 5V0 14 black
|
||||
|
||||
PB0 = pin.PB0
|
||||
PB1 = pin.PB1
|
||||
TX = PB0
|
||||
RX = PB1
|
||||
|
||||
SCL = pin.PH4
|
||||
SDA = pin.PH5
|
||||
|
||||
SCLK = pin.PH7
|
||||
MOSI = pin.PH8
|
||||
MISO = pin.PH9
|
||||
24
src/adafruit_blinka/board/coral_dev_board.py
Normal file
24
src/adafruit_blinka/board/coral_dev_board.py
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
"""Pin definitions for the Coral Dev Board."""
|
||||
|
||||
from adafruit_blinka.microcontroller.nxp_imx8m import pin
|
||||
|
||||
# Board name = RPI name [= alias] = pin name
|
||||
I2C2_SDA = D2 = SDA = pin.I2C2_SDA
|
||||
I2C2_SCL = D3 = SCL = pin.I2C2_SCL
|
||||
|
||||
PWM1 = D12 = pin.PWM1
|
||||
PWM2 = D13 = pin.PWM2
|
||||
PWM3 = D22 = pin.PWM3
|
||||
|
||||
GPIO_P13 = D27 = pin.GPIO6
|
||||
GPIO_P16 = D23 = pin.GPIO73
|
||||
GPIO_P18 = D24 = pin.GPIO138
|
||||
GPIO_P29 = D5 = pin.GPIO7
|
||||
GPIO_P31 = D6 = pin.GPIO8
|
||||
GPIO_P36 = D16 = pin.GPIO141
|
||||
GPIO_P37 = D26 = pin.GPIO77
|
||||
|
||||
ECSPI1_MISO = D9 = MISO = pin.ECSPI1_MISO
|
||||
ECSPI1_MOSI = D10 = MOSI = pin.ECSPI1_MOSI
|
||||
ECSPI1_SCLK = D11 = SCLK = SCK = pin.ECSPI1_SCLK
|
||||
ECSPI1_SS0 = D8 = SS0 = pin.ECSPI1_SS0
|
||||
38
src/adafruit_blinka/board/coral_dev_board_mini.py
Normal file
38
src/adafruit_blinka/board/coral_dev_board_mini.py
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
"""Pin definitions for the Coral Dev Board Mini."""
|
||||
|
||||
from adafruit_blinka.microcontroller.mt8167 import pin
|
||||
|
||||
# Board name = RPI name [= alias] = pin name
|
||||
GPIO22 = D4 = pin.GPIO22 # Pin 7
|
||||
GPIO9 = D17 = pin.GPIO9 # Pin 11
|
||||
GPIO36 = D18 = pin.GPIO36 # Pin 12
|
||||
GPIO10 = D27 = pin.GPIO10 # Pin 13
|
||||
GPIO0 = D23 = pin.GPIO0 # Pin 16
|
||||
GPIO1 = D24 = pin.GPIO1 # Pin 18
|
||||
GPIO7 = D25 = pin.GPIO7 # Pin 22
|
||||
GPIO8 = D7 = pin.GPIO8 # Pin 26
|
||||
GPIO37 = D19 = pin.GPIO37 # Pin 35
|
||||
GPIO13 = D16 = pin.GPIO13 # Pin 36
|
||||
GPIO45 = D26 = pin.GPIO45 # Pin 37
|
||||
GPIO38 = D20 = pin.GPIO38 # Pin 38
|
||||
GPIO39 = D21 = pin.GPIO39 # Pin 40
|
||||
|
||||
I2C1_SDA = D2 = SDA1 = pin.I2C1_SDA # Pin 3
|
||||
I2C1_SCL = D3 = SCL1 = pin.I2C1_SCL # Pin 5
|
||||
I2C2_SDA = D0 = SDA2 = pin.I2C2_SDA # Pin 27
|
||||
I2C2_SCL = D1 = SCL2 = pin.I2C2_SCL # Pin 28
|
||||
|
||||
PWM_A = D12 = pin.PWM_A # Pin 32
|
||||
PWM_B = D13 = pin.PWM_B # Pin 33
|
||||
PWM_C = D22 = pin.PWM_C # Pin 15
|
||||
|
||||
SPI_MO = D10 = MOSI = pin.SPI_MO # Pin 19
|
||||
SPI_MI = D9 = MISO = pin.SPI_MI # Pin 21
|
||||
SPI_CLK = D11 = SCLK = pin.SPI_CLK # Pin 23
|
||||
SPI_CSB = D8 = CS0 = pin.SPI_CSB # Pin 24
|
||||
|
||||
# UART currently not supported
|
||||
GPIO63 = D14 = pin.GPIO63 # UART0_TX, Pin 8
|
||||
GPIO62 = D15 = pin.GPIO62 # UART0_RX, Pin 10
|
||||
GPIO65 = D5 = pin.GPIO65 # UART1_TX, Pin 29
|
||||
GPIO64 = D6 = pin.GPIO64 # UART1_RX, Pin 31
|
||||
42
src/adafruit_blinka/board/dragonboard_410c.py
Normal file
42
src/adafruit_blinka/board/dragonboard_410c.py
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
"""Pin definitions for the Dragonboard 410c."""
|
||||
|
||||
from adafruit_blinka.microcontroller.snapdragon.apq8016 import pin
|
||||
|
||||
GPIO_A = pin.GPIO_36
|
||||
GPIO_B = pin.GPIO_12
|
||||
GPIO_C = pin.GPIO_13
|
||||
GPIO_D = pin.GPIO_69
|
||||
GPIO_E = pin.GPIO_115
|
||||
GPIO_F = pin.PM_MPP_4
|
||||
GPIO_G = pin.GPIO_24
|
||||
GPIO_H = pin.GPIO_25
|
||||
GPIO_I = pin.GPIO_35
|
||||
GPIO_J = pin.GPIO_34
|
||||
GPIO_K = pin.GPIO_28
|
||||
GPIO_L = pin.GPIO_33
|
||||
|
||||
GPIO_36 = pin.GPIO_36
|
||||
GPIO_12 = pin.GPIO_12
|
||||
GPIO_13 = pin.GPIO_13
|
||||
GPIO_69 = pin.GPIO_69
|
||||
GPIO_115 = pin.GPIO_115
|
||||
GPIO_4 = pin.PM_MPP_4
|
||||
GPIO_24 = pin.GPIO_24
|
||||
GPIO_25 = pin.GPIO_25
|
||||
GPIO_35 = pin.GPIO_35
|
||||
GPIO_34 = pin.GPIO_34
|
||||
GPIO_28 = pin.GPIO_28
|
||||
GPIO_33 = pin.GPIO_33
|
||||
|
||||
SDA = pin.I2C0_SDA
|
||||
SCL = pin.I2C0_SCL
|
||||
|
||||
I2C0_SDA = pin.I2C0_SDA
|
||||
I2C0_SCL = pin.I2C0_SCL
|
||||
I2C1_SDA = pin.I2C1_SDA
|
||||
I2C1_SCL = pin.I2C1_SCL
|
||||
|
||||
SCLK = pin.SPI0_SCLK
|
||||
MOSI = pin.SPI0_MOSI
|
||||
MISO = pin.SPI0_MISO
|
||||
SPI_CS = pin.SPI0_CS
|
||||
23
src/adafruit_blinka/board/ftdi_ft232h.py
Normal file
23
src/adafruit_blinka/board/ftdi_ft232h.py
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
"""Pin definitions for the FTDI FT232H"""
|
||||
from adafruit_blinka.microcontroller.ft232h import pin
|
||||
|
||||
D4 = pin.D4
|
||||
D5 = pin.D5
|
||||
D6 = pin.D6
|
||||
D7 = pin.D7
|
||||
C0 = pin.C0
|
||||
C1 = pin.C1
|
||||
C2 = pin.C2
|
||||
C3 = pin.C3
|
||||
C4 = pin.C4
|
||||
C5 = pin.C5
|
||||
C6 = pin.C6
|
||||
C7 = pin.C7
|
||||
|
||||
SDA = pin.SDA
|
||||
SCL = pin.SCL
|
||||
|
||||
SCK = pin.SCK
|
||||
SCLK = pin.SCLK
|
||||
MOSI = pin.MOSI
|
||||
MISO = pin.MISO
|
||||
|
|
@ -1,11 +1,18 @@
|
|||
"""Pin definitions for the Giant Board"""
|
||||
from adafruit_blinka.microcontroller.sama5 import pin
|
||||
|
||||
PD23 = pin.PD23
|
||||
AD4 = pin.PD23
|
||||
PD21 = pin.PD21
|
||||
AD2 = pin.PD21
|
||||
PD20 = pin.PD20
|
||||
AD1 = pin.PD20
|
||||
PD24 = pin.PD24
|
||||
AD5 = pin.PD24
|
||||
PD22 = pin.PD22
|
||||
AD3 = pin.PD22
|
||||
PD19 = pin.PD19
|
||||
AD0 = pin.PD19
|
||||
PA14 = pin.PA14
|
||||
SCK = pin.PA14
|
||||
SCLK = pin.PA14
|
||||
|
|
@ -21,9 +28,13 @@ TX = pin.PD3
|
|||
PD13 = pin.PD13
|
||||
PD31 = pin.PD31
|
||||
PB0 = pin.PB0
|
||||
PWM1 = pin.PB0
|
||||
PB7 = pin.PB7
|
||||
PWM3 = pin.PB7
|
||||
PB1 = pin.PB1
|
||||
PWML1 = pin.PB1
|
||||
PB5 = pin.PB5
|
||||
PWM2 = pin.PB5
|
||||
PB3 = pin.PB3
|
||||
PC0 = pin.PC0
|
||||
SCL = pin.PC0
|
||||
|
|
|
|||
94
src/adafruit_blinka/board/greatfet_one.py
Normal file
94
src/adafruit_blinka/board/greatfet_one.py
Normal file
|
|
@ -0,0 +1,94 @@
|
|||
"""Pin definitions for the GreatFET One"""
|
||||
from adafruit_blinka.microcontroller.nxp_lpc4330 import pin
|
||||
|
||||
J1_P3 = pin.J1_P3
|
||||
J1_P4 = pin.J1_P4
|
||||
J1_P5 = pin.J1_P5
|
||||
J1_P6 = pin.J1_P6
|
||||
J1_P7 = pin.J1_P7
|
||||
J1_P8 = pin.J1_P8
|
||||
J1_P9 = pin.J1_P9
|
||||
J1_P10 = pin.J1_P10
|
||||
J1_P12 = pin.J1_P12
|
||||
J1_P13 = pin.J1_P13
|
||||
J1_P14 = pin.J1_P14
|
||||
J1_P15 = pin.J1_P15
|
||||
J1_P16 = pin.J1_P16
|
||||
J1_P17 = pin.J1_P17
|
||||
J1_P18 = pin.J1_P18
|
||||
J1_P19 = pin.J1_P19
|
||||
J1_P20 = pin.J1_P20
|
||||
J1_P21 = pin.J1_P21
|
||||
J1_P22 = pin.J1_P22
|
||||
J1_P23 = pin.J1_P23
|
||||
J1_P24 = pin.J1_P24
|
||||
J1_P25 = pin.J1_P25
|
||||
J1_P26 = pin.J1_P26
|
||||
J1_P27 = pin.J1_P27
|
||||
J1_P28 = pin.J1_P28
|
||||
J1_P29 = pin.J1_P29
|
||||
J1_P30 = pin.J1_P30
|
||||
J1_P31 = pin.J1_P31
|
||||
J1_P32 = pin.J1_P32
|
||||
J1_P33 = pin.J1_P33
|
||||
J1_P34 = pin.J1_P34
|
||||
J1_P35 = pin.J1_P35
|
||||
J1_P37 = pin.J1_P37
|
||||
J1_P39 = pin.J1_P39
|
||||
J1_P40 = pin.J1_P40
|
||||
|
||||
# J2 Header Pins
|
||||
J2_P3 = pin.J2_P3
|
||||
J2_P4 = pin.J2_P4
|
||||
J2_P5 = pin.J2_P5
|
||||
J2_P6 = pin.J2_P6
|
||||
J2_P7 = pin.J2_P7
|
||||
J2_P8 = pin.J2_P8
|
||||
J2_P9 = pin.J2_P9
|
||||
J2_P10 = pin.J2_P10
|
||||
J2_P13 = pin.J2_P13
|
||||
J2_P14 = pin.J2_P14
|
||||
J2_P15 = pin.J2_P15
|
||||
J2_P16 = pin.J2_P16
|
||||
J2_P18 = pin.J2_P18
|
||||
J2_P19 = pin.J2_P19
|
||||
J2_P20 = pin.J2_P20
|
||||
J2_P22 = pin.J2_P22
|
||||
J2_P23 = pin.J2_P23
|
||||
J2_P24 = pin.J2_P24
|
||||
J2_P25 = pin.J2_P25
|
||||
J2_P27 = pin.J2_P27
|
||||
J2_P28 = pin.J2_P28
|
||||
J2_P29 = pin.J2_P29
|
||||
J2_P30 = pin.J2_P30
|
||||
J2_P31 = pin.J2_P31
|
||||
J2_P33 = pin.J2_P33
|
||||
J2_P34 = pin.J2_P34
|
||||
J2_P35 = pin.J2_P35
|
||||
J2_P36 = pin.J2_P36
|
||||
J2_P37 = pin.J2_P37
|
||||
J2_P38 = pin.J2_P38
|
||||
|
||||
# Bonus Row Pins
|
||||
J7_P2 = pin.J7_P2
|
||||
J7_P3 = pin.J7_P3
|
||||
J7_P6 = pin.J7_P6
|
||||
J7_P7 = pin.J7_P7
|
||||
J7_P8 = pin.J7_P8
|
||||
J7_P13 = pin.J7_P13
|
||||
J7_P14 = pin.J7_P14
|
||||
J7_P15 = pin.J7_P15
|
||||
J7_P16 = pin.J7_P16
|
||||
J7_P17 = pin.J7_P17
|
||||
J7_P18 = pin.J7_P18
|
||||
|
||||
SDA = pin.SDA
|
||||
SCL = pin.SCL
|
||||
|
||||
SCK = pin.SCK
|
||||
SCLK = SCK
|
||||
MOSI = pin.MOSI
|
||||
MISO = pin.MISO
|
||||
|
||||
TX = pin.TX
|
||||
RX = pin.RX
|
||||
1
src/adafruit_blinka/board/hardkernel/__init__.py
Normal file
1
src/adafruit_blinka/board/hardkernel/__init__.py
Normal file
|
|
@ -0,0 +1 @@
|
|||
"""Boards definition from HardKernel"""
|
||||
80
src/adafruit_blinka/board/hardkernel/odroidc2.py
Normal file
80
src/adafruit_blinka/board/hardkernel/odroidc2.py
Normal file
|
|
@ -0,0 +1,80 @@
|
|||
"""Pin definitions for the Odroid C2."""
|
||||
|
||||
from adafruit_blinka.microcontroller.amlogic.s905 import pin
|
||||
|
||||
GPIOX_0 = pin.GPIO228
|
||||
GPIOX_1 = pin.GPIO229
|
||||
GPIOX_2 = pin.GPIO230
|
||||
GPIOX_3 = pin.GPIO231
|
||||
GPIOX_4 = pin.GPIO232
|
||||
GPIOX_5 = pin.GPIO233
|
||||
GPIOX_6 = pin.GPIO234
|
||||
GPIOX_7 = pin.GPIO235
|
||||
GPIOX_8 = pin.GPIO236
|
||||
GPIOX_9 = pin.GPIO237
|
||||
GPIOX_10 = pin.GPIO238
|
||||
GPIOX_11 = pin.GPIO239
|
||||
GPIOX_12 = pin.GPIO240
|
||||
GPIOX_13 = pin.GPIO241
|
||||
GPIOX_19 = pin.GPIO247
|
||||
GPIOX_21 = pin.GPIO249
|
||||
|
||||
GPIODV_24 = pin.GPIO205
|
||||
GPIODV_25 = pin.GPIO206
|
||||
GPIODV_26 = pin.GPIO207
|
||||
GPIODV_27 = pin.GPIO208
|
||||
GPIODV_28 = pin.GPIO209
|
||||
GPIODV_29 = pin.GPIO210
|
||||
|
||||
GPIOY_0 = pin.GPIO211
|
||||
GPIOY_1 = pin.GPIO212
|
||||
GPIOY_3 = pin.GPIO214
|
||||
GPIOY_7 = pin.GPIO218
|
||||
GPIOY_8 = pin.GPIO219
|
||||
GPIOY_12 = pin.GPIO223
|
||||
GPIOY_13 = pin.GPIO224
|
||||
GPIOY_14 = pin.GPIO225
|
||||
|
||||
GPIOA0_0 = pin.GPIO122
|
||||
GPIOA0_1 = pin.GPIO123
|
||||
GPIOA0_2 = pin.GPIO124
|
||||
GPIOA0_3 = pin.GPIO125
|
||||
GPIOA0_4 = pin.GPIO126
|
||||
GPIOA0_5 = pin.GPIO127
|
||||
GPIOA0_6 = pin.GPIO128
|
||||
GPIOA0_7 = pin.GPIO129
|
||||
GPIOA0_8 = pin.GPIO130
|
||||
GPIOA0_9 = pin.GPIO131
|
||||
GPIOA0_10 = pin.GPIO132
|
||||
GPIOA0_11 = pin.GPIO133
|
||||
GPIOA0_12 = pin.GPIO134
|
||||
GPIOA0_13 = pin.GPIO135
|
||||
|
||||
SDA = pin.I2C0_SDA
|
||||
SCL = pin.I2C0_SCL
|
||||
|
||||
SCLK = pin.SPI0_SCLK
|
||||
MOSI = pin.SPI0_MOSI
|
||||
MISO = pin.SPI0_MISO
|
||||
SPI_CS0 = pin.GPIO229
|
||||
SPI_CS1 = pin.GPIO225
|
||||
|
||||
D0 = GPIOX_19
|
||||
D1 = GPIOX_10
|
||||
D2 = GPIOX_11
|
||||
D3 = GPIOX_9
|
||||
D4 = GPIOX_8
|
||||
D5 = GPIOX_5
|
||||
D6 = GPIOX_3
|
||||
D7 = GPIOX_21
|
||||
D10 = GPIOX_1
|
||||
D11 = GPIOY_14
|
||||
D12 = GPIOX_7
|
||||
D13 = GPIOX_4
|
||||
D14 = GPIOX_2
|
||||
D21 = GPIOX_0
|
||||
D22 = GPIOY_8
|
||||
D23 = GPIOX_6
|
||||
D24 = GPIOY_3
|
||||
D26 = GPIOY_13
|
||||
D27 = GPIOY_7
|
||||
51
src/adafruit_blinka/board/hardkernel/odroidc4.py
Normal file
51
src/adafruit_blinka/board/hardkernel/odroidc4.py
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
"""Pin definitions for the Odroid C4."""
|
||||
|
||||
from adafruit_blinka.microcontroller.amlogic.s905x3 import pin
|
||||
|
||||
for it in pin.i2cPorts:
|
||||
globals()["SCL" + str(it[0])] = it[1]
|
||||
globals()["SDA" + str(it[0])] = it[2]
|
||||
|
||||
SCL = pin.i2cPorts[0][1]
|
||||
SDA = pin.i2cPorts[0][2]
|
||||
|
||||
SCLK = pin.SPI0_SCLK
|
||||
MOSI = pin.SPI0_MOSI
|
||||
MISO = pin.SPI0_MISO
|
||||
SPI_CS0 = pin.SPI0_CS0
|
||||
|
||||
"""J2: physical pin number"""
|
||||
|
||||
D3 = pin.GPIOX_17
|
||||
D5 = pin.GPIOX_18
|
||||
D7 = pin.GPIOX_5
|
||||
D8 = pin.GPIOX_12
|
||||
D10 = pin.GPIOX_13
|
||||
D11 = pin.GPIOX_3
|
||||
D12 = pin.GPIOX_16
|
||||
D13 = pin.GPIOX_4
|
||||
D15 = pin.GPIOX_7
|
||||
D16 = pin.GPIOX_0
|
||||
D18 = pin.GPIOX_1
|
||||
D19 = pin.GPIOX_8
|
||||
D21 = pin.GPIOX_9
|
||||
D22 = pin.GPIOX_2
|
||||
D23 = pin.GPIOX_11
|
||||
D24 = pin.GPIOX_10
|
||||
D26 = pin.GPIOH_6
|
||||
D27 = pin.GPIOA_14
|
||||
D28 = pin.GPIOA_15
|
||||
D29 = pin.GPIOX_14
|
||||
D31 = pin.GPIOX_15
|
||||
D32 = pin.GPIOH_7
|
||||
D33 = pin.GPIOX_6
|
||||
D35 = pin.GPIOX_19
|
||||
D36 = pin.GPIOH_5
|
||||
|
||||
"""J7: physical pin number"""
|
||||
|
||||
D42 = pin.GPIOAO_10
|
||||
D44 = pin.GPIOAO_9
|
||||
D45 = pin.GPIOAO_7
|
||||
D46 = pin.GPIOAO_8
|
||||
D47 = pin.GPIOAO_4
|
||||
91
src/adafruit_blinka/board/hardkernel/odroidn2.py
Normal file
91
src/adafruit_blinka/board/hardkernel/odroidn2.py
Normal file
|
|
@ -0,0 +1,91 @@
|
|||
"""Pin definitions for the Odroid N2."""
|
||||
|
||||
from adafruit_blinka.microcontroller.amlogic.s922x import pin
|
||||
|
||||
GPIOX_0 = pin.GPIO476
|
||||
GPIOX_1 = pin.GPIO477
|
||||
GPIOX_2 = pin.GPIO478
|
||||
GPIOX_3 = pin.GPIO479
|
||||
GPIOX_4 = pin.GPIO480
|
||||
GPIOX_5 = pin.GPIO481
|
||||
GPIOX_6 = pin.GPIO482
|
||||
GPIOX_7 = pin.GPIO483
|
||||
GPIOX_8 = pin.GPIO484
|
||||
GPIOX_9 = pin.GPIO485
|
||||
GPIOX_10 = pin.GPIO486
|
||||
GPIOX_11 = pin.GPIO487
|
||||
GPIOX_12 = pin.GPIO488
|
||||
GPIOX_13 = pin.GPIO489
|
||||
GPIOX_14 = pin.GPIO490
|
||||
GPIOX_15 = pin.GPIO491
|
||||
GPIOX_16 = pin.GPIO492
|
||||
GPIOX_17 = pin.GPIO493
|
||||
GPIOX_18 = pin.GPIO494
|
||||
GPIOX_19 = pin.GPIO495
|
||||
|
||||
GPIODV_24 = pin.GPIO493
|
||||
GPIODV_25 = pin.GPIO494
|
||||
GPIODV_26 = pin.GPIO474
|
||||
GPIODV_27 = pin.GPIO475
|
||||
|
||||
GPIOA_4 = pin.GPIO464
|
||||
GPIOA_12 = pin.GPIO472
|
||||
GPIOA_13 = pin.GPIO473
|
||||
GPIOA_14 = pin.GPIO474
|
||||
GPIOA_15 = pin.GPIO475
|
||||
|
||||
GPIOA0_0 = pin.GPIO496
|
||||
GPIOA0_1 = pin.GPIO497
|
||||
GPIOA0_2 = pin.GPIO498
|
||||
GPIOA0_3 = pin.GPIO499
|
||||
GPIOA0_4 = pin.GPIO500
|
||||
GPIOA0_5 = pin.GPIO501
|
||||
GPIOA0_6 = pin.GPIO502
|
||||
GPIOA0_7 = pin.GPIO503
|
||||
GPIOA0_8 = pin.GPIO504
|
||||
GPIOA0_9 = pin.GPIO505
|
||||
GPIOA0_10 = pin.GPIO506
|
||||
GPIOA0_11 = pin.GPIO507
|
||||
GPIOA0_12 = pin.GPIO508
|
||||
GPIOA0_13 = pin.GPIO509
|
||||
GPIOA0_14 = pin.GPIO510
|
||||
GPIOA0_15 = pin.GPIO511
|
||||
|
||||
for it in pin.i2cPorts:
|
||||
globals()["SCL" + str(it[0])] = it[1]
|
||||
globals()["SDA" + str(it[0])] = it[2]
|
||||
|
||||
# Set second i2c bus as default for backward compatibility.
|
||||
SCL = pin.i2cPorts[1][1]
|
||||
SDA = pin.i2cPorts[1][2]
|
||||
|
||||
SCLK = pin.SPI0_SCLK
|
||||
MOSI = pin.SPI0_MOSI
|
||||
MISO = pin.SPI0_MISO
|
||||
SPI_CS0 = pin.GPIO486
|
||||
|
||||
D0 = GPIOX_3 # PIN_11
|
||||
D1 = GPIOX_16 # PIN_12
|
||||
D2 = GPIOX_4 # PIN_13
|
||||
D3 = GPIOX_7 # PIN_15
|
||||
D4 = GPIOX_0 # PIN_16
|
||||
D5 = GPIOX_1 # PIN_18
|
||||
D6 = GPIOX_2 # PIN_22
|
||||
D7 = GPIOA_13 # PIN_7
|
||||
D8 = GPIOX_17 # PIN_3
|
||||
D9 = GPIOX_18 # PIN_5
|
||||
D10 = GPIOX_10 # PIN_24
|
||||
D11 = GPIOA_4 # PIN_26
|
||||
D12 = GPIOX_8 # PIN_19
|
||||
D13 = GPIOX_9 # PIN_21
|
||||
D14 = GPIOX_11 # PIN_23
|
||||
D15 = GPIOX_12 # PIN_8
|
||||
D16 = GPIOX_13 # PIN_10
|
||||
D21 = GPIOX_14 # PIN_29
|
||||
D22 = GPIOX_15 # PIN_31
|
||||
D23 = GPIOX_5 # PIN_33
|
||||
D24 = GPIOX_6 # PIN_35
|
||||
D26 = GPIOA_12 # PIN_32
|
||||
D27 = GPIOX_19 # PIN_36
|
||||
D30 = GPIOA_14 # PIN_27
|
||||
D31 = GPIOA_15 # PIN_28
|
||||
40
src/adafruit_blinka/board/hardkernel/odroidxu4.py
Normal file
40
src/adafruit_blinka/board/hardkernel/odroidxu4.py
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
"""Pin definitions for the Odroid XU4."""
|
||||
|
||||
from adafruit_blinka.microcontroller.samsung.exynos5422 import pin
|
||||
|
||||
SDA = SDA1 = pin.I2C1_SDA
|
||||
SCL = SCL1 = pin.I2C1_SCL
|
||||
SDA5 = pin.I2C5_SDA
|
||||
SCL5 = pin.I2C5_SCL
|
||||
|
||||
SCLK = pin.SPI1_SCLK
|
||||
MOSI = pin.SPI1_MOSI
|
||||
MISO = pin.SPI1_MISO
|
||||
SPI_CS0 = pin.SPI1_CS0
|
||||
|
||||
"""physical pin number(XU4 Shifter Shield)"""
|
||||
|
||||
D3 = pin.GPIOB3_2
|
||||
D5 = pin.GPIOB3_3
|
||||
D7 = pin.GPIOX1_2
|
||||
D8 = pin.GPIOA0_1
|
||||
D10 = pin.GPIOA0_0
|
||||
D11 = pin.GPIOA0_3
|
||||
D12 = pin.GPIOA0_2
|
||||
D13 = pin.GPIOX1_5
|
||||
D15 = pin.GPIOX1_6
|
||||
D16 = pin.GPIOX1_3
|
||||
D18 = pin.GPIOX1_7
|
||||
D19 = pin.GPIOA2_7
|
||||
D21 = pin.GPIOA2_6
|
||||
D22 = pin.GPIOX2_0
|
||||
D23 = pin.GPIOA2_4
|
||||
D24 = pin.GPIOA2_5
|
||||
D26 = pin.GPIOX2_1
|
||||
D27 = pin.GPIOA2_2
|
||||
D28 = pin.GPIOA2_4
|
||||
D29 = pin.GPIOX2_4
|
||||
D31 = pin.GPIOX2_6
|
||||
D32 = pin.GPIOX2_5
|
||||
D33 = pin.GPIOX2_7
|
||||
D36 = pin.GPIOX3_1
|
||||
37
src/adafruit_blinka/board/hifive_unleashed.py
Normal file
37
src/adafruit_blinka/board/hifive_unleashed.py
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
"""Pin definitions for the Hifive Unleashed."""
|
||||
|
||||
from adafruit_blinka.microcontroller.hfu540 import pin
|
||||
|
||||
GPIO_A = pin.GPIO0
|
||||
GPIO_B = pin.GPIO1
|
||||
GPIO_C = pin.GPIO2
|
||||
GPIO_D = pin.GPIO3
|
||||
GPIO_E = pin.GPIO4
|
||||
GPIO_F = pin.GPIO5
|
||||
GPIO_G = pin.GPIO6
|
||||
GPIO_H = pin.GPIO7
|
||||
GPIO_I = pin.GPIO8
|
||||
GPIO_J = pin.GPIO9
|
||||
GPIO_K = pin.GPIO15
|
||||
|
||||
UART0_TXD = pin.UART0_TXD
|
||||
UART0_RXD = pin.UART0_RXD
|
||||
SPI0_SCLK = pin.SPI0_SCLK
|
||||
SPI0_DIN = pin.SPI0_DIN
|
||||
UART1_TXD = pin.UART1_TXD
|
||||
SPI0_CS = pin.SPI0_CS
|
||||
UART1_RXD = pin.UART1_RXD
|
||||
SPI0_DOUT = pin.SPI0_DOUT
|
||||
I2C0_SCL = pin.I2C0_SCL
|
||||
I2C0_SDA = pin.I2C0_SDA
|
||||
|
||||
SDA = pin.I2C0_SDA
|
||||
SCL = pin.I2C0_SCL
|
||||
|
||||
I2C0_SDA = pin.I2C0_SDA
|
||||
I2C0_SCL = pin.I2C0_SCL
|
||||
|
||||
SCLK = pin.SPI0_SCLK
|
||||
MOSI = pin.SPI0_DOUT
|
||||
MISO = pin.SPI0_DIN
|
||||
SPI_CS = pin.SPI0_CS
|
||||
1
src/adafruit_blinka/board/lubancat/__init__.py
Normal file
1
src/adafruit_blinka/board/lubancat/__init__.py
Normal file
|
|
@ -0,0 +1 @@
|
|||
"""Boards definition from LubanCat"""
|
||||
51
src/adafruit_blinka/board/lubancat/lubancat_imx6ull.py
Normal file
51
src/adafruit_blinka/board/lubancat/lubancat_imx6ull.py
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
"""Pin definitions for the LubanCat IMX6ULL."""
|
||||
|
||||
from adafruit_blinka.microcontroller.nxp_imx6ull import pin
|
||||
|
||||
# Pro board pin header CN4 named GPIO_PAx, pin header CN5 named GPIO_PBx
|
||||
# Mini board pin header CN3 named GPIO_PCx, pin header CN4 named GPIO_PDx
|
||||
|
||||
# Board pin name [= alias] = RPI name [= alias] = pin name
|
||||
GPIO_PC3 = I2C2_SDA = D2 = SDA = pin.I2C2_SDA
|
||||
GPIO_PC5 = I2C2_SCL = D3 = SCL = pin.I2C2_SCL
|
||||
|
||||
GPIO_PC7 = D4 = pin.GPIO27
|
||||
GPIO_PC8 = D14 = TXD = pin.UART3_TXD
|
||||
GPIO_PC10 = D15 = RXD = pin.UART3_RXD
|
||||
GPIO_PC11 = ADC_IN3 = A3 = D17 = pin.GPIO3
|
||||
GPIO_PC12 = D18 = pin.GPIO112
|
||||
GPIO_PC13 = ADC_IN2 = A2 = D27 = pin.GPIO2
|
||||
GPIO_PC15 = ADC_IN0 = A0 = D22 = pin.GPIO0
|
||||
GPIO_PC16 = D23 = pin.GPIO119
|
||||
GPIO_PC18 = D24 = pin.GPIO114
|
||||
|
||||
GPIO_PC19 = ECSPI3_MOSI = D10 = MOSI = pin.ECSPI3_MOSI
|
||||
GPIO_PC21 = ECSPI3_MISO = D9 = MISO = pin.ECSPI3_MISO
|
||||
GPIO_PC22 = D25 = pin.GPIO27
|
||||
GPIO_PC23 = ECSPI3_SCLK = D11 = SCLK = SCK = pin.ECSPI3_SCLK
|
||||
GPIO_PC24 = ECSPI3_SS0 = D8 = SS0 = pin.ECSPI3_SS0
|
||||
GPIO_PC26 = ECSPI3_SS1 = D7 = SS1 = pin.ECSPI3_SS1
|
||||
|
||||
GPIO_PC27 = I2C3_SDA = D0 = pin.I2C3_SDA
|
||||
GPIO_PC28 = I2C3_SCL = D1 = pin.I2C3_SCL
|
||||
|
||||
GPIO_PC29 = D5 = pin.GPIO117
|
||||
GPIO_PC31 = D6 = pin.GPIO118
|
||||
|
||||
GPIO_PC32 = LED_D6 = D12 = pin.GPIO115
|
||||
GPIO_PC33 = LED_D5 = D13 = pin.GPIO116
|
||||
|
||||
# Board pwm channel = RPI PWM Channel = pin name
|
||||
PWM_C7 = PWM1 = pin.GPIO115
|
||||
PWM_C8 = PWM2 = pin.GPIO116
|
||||
|
||||
GPIO_PC35 = D19 = pin.GPIO121
|
||||
GPIO_PC36 = D16 = pin.GPIO120
|
||||
GPIO_PC37 = D26 = pin.GPIO26
|
||||
GPIO_PC38 = D20 = pin.GPIO123
|
||||
GPIO_PC40 = D21 = pin.GPIO124
|
||||
|
||||
# Mini header CN4
|
||||
GPIO_PD9 = ADC_IN1 = A1 = pin.GPIO1
|
||||
GPIO_PD4 = LED_D4 = PWM_C3 = pin.GPIO4
|
||||
GPIO_PD17 = BUTTON2 = pin.GPIO129
|
||||
10
src/adafruit_blinka/board/microchip_mcp2221.py
Normal file
10
src/adafruit_blinka/board/microchip_mcp2221.py
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
"""Pin definitions for the MicroChip MCP2221"""
|
||||
from adafruit_blinka.microcontroller.mcp2221 import pin
|
||||
|
||||
G0 = pin.G0
|
||||
G1 = pin.G1
|
||||
G2 = pin.G2
|
||||
G3 = pin.G3
|
||||
|
||||
SCL = pin.SCL
|
||||
SDA = pin.SDA
|
||||
1
src/adafruit_blinka/board/nanopi/__init__.py
Normal file
1
src/adafruit_blinka/board/nanopi/__init__.py
Normal file
|
|
@ -0,0 +1 @@
|
|||
"""Board definitions from NanoPi"""
|
||||
49
src/adafruit_blinka/board/nanopi/neoair.py
Normal file
49
src/adafruit_blinka/board/nanopi/neoair.py
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
"""Pin definitions for the NanoPi NEO Air."""
|
||||
# Enable I2C0, UART1, and SPI by adding the following lines to /boot/armbianEnv.txt
|
||||
# overlays=usbhost2 usbhost3 spi-spidev uart1 i2c0
|
||||
# param_spidev_spi_bus=0
|
||||
|
||||
from adafruit_blinka.microcontroller.allwinner.h3 import pin
|
||||
|
||||
# Left GPIOs
|
||||
D2 = pin.PA12
|
||||
D3 = pin.PA11
|
||||
D4 = pin.PG11
|
||||
D17 = pin.PA0
|
||||
D27 = pin.PA2
|
||||
D22 = pin.PA3
|
||||
D10 = pin.PC0
|
||||
D9 = pin.PC1
|
||||
D11 = pin.PC2
|
||||
|
||||
# Right GPIOs
|
||||
D14 = pin.PG6
|
||||
D15 = pin.PG7
|
||||
D18 = pin.PA6
|
||||
D23 = pin.PG8
|
||||
D24 = pin.PG9
|
||||
D25 = pin.PA1
|
||||
D8 = pin.PC3
|
||||
|
||||
# I2C
|
||||
SDA = D2
|
||||
SCL = D3
|
||||
|
||||
# SPI
|
||||
SCLK = D11
|
||||
MOSI = D10
|
||||
MISO = D9
|
||||
CE0 = D8
|
||||
SCK = SCLK
|
||||
|
||||
# Serial UART
|
||||
UART1_TX = D14
|
||||
UART1_RX = D15
|
||||
|
||||
UART2_RX = D8
|
||||
UART2_TX = D17
|
||||
UART2_RTS = D27
|
||||
UART2_CTS = D22
|
||||
|
||||
# PWM
|
||||
PWM1 = D4
|
||||
1
src/adafruit_blinka/board/nvidia/__init__.py
Normal file
1
src/adafruit_blinka/board/nvidia/__init__.py
Normal file
|
|
@ -0,0 +1 @@
|
|||
"""Boards definition from NVIDIA"""
|
||||
38
src/adafruit_blinka/board/nvidia/clara_agx_xavier.py
Normal file
38
src/adafruit_blinka/board/nvidia/clara_agx_xavier.py
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
"""Pin definitions for Clara AGX Xavier."""
|
||||
|
||||
from adafruit_blinka.microcontroller.tegra.t194 import pin
|
||||
|
||||
SDA = pin.SDA
|
||||
SCL = pin.SCL
|
||||
SDA_1 = pin.SDA_1
|
||||
SCL_1 = pin.SCL_1
|
||||
|
||||
D4 = pin.Q06
|
||||
D5 = pin.AA03
|
||||
D6 = pin.AA02
|
||||
D7 = pin.Z07
|
||||
D8 = pin.Z06
|
||||
D9 = pin.Z04
|
||||
D10 = pin.Z05
|
||||
D11 = pin.Z03
|
||||
D12 = pin.BB01
|
||||
D13 = pin.AA00
|
||||
D16 = pin.R05
|
||||
D17 = pin.R04
|
||||
D18 = pin.H07
|
||||
D19 = pin.I02
|
||||
D20 = pin.I01
|
||||
D21 = pin.I00
|
||||
D22 = pin.N01
|
||||
D23 = pin.BB00
|
||||
D24 = pin.H00
|
||||
D25 = pin.Q01
|
||||
D26 = pin.AA01
|
||||
D27 = pin.P04
|
||||
|
||||
CE1 = D7
|
||||
CE0 = D8
|
||||
MISO = D9
|
||||
MOSI = D10
|
||||
SCLK = D11
|
||||
SCK = D11
|
||||
45
src/adafruit_blinka/board/nvidia/jetson_nano.py
Normal file
45
src/adafruit_blinka/board/nvidia/jetson_nano.py
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
"""Pin definitions for Jetson Nano."""
|
||||
|
||||
from adafruit_blinka.microcontroller.tegra.t210 import pin
|
||||
|
||||
SDA = pin.SDA_1
|
||||
SCL = pin.SCL_1
|
||||
SDA_1 = pin.SDA
|
||||
SCL_1 = pin.SCL
|
||||
|
||||
D4 = pin.BB00
|
||||
D5 = pin.S05
|
||||
D6 = pin.Z00
|
||||
D7 = pin.C04
|
||||
D8 = pin.C03
|
||||
D9 = pin.C01
|
||||
D10 = pin.C00
|
||||
D11 = pin.C02
|
||||
D12 = pin.V00
|
||||
D13 = pin.E06
|
||||
D16 = pin.G03
|
||||
D17 = pin.G02
|
||||
D18 = pin.J07
|
||||
D19 = pin.J04
|
||||
D20 = pin.J05
|
||||
D21 = pin.J06
|
||||
D22 = pin.Y02
|
||||
D23 = pin.DD00
|
||||
D24 = pin.B07
|
||||
D25 = pin.B05
|
||||
D26 = pin.B04
|
||||
D27 = pin.B06
|
||||
|
||||
CE1 = D7
|
||||
CE0 = D8
|
||||
MISO = D9
|
||||
MOSI = D10
|
||||
SCLK = D11
|
||||
SCK = D11
|
||||
|
||||
CE1_1 = D23
|
||||
CE0_1 = D24
|
||||
MISO_1 = D25
|
||||
MOSI_1 = D26
|
||||
SCLK_1 = D27
|
||||
SCK_1 = D27
|
||||
38
src/adafruit_blinka/board/nvidia/jetson_nx.py
Normal file
38
src/adafruit_blinka/board/nvidia/jetson_nx.py
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
"""Pin definitions for Jetson NX."""
|
||||
|
||||
from adafruit_blinka.microcontroller.tegra.t194 import pin
|
||||
|
||||
SDA = pin.SDA
|
||||
SCL = pin.SCL
|
||||
SDA_1 = pin.SDA_1
|
||||
SCL_1 = pin.SCL_1
|
||||
|
||||
D4 = pin.S04
|
||||
D5 = pin.Q05
|
||||
D6 = pin.Q06
|
||||
D7 = pin.Z07
|
||||
D8 = pin.Z06
|
||||
D9 = pin.Z04
|
||||
D10 = pin.Z05
|
||||
D11 = pin.Z03
|
||||
D12 = pin.R00
|
||||
D13 = pin.N01
|
||||
D16 = pin.R05
|
||||
D17 = pin.R04
|
||||
D18 = pin.T05
|
||||
D19 = pin.U00
|
||||
D20 = pin.T07
|
||||
D21 = pin.T06
|
||||
D22 = pin.CC04
|
||||
D23 = pin.Y04
|
||||
D24 = pin.Y03
|
||||
D25 = pin.Y01
|
||||
D26 = pin.Y02
|
||||
D27 = pin.Y00
|
||||
|
||||
CE1 = D7
|
||||
CE0 = D8
|
||||
MISO = D9
|
||||
MOSI = D10
|
||||
SCLK = D11
|
||||
SCK = D11
|
||||
38
src/adafruit_blinka/board/nvidia/jetson_tx1.py
Normal file
38
src/adafruit_blinka/board/nvidia/jetson_tx1.py
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
"""Pin definitions for Jetson TX1."""
|
||||
|
||||
from adafruit_blinka.microcontroller.tegra.t210 import pin
|
||||
|
||||
SDA = pin.SDA
|
||||
SCL = pin.SCL
|
||||
SDA_1 = pin.SDA_1
|
||||
SCL_1 = pin.SCL_1
|
||||
|
||||
D4 = pin.BB00
|
||||
D5 = pin.BB03
|
||||
D6 = pin.X02
|
||||
D7 = pin.C04
|
||||
D8 = pin.C03
|
||||
D9 = pin.C01
|
||||
D10 = pin.C00
|
||||
D11 = pin.C02
|
||||
D12 = pin.E04
|
||||
D13 = pin.H07
|
||||
D16 = pin.U03
|
||||
D17 = pin.U02
|
||||
D18 = pin.B03
|
||||
D19 = pin.B00
|
||||
D20 = pin.B01
|
||||
D21 = pin.B02
|
||||
D22 = pin.P17
|
||||
D23 = pin.E05
|
||||
D24 = pin.X00
|
||||
D25 = pin.P16
|
||||
D26 = pin.X03
|
||||
D27 = pin.E06
|
||||
|
||||
CE1 = D7
|
||||
CE0 = D8
|
||||
MISO = D9
|
||||
MOSI = D10
|
||||
SCLK = D11
|
||||
SCK = D11
|
||||
38
src/adafruit_blinka/board/nvidia/jetson_tx2.py
Normal file
38
src/adafruit_blinka/board/nvidia/jetson_tx2.py
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
"""Pin definitions for Jetson TX2."""
|
||||
|
||||
from adafruit_blinka.microcontroller.tegra.t186 import pin
|
||||
|
||||
SDA = pin.SDA
|
||||
SCL = pin.SCL
|
||||
SDA_1 = pin.SDA_1
|
||||
SCL_1 = pin.SCL_1
|
||||
|
||||
D4 = pin.J04
|
||||
D5 = pin.J06
|
||||
D6 = pin.AA02
|
||||
D7 = None
|
||||
D8 = pin.N06
|
||||
D9 = pin.N04
|
||||
D10 = pin.N05
|
||||
D11 = pin.N03
|
||||
D12 = pin.AA01
|
||||
D13 = pin.I05
|
||||
D16 = pin.T03
|
||||
D17 = pin.T02
|
||||
D18 = pin.J00
|
||||
D19 = pin.J03
|
||||
D20 = pin.J02
|
||||
D21 = pin.J01
|
||||
D22 = pin.P17
|
||||
D23 = pin.AA00
|
||||
D24 = pin.Y01
|
||||
D25 = pin.P16
|
||||
D26 = pin.I04
|
||||
D27 = pin.J05
|
||||
|
||||
CE1 = None
|
||||
CE0 = D8
|
||||
MISO = D9
|
||||
MOSI = D10
|
||||
SCLK = D11
|
||||
SCK = D11
|
||||
38
src/adafruit_blinka/board/nvidia/jetson_xavier.py
Normal file
38
src/adafruit_blinka/board/nvidia/jetson_xavier.py
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
"""Pin definitions for Jetson XAVIER."""
|
||||
|
||||
from adafruit_blinka.microcontroller.tegra.t194 import pin
|
||||
|
||||
SDA = pin.SDA
|
||||
SCL = pin.SCL
|
||||
SDA_1 = pin.SDA_1
|
||||
SCL_1 = pin.SCL_1
|
||||
|
||||
D4 = pin.Q06
|
||||
D5 = pin.AA03
|
||||
D6 = pin.AA02
|
||||
D7 = pin.Z07
|
||||
D8 = pin.Z06
|
||||
D9 = pin.Z04
|
||||
D10 = pin.Z05
|
||||
D11 = pin.Z03
|
||||
D12 = pin.BB01
|
||||
D13 = pin.AA00
|
||||
D16 = pin.R05
|
||||
D17 = pin.R04
|
||||
D18 = pin.H07
|
||||
D19 = pin.I02
|
||||
D20 = pin.I01
|
||||
D21 = pin.I00
|
||||
D22 = pin.N01
|
||||
D23 = pin.BB00
|
||||
D24 = pin.H00
|
||||
D25 = pin.Q01
|
||||
D26 = pin.AA01
|
||||
D27 = pin.R00
|
||||
|
||||
CE1 = D7
|
||||
CE0 = D8
|
||||
MISO = D9
|
||||
MOSI = D10
|
||||
SCLK = D11
|
||||
SCK = D11
|
||||
1
src/adafruit_blinka/board/onion/__init__.py
Normal file
1
src/adafruit_blinka/board/onion/__init__.py
Normal file
|
|
@ -0,0 +1 @@
|
|||
"""Boards definition from Onion"""
|
||||
34
src/adafruit_blinka/board/onion/omega2.py
Normal file
34
src/adafruit_blinka/board/onion/omega2.py
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
"""Pin definitions for the Onion Omega2+ Expansion Dock."""
|
||||
|
||||
from adafruit_blinka.microcontroller.mips24kec import pin
|
||||
|
||||
D0 = pin.GPIO0
|
||||
D1 = pin.GPIO1
|
||||
D2 = pin.GPIO2
|
||||
D3 = pin.GPIO3
|
||||
|
||||
D4 = pin.GPIO4
|
||||
D5 = pin.GPIO5
|
||||
D6 = pin.GPIO6
|
||||
D7 = pin.GPIO7
|
||||
D8 = pin.GPIO8
|
||||
D9 = pin.GPIO9
|
||||
|
||||
D11 = pin.GPIO11
|
||||
D15 = pin.GPIO15 # RGB LED Blue
|
||||
D16 = pin.GPIO16 # RGB LED Green
|
||||
D17 = pin.GPIO17 # RGB LED Red
|
||||
D18 = pin.GPIO18
|
||||
D19 = pin.GPIO19
|
||||
|
||||
SDA = pin.I2C0_SDA
|
||||
SCL = pin.I2C0_SCL
|
||||
|
||||
SCLK = pin.SPI0_SCLK
|
||||
MOSI = pin.SPI0_MOSI
|
||||
MISO = pin.SPI0_MISO
|
||||
CS = pin.SPI0_CS
|
||||
SCK = SCLK
|
||||
|
||||
UART_TX = pin.UART1_TX
|
||||
UART_RX = pin.UART1_RX
|
||||
1
src/adafruit_blinka/board/orangepi/__init__.py
Normal file
1
src/adafruit_blinka/board/orangepi/__init__.py
Normal file
|
|
@ -0,0 +1 @@
|
|||
"""Boards definition from Xunlong Orange Pi"""
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
"""Pin definitions for the Orange Pi PC."""
|
||||
|
||||
from adafruit_blinka.microcontroller.allwinner_h3 import pin
|
||||
from adafruit_blinka.microcontroller.allwinner.h3 import pin
|
||||
|
||||
PA12 = pin.PA12
|
||||
SDA = pin.PA12
|
||||
|
|
@ -12,10 +12,12 @@ PA0 = pin.PA0
|
|||
PA3 = pin.PA3
|
||||
PC0 = pin.PC0
|
||||
MOSI = pin.PC0
|
||||
MOSI1 = pin.SPI1_MOSI
|
||||
PC1 = pin.PC1
|
||||
MISO = pin.PC1
|
||||
PC2 = pin.PC2
|
||||
SCK = pin.PC2
|
||||
SCK1 = pin.SPI1_SCLK
|
||||
SCLK = pin.PC2
|
||||
PA19 = pin.PA19
|
||||
PA7 = pin.PA7
|
||||
37
src/adafruit_blinka/board/orangepi/orangepir1.py
Normal file
37
src/adafruit_blinka/board/orangepi/orangepir1.py
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
"""Pin definitions for the Orange Pi R1."""
|
||||
|
||||
from adafruit_blinka.microcontroller.allwinner.h3 import pin
|
||||
|
||||
PA12 = pin.PA12
|
||||
SDA = pin.PA12
|
||||
PA11 = pin.PA11
|
||||
SCL = pin.PA11
|
||||
PA6 = pin.PA6
|
||||
PWM1 = pin.PA6
|
||||
PA1 = pin.PA1
|
||||
UART2_RX = pin.PA1
|
||||
PA0 = pin.PA0
|
||||
UART2_TX = pin.PA0
|
||||
PA3 = pin.PA3
|
||||
UART2_CTS = pin.PA3
|
||||
PA19 = pin.PA19
|
||||
TWI1_SDA = pin.PA19
|
||||
PA7 = pin.PA7
|
||||
PA10 = pin.PA10
|
||||
|
||||
PA13 = pin.PA13
|
||||
SPI1_CS = pin.PA13
|
||||
PA14 = pin.PA14
|
||||
SPI1_CLK = pin.PA14
|
||||
PA2 = pin.PA2
|
||||
UART2_RTS = pin.PA2
|
||||
PA18 = pin.PA18
|
||||
TWI1_SCK = pin.PA18
|
||||
PG6 = pin.PG6
|
||||
UART1_TX = pin.PG6
|
||||
PG7 = pin.PG7
|
||||
UART1_RX = pin.PG7
|
||||
|
||||
SCLK = pin.PA14
|
||||
MOSI = pin.PA15
|
||||
MISO = pin.PA16
|
||||
36
src/adafruit_blinka/board/orangepi/orangepizero.py
Normal file
36
src/adafruit_blinka/board/orangepi/orangepizero.py
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
"""Pin definitions for the Orange Pi Zero."""
|
||||
|
||||
# The Orange Pi Zero uses the AllWinner H2 SoC, but pins
|
||||
# are the same as the AllWinner H3 SoC, so we import those
|
||||
from adafruit_blinka.microcontroller.allwinner.h3 import pin
|
||||
|
||||
PA12 = pin.PA12
|
||||
SDA = pin.PA12
|
||||
PA11 = pin.PA11
|
||||
SCL = pin.PA11
|
||||
PA6 = pin.PA6
|
||||
PWM1 = pin.PA6
|
||||
PA1 = pin.PA1
|
||||
UART2_RX = pin.PA1
|
||||
PA0 = pin.PA0
|
||||
UART2_TX = pin.PA0
|
||||
PA3 = pin.PA3
|
||||
UART2_CTS = pin.PA3
|
||||
PA10 = pin.PA10
|
||||
|
||||
PA13 = pin.PA13
|
||||
SPI1_CS = pin.PA13
|
||||
PA14 = pin.PA14
|
||||
SPI1_CLK = pin.PA14
|
||||
PA2 = pin.PA2
|
||||
UART2_RTS = pin.PA2
|
||||
PA18 = pin.PA18
|
||||
TWI1_SCK = pin.PA18
|
||||
PG6 = pin.PG6
|
||||
UART1_TX = pin.PG6
|
||||
PG7 = pin.PG7
|
||||
UART1_RX = pin.PG7
|
||||
|
||||
SCLK = pin.PA14
|
||||
MOSI = pin.PA15
|
||||
MISO = pin.PA16
|
||||
38
src/adafruit_blinka/board/orangepi/orangepizeroplus.py
Normal file
38
src/adafruit_blinka/board/orangepi/orangepizeroplus.py
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
"""Pin definitions for the Orange Pi Zero Plus."""
|
||||
|
||||
from adafruit_blinka.microcontroller.allwinner.h5 import pin
|
||||
|
||||
PA12 = pin.PA12
|
||||
SDA = pin.PA12
|
||||
PA11 = pin.PA11
|
||||
SCL = pin.PA11
|
||||
PA6 = pin.PA6
|
||||
PWM1 = pin.PA6
|
||||
PA1 = pin.PA1
|
||||
UART2_RX = pin.PA1
|
||||
PA0 = pin.PA0
|
||||
UART2_TX = pin.PA0
|
||||
PA3 = pin.PA3
|
||||
UART2_CTS = pin.PA3
|
||||
PA15 = pin.PA15
|
||||
PA16 = pin.PA16
|
||||
PA14 = pin.PA14
|
||||
SPI1_CLK = pin.PA14
|
||||
PG6 = pin.PG6
|
||||
UART1_TX = pin.PG6
|
||||
PG7 = pin.PG7
|
||||
UART1_RX = pin.PG7
|
||||
PA7 = pin.PA7
|
||||
PA19 = pin.PA19
|
||||
TWI1_SDA = pin.PA19
|
||||
PA18 = pin.PA18
|
||||
TWI1_SCK = pin.PA18
|
||||
PA2 = pin.PA2
|
||||
UART2_RTS = pin.PA2
|
||||
PA13 = pin.PA13
|
||||
SPI1_CS = pin.PA13
|
||||
PA10 = pin.PA10
|
||||
|
||||
SCLK = pin.PA14
|
||||
MOSI = pin.PA15
|
||||
MISO = pin.PA16
|
||||
34
src/adafruit_blinka/board/orangepi/orangepizeroplus2h5.py
Normal file
34
src/adafruit_blinka/board/orangepi/orangepizeroplus2h5.py
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
"""Pin definitions for the Orange Pi Zero Plus 2 H5."""
|
||||
|
||||
from adafruit_blinka.microcontroller.allwinner.h5 import pin
|
||||
|
||||
PA12 = pin.PA12
|
||||
SDA = pin.PA12
|
||||
PA11 = pin.PA11
|
||||
SCL = pin.PA11
|
||||
PA6 = pin.PA6
|
||||
PWM1 = pin.PA6
|
||||
PA1 = pin.PA1
|
||||
UART2_RX = pin.PA1
|
||||
PA0 = pin.PA0
|
||||
UART2_TX = pin.PA0
|
||||
PA3 = pin.PA3
|
||||
UART2_CTS = pin.PA3
|
||||
PD14 = pin.PD14
|
||||
PL0 = pin.PL0
|
||||
PL1 = pin.PL1
|
||||
|
||||
PA13 = pin.PA13
|
||||
SPI1_CS = pin.PA13
|
||||
PA14 = pin.PA14
|
||||
SPI1_CLK = pin.PA14
|
||||
PA2 = pin.PA2
|
||||
UART2_RTS = pin.PA2
|
||||
PA18 = pin.PA18
|
||||
TWI1_SCK = pin.PA18
|
||||
PA19 = pin.PA19
|
||||
TWI1_SDA = pin.PA19
|
||||
|
||||
SCLK = pin.PA14
|
||||
MOSI = pin.PA15
|
||||
MISO = pin.PA16
|
||||
51
src/adafruit_blinka/board/pine64.py
Normal file
51
src/adafruit_blinka/board/pine64.py
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
"""Pin definitions for the Pine64."""
|
||||
|
||||
from adafruit_blinka.microcontroller.allwinner.a64 import pin
|
||||
|
||||
D2 = pin.PH3
|
||||
D3 = pin.PH2
|
||||
D4 = pin.PL10
|
||||
D5 = pin.PH5
|
||||
D6 = pin.PH6
|
||||
D7 = pin.PH7
|
||||
D8 = pin.PC3
|
||||
D9 = pin.PC1
|
||||
D10 = pin.PC0
|
||||
D11 = pin.PC2
|
||||
D12 = pin.PC4
|
||||
D13 = pin.PC5
|
||||
D14 = pin.PB0
|
||||
D15 = pin.PB1
|
||||
D16 = pin.PC6
|
||||
D17 = pin.PC7
|
||||
D18 = pin.PC8
|
||||
D19 = pin.PC9
|
||||
D20 = pin.PC10
|
||||
D21 = pin.PC11
|
||||
D22 = pin.PC12
|
||||
D23 = pin.PC13
|
||||
D24 = pin.PC14
|
||||
D25 = pin.PC15
|
||||
D26 = pin.PC16
|
||||
D27 = pin.PH9
|
||||
|
||||
SDA = D2
|
||||
SCL = D3
|
||||
|
||||
SCL2 = pin.PL8
|
||||
SDA2 = pin.PL9
|
||||
|
||||
SCLK = D11
|
||||
MOSI = D10
|
||||
MISO = D9
|
||||
CS = D8
|
||||
SCK = SCLK
|
||||
|
||||
UART_TX = D14
|
||||
UART_RX = D15
|
||||
|
||||
UART3_TX = pin.PD0
|
||||
UART3_RX = pin.PD1
|
||||
|
||||
UART4_TX = pin.PD2
|
||||
UART4_RX = pin.PD3
|
||||
41
src/adafruit_blinka/board/pineH64.py
Normal file
41
src/adafruit_blinka/board/pineH64.py
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
"""Pin definitions for the PineH64."""
|
||||
|
||||
from adafruit_blinka.microcontroller.allwinner.h6 import pin
|
||||
|
||||
D2 = pin.PD26
|
||||
D3 = pin.PD25
|
||||
D4 = pin.PL8
|
||||
D5 = pin.PH2
|
||||
D6 = pin.PG14
|
||||
D7 = pin.PC16
|
||||
D8 = pin.PH3
|
||||
D9 = pin.PH6
|
||||
D10 = pin.PH5
|
||||
D11 = pin.PH4
|
||||
D12 = pin.PD22
|
||||
D13 = pin.PD21
|
||||
D14 = pin.PD19
|
||||
D15 = pin.PD20
|
||||
D16 = pin.PD24
|
||||
D17 = pin.PL9
|
||||
D18 = pin.PG11
|
||||
D19 = pin.PG10
|
||||
D21 = pin.PG12
|
||||
D22 = pin.PG13
|
||||
D23 = pin.PD16
|
||||
D24 = pin.PD17
|
||||
D25 = pin.PD18
|
||||
D26 = pin.PD23
|
||||
D27 = pin.PD14
|
||||
|
||||
SDA = D2
|
||||
SCL = D3
|
||||
|
||||
SCLK = D11
|
||||
MOSI = D10
|
||||
MISO = D9
|
||||
CS = D8
|
||||
SCK = SCLK
|
||||
|
||||
UART_TX = D14
|
||||
UART_RX = D15
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
"""PyBoard pin names"""
|
||||
|
||||
from adafruit_blinka.microcontroller.stm32 import pin
|
||||
from adafruit_blinka.microcontroller.stm32.stm32f405 import pin
|
||||
|
||||
X1 = pin.A0
|
||||
X2 = pin.A1
|
||||
|
|
|
|||
1
src/adafruit_blinka/board/radxa/__init__.py
Normal file
1
src/adafruit_blinka/board/radxa/__init__.py
Normal file
|
|
@ -0,0 +1 @@
|
|||
"""Rock Pi Boards definition from Radxa"""
|
||||
55
src/adafruit_blinka/board/radxa/rockpis.py
Normal file
55
src/adafruit_blinka/board/radxa/rockpis.py
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
"""Pin definitions for the Rock Pi S."""
|
||||
|
||||
from adafruit_blinka.microcontroller.rockchip.rk3308 import pin
|
||||
|
||||
D2 = pin.GPIO0_B3
|
||||
D3 = pin.GPIO0_B4
|
||||
D4 = pin.GPIO2_A4
|
||||
D8 = pin.GPIO1_D1
|
||||
D9 = pin.GPIO1_C6
|
||||
D10 = pin.GPIO1_C7
|
||||
D11 = pin.GPIO1_D0
|
||||
D14 = pin.GPIO2_A1
|
||||
D15 = pin.GPIO2_A0
|
||||
D17 = pin.GPIO0_B7
|
||||
D18 = pin.GPIO2_A5
|
||||
D22 = pin.GPIO0_C1
|
||||
D23 = pin.GPIO2_B2
|
||||
D24 = pin.GPIO2_B1
|
||||
D25 = pin.GPIO2_A7
|
||||
D27 = pin.GPIO0_C0
|
||||
|
||||
SDA0 = pin.I2C0_SDA
|
||||
SCL0 = pin.I2C0_SCL
|
||||
|
||||
SDA1 = pin.I2C1_SDA
|
||||
SCL1 = pin.I2C1_SCL
|
||||
|
||||
SCL2 = pin.I2C2_SCL
|
||||
SDA2 = pin.I2C2_SDA
|
||||
|
||||
SCL3 = pin.I2C3_SCL
|
||||
SDA3 = pin.I2C3_SDA
|
||||
|
||||
SDA = SDA1
|
||||
SCL = SCL1
|
||||
|
||||
SCLK = pin.SPI2_SCLK
|
||||
MOSI = pin.SPI2_MOSI
|
||||
MISO = pin.SPI2_MISO
|
||||
CS = pin.SPI2_CS
|
||||
SCK = SCLK
|
||||
|
||||
UART_TX = pin.UART0_TX
|
||||
UART_RX = pin.UART0_RX
|
||||
|
||||
UART1_TX = pin.UART1_TX
|
||||
UART1_RX = pin.UART1_RX
|
||||
|
||||
UART2_TX = pin.UART2_TX
|
||||
UART2_RX = pin.UART2_RX
|
||||
|
||||
PWM2 = pin.PWM2
|
||||
PWM3 = pin.PWM3
|
||||
|
||||
ADC_IN0 = pin.ADC_IN0
|
||||
1
src/adafruit_blinka/board/raspberrypi/__init__.py
Normal file
1
src/adafruit_blinka/board/raspberrypi/__init__.py
Normal file
|
|
@ -0,0 +1 @@
|
|||
"""Boards definition from Raspberry Pi"""
|
||||
|
|
@ -24,6 +24,9 @@ D14 = pin.D14
|
|||
TXD = pin.D14
|
||||
D15 = pin.D15
|
||||
RXD = pin.D15
|
||||
# create alias for most of the examples
|
||||
TX = pin.D14
|
||||
RX = pin.D15
|
||||
|
||||
D17 = pin.D17
|
||||
D18 = pin.D18
|
||||
|
|
@ -24,6 +24,9 @@ D14 = pin.D14
|
|||
TXD = pin.D14
|
||||
D15 = pin.D15
|
||||
RXD = pin.D15
|
||||
# create alias for most of the examples
|
||||
TX = pin.D14
|
||||
RX = pin.D15
|
||||
|
||||
D17 = pin.D17
|
||||
D18 = pin.D18
|
||||
|
|
@ -2,6 +2,9 @@
|
|||
|
||||
from adafruit_blinka.microcontroller.bcm283x import pin
|
||||
|
||||
D0 = pin.D0
|
||||
D1 = pin.D1
|
||||
|
||||
D2 = pin.D2
|
||||
SDA = pin.SDA
|
||||
D3 = pin.D3
|
||||
|
|
@ -30,6 +33,9 @@ D14 = pin.D14
|
|||
TXD = pin.D14
|
||||
D15 = pin.D15
|
||||
RXD = pin.D15
|
||||
# create alias for most of the examples
|
||||
TX = pin.D14
|
||||
RX = pin.D15
|
||||
|
||||
D16 = pin.D16
|
||||
D17 = pin.D17
|
||||
74
src/adafruit_blinka/board/raspberrypi/raspi_cm.py
Normal file
74
src/adafruit_blinka/board/raspberrypi/raspi_cm.py
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
"""Pin definitions for Raspberry Pi Compute Modules."""
|
||||
|
||||
from adafruit_blinka.microcontroller.bcm283x import pin
|
||||
|
||||
D2 = pin.D2
|
||||
SDA = pin.SDA
|
||||
D3 = pin.D3
|
||||
SCL = pin.SCL
|
||||
|
||||
D4 = pin.D4
|
||||
D5 = pin.D5
|
||||
D6 = pin.D6
|
||||
|
||||
D7 = pin.D7
|
||||
CE1 = pin.D7
|
||||
D8 = pin.D8
|
||||
CE0 = pin.D8
|
||||
D9 = pin.D9
|
||||
MISO = pin.D9
|
||||
D10 = pin.D10
|
||||
MOSI = pin.D10
|
||||
D11 = pin.D11
|
||||
SCLK = pin.D11
|
||||
SCK = pin.D11
|
||||
|
||||
D12 = pin.D12
|
||||
D13 = pin.D13
|
||||
|
||||
D14 = pin.D14
|
||||
TXD = pin.D14
|
||||
D15 = pin.D15
|
||||
RXD = pin.D15
|
||||
# create alias for most of the examples
|
||||
TX = pin.D14
|
||||
RX = pin.D15
|
||||
|
||||
D16 = pin.D16
|
||||
D17 = pin.D17
|
||||
D18 = pin.D18
|
||||
D19 = pin.D19
|
||||
MISO_1 = pin.D19
|
||||
D20 = pin.D20
|
||||
MOSI_1 = pin.D20
|
||||
D21 = pin.D21
|
||||
SCLK_1 = pin.D21
|
||||
SCK_1 = pin.D21
|
||||
D22 = pin.D22
|
||||
D23 = pin.D23
|
||||
D24 = pin.D24
|
||||
D25 = pin.D25
|
||||
D26 = pin.D26
|
||||
D27 = pin.D27
|
||||
D28 = pin.D28
|
||||
D29 = pin.D29
|
||||
D30 = pin.D30
|
||||
D31 = pin.D31
|
||||
D32 = pin.D32
|
||||
D33 = pin.D33
|
||||
D34 = pin.D34
|
||||
D35 = pin.D35
|
||||
D36 = pin.D36
|
||||
D37 = pin.D37
|
||||
D38 = pin.D38
|
||||
D39 = pin.D39
|
||||
D40 = pin.D40
|
||||
MISO_2 = pin.D40
|
||||
D41 = pin.D41
|
||||
MOSI_2 = pin.D41
|
||||
D42 = pin.D42
|
||||
SCLK_2 = pin.D42
|
||||
SCK_2 = pin.D43
|
||||
D43 = pin.D43
|
||||
D44 = pin.D44
|
||||
D45 = pin.D45
|
||||
51
src/adafruit_blinka/board/soPine.py
Normal file
51
src/adafruit_blinka/board/soPine.py
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
"""Pin definitions for the SoPine."""
|
||||
|
||||
from adafruit_blinka.microcontroller.allwinner.a64 import pin
|
||||
|
||||
D2 = pin.PH3
|
||||
D3 = pin.PH2
|
||||
D4 = pin.PL10
|
||||
D5 = pin.PH5
|
||||
D6 = pin.PH6
|
||||
D7 = pin.PH7
|
||||
D8 = pin.PC3
|
||||
D9 = pin.PC1
|
||||
D10 = pin.PC0
|
||||
D11 = pin.PC2
|
||||
D12 = pin.PC4
|
||||
D13 = pin.PC5
|
||||
D14 = pin.PB0
|
||||
D15 = pin.PB1
|
||||
D16 = pin.PC6
|
||||
D17 = pin.PC7
|
||||
D18 = pin.PC8
|
||||
D19 = pin.PC9
|
||||
D20 = pin.PC10
|
||||
D21 = pin.PC11
|
||||
D22 = pin.PC12
|
||||
D23 = pin.PC13
|
||||
D24 = pin.PC14
|
||||
D25 = pin.PC15
|
||||
D26 = pin.PC16
|
||||
D27 = pin.PH9
|
||||
|
||||
SDA = D2
|
||||
SCL = D3
|
||||
|
||||
SCL2 = pin.PL8
|
||||
SDA2 = pin.PL9
|
||||
|
||||
SCLK = D11
|
||||
MOSI = D10
|
||||
MISO = D9
|
||||
CS = D8
|
||||
SCK = SCLK
|
||||
|
||||
UART_TX = D14
|
||||
UART_RX = D15
|
||||
|
||||
UART3_TX = pin.PD0
|
||||
UART3_RX = pin.PD1
|
||||
|
||||
UART4_TX = pin.PD2
|
||||
UART4_RX = pin.PD3
|
||||
1
src/adafruit_blinka/board/stm32/__init__.py
Normal file
1
src/adafruit_blinka/board/stm32/__init__.py
Normal file
|
|
@ -0,0 +1 @@
|
|||
"""Boards definition from STM32"""
|
||||
49
src/adafruit_blinka/board/stm32/stm32mp157c_dk2.py
Normal file
49
src/adafruit_blinka/board/stm32/stm32mp157c_dk2.py
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
"""Pin definitions for the STM32MP157C Development Kit 2."""
|
||||
|
||||
from adafruit_blinka.microcontroller.stm32.stm32mp157 import pin
|
||||
|
||||
D2 = pin.PA12
|
||||
D3 = pin.PA11
|
||||
D4 = pin.PA8
|
||||
D5 = pin.PG2
|
||||
D6 = pin.PH11
|
||||
D7 = pin.PF3
|
||||
D8 = pin.PF6
|
||||
D9 = pin.PF8
|
||||
D10 = pin.PF9
|
||||
D11 = pin.PF7
|
||||
D12 = pin.PD13
|
||||
D13 = pin.PC7
|
||||
D14 = pin.PB10
|
||||
D15 = pin.PB12
|
||||
D16 = pin.PB13
|
||||
D17 = pin.PG8
|
||||
D18 = pin.PI5
|
||||
D19 = pin.PI7
|
||||
D20 = pin.PI6
|
||||
D21 = pin.PF11
|
||||
D22 = pin.PG15
|
||||
D23 = pin.PF1
|
||||
D24 = pin.PF0
|
||||
D25 = pin.PF4
|
||||
D26 = pin.PF5
|
||||
D27 = pin.PD7
|
||||
|
||||
SDA = D2
|
||||
SCL = D3
|
||||
|
||||
SDA1 = pin.PF15
|
||||
SCL1 = pin.PD12
|
||||
|
||||
SCLK = D11
|
||||
MOSI = D10
|
||||
MISO = D9
|
||||
|
||||
CE0 = D8
|
||||
CE1 = D7
|
||||
|
||||
CS = CE0
|
||||
SCK = SCLK
|
||||
|
||||
UART_TX = D14
|
||||
UART_RX = D15
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
"""Pin definitions for the Tritium H3."""
|
||||
|
||||
from adafruit_blinka.microcontroller.allwinner_h3 import pin
|
||||
from adafruit_blinka.microcontroller.allwinner.h3 import pin
|
||||
|
||||
PA12 = pin.PA12
|
||||
SDA = pin.PA12
|
||||
|
|
|
|||
70
src/adafruit_blinka/board/udoo_x86ultra.py
Normal file
70
src/adafruit_blinka/board/udoo_x86ultra.py
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
"""Pin definitions for Udoo x86 Ultra
|
||||
(should work for Ultra and Ultra II)
|
||||
|
||||
There are 2 naming systems. A Digital Pin system which includes
|
||||
the arduino chip (Leonardo or 101). The Braswell #s start at 16 and
|
||||
is documented in the diagram and text for linux version later than 4.15 in:
|
||||
https://www.udoo.org/docs-x86II/Introduction/Introduction.html
|
||||
The other is based on the hardware manual:
|
||||
https://udoo.org/download/files/UDOO_X86/Doc/UDOO_X86II_MANUAL.pdf
|
||||
|
||||
This will use the D system based on the diagram in the user guide
|
||||
|
||||
i2c use i2c(board.I2C0_SCL, board_I2C0_SDA) or i2c(board.I2C1_SCL, board_I2C1_SDA)
|
||||
for the i2c(board.SCL, board.SCL) in the examples
|
||||
|
||||
UART use pyserial not busio
|
||||
"""
|
||||
|
||||
from adafruit_blinka.microcontroller.pentium.n3710 import pin
|
||||
|
||||
# Connector CN15
|
||||
D16 = pin.UART1_RTS
|
||||
D17 = pin.UART1_CTS
|
||||
D18 = pin.UART1_TXD
|
||||
D19 = pin.UART1_RXD
|
||||
D20 = pin.UART2_RTS
|
||||
D21 = pin.UART2_CTS
|
||||
D22 = pin.UART2_TXD
|
||||
D23 = pin.UART2_RXD
|
||||
|
||||
# Connector CN13 LPC interface
|
||||
D24 = pin.GPIO_275
|
||||
D25 = pin.GPIO_280
|
||||
D26 = pin.GPIO_273
|
||||
D27 = pin.GPIO_278
|
||||
D28 = pin.GPIO_276
|
||||
D29 = pin.GPIO_279
|
||||
D30 = pin.GPIO_307
|
||||
|
||||
# Connector CN14
|
||||
D34 = pin.I2C0_SCL
|
||||
D35 = pin.I2C0_SDA
|
||||
|
||||
D36 = pin.GPIO_492
|
||||
D37 = pin.GPIO_490
|
||||
|
||||
D38 = pin.I2C1_SCL
|
||||
D39 = pin.I2C1_SDA
|
||||
|
||||
# Connector CN12 SDIO SD/MMC interfaces
|
||||
D40 = pin.GPIO_358
|
||||
D41 = pin.GPIO_243
|
||||
D42 = pin.GPIO_249
|
||||
D43 = pin.GPIO_246
|
||||
D44 = pin.GPIO_253
|
||||
D45 = pin.GPIO_250
|
||||
D46 = pin.GPIO_247
|
||||
|
||||
# aliases
|
||||
UART1_RX = D19
|
||||
UART1_TX = D18
|
||||
|
||||
UART2_RX = D23
|
||||
UART2_TX = D22
|
||||
|
||||
I2C0_SCL = D34 # labeled on diagram as I2C1, hardware manual port 0
|
||||
I2C0_SDA = D35 # i2cdetect-l lists it as i2c-0
|
||||
|
||||
I2C1_SCL = D38 # Labeled on diagram as I2C2, hardware manual port 5
|
||||
I2C1_SCL = D39 # i2cdetect lists it as i2c-1
|
||||
|
|
@ -0,0 +1 @@
|
|||
"""Definition of all Allwinner chips"""
|
||||
|
|
@ -0,0 +1 @@
|
|||
"""Definition for the AllWinner A33 chip"""
|
||||
47
src/adafruit_blinka/microcontroller/allwinner/a33/pin.py
Normal file
47
src/adafruit_blinka/microcontroller/allwinner/a33/pin.py
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
"""Allwinner A33 pin names"""
|
||||
|
||||
from adafruit_blinka.microcontroller.generic_linux.libgpiod_pin import Pin
|
||||
|
||||
PB0 = Pin(32) # PB0/UART2_TX/UART0_TX/PB_EINT0
|
||||
UART2_TX = PB0
|
||||
PB1 = Pin(33) # PB1/UART2_RX/UART0_RX/PB_EINT1
|
||||
UART2_RX = PB1
|
||||
|
||||
PC0 = Pin(64) # PC0/ND_WE/SPI0_MOSI
|
||||
PC1 = Pin(65) # PC1/ND_ALE/SPI0_MISO
|
||||
PC2 = Pin(66) # PC2/ND_CLE/SPI0_CLK
|
||||
|
||||
PH4 = Pin(228) # PH4/TWI1_SCK
|
||||
TWI1_SCL = PH4
|
||||
PH5 = Pin(229) # PH5/TWI1_SDA
|
||||
TWI1_SDA = PH5
|
||||
|
||||
|
||||
PH6 = Pin(230) # PH6/SPI0_CS/UART3_TX
|
||||
UART3_TX = PH6
|
||||
SPI0_CS = PH6
|
||||
|
||||
PH7 = Pin(231) # PH7/SPI0_CLK/UART3_RX
|
||||
UART3_RX = PH7
|
||||
SPI0_SCLK = PH7
|
||||
|
||||
PH8 = Pin(232) # PH8/SPI0_MOSI/UART3_RTS
|
||||
UART3_RTS = PH8
|
||||
SPI0_MOSI = PH8
|
||||
|
||||
PH9 = Pin(233) # PH9/SPI0_MISO/UART3_CTS
|
||||
UART3_CTS = PH9
|
||||
SPI0_MISO = PH9
|
||||
|
||||
|
||||
# ordered as i2cId, sclId, sdaId
|
||||
i2cPorts = ((0, TWI1_SCL, TWI1_SDA),)
|
||||
|
||||
# ordered as spiId, sckId, mosiId, misoId
|
||||
spiPorts = ((0, SPI0_SCLK, SPI0_MOSI, SPI0_MISO),)
|
||||
|
||||
# ordered as uartId, txId, rxId
|
||||
uartPorts = (
|
||||
(2, UART2_TX, UART2_RX),
|
||||
(3, UART3_TX, UART3_RX),
|
||||
)
|
||||
|
|
@ -0,0 +1 @@
|
|||
"""Definition for the AllWinner A64 chip"""
|
||||
88
src/adafruit_blinka/microcontroller/allwinner/a64/pin.py
Normal file
88
src/adafruit_blinka/microcontroller/allwinner/a64/pin.py
Normal file
|
|
@ -0,0 +1,88 @@
|
|||
"""Allwinner A64 pin names"""
|
||||
from adafruit_blinka.microcontroller.generic_linux.libgpiod_pin import Pin
|
||||
|
||||
PB0 = Pin((1, 32))
|
||||
UART2_TX = PB0
|
||||
PB1 = Pin((1, 33))
|
||||
UART2_RX = PB1
|
||||
PB2 = Pin((1, 34))
|
||||
PB3 = Pin((1, 35))
|
||||
PB4 = Pin((1, 36))
|
||||
PB5 = Pin((1, 37))
|
||||
PB6 = Pin((1, 38))
|
||||
PB7 = Pin((1, 39))
|
||||
|
||||
PC0 = Pin((1, 64))
|
||||
SPI0_MOSI = PC0
|
||||
PC1 = Pin((1, 65))
|
||||
SPI0_MISO = PC1
|
||||
PC2 = Pin((1, 66))
|
||||
SPI0_SCLK = PC2
|
||||
PC3 = Pin((1, 67))
|
||||
SPI0_CS = PC3
|
||||
PC4 = Pin((1, 68))
|
||||
PC5 = Pin((1, 69))
|
||||
PC6 = Pin((1, 70))
|
||||
PC7 = Pin((1, 71))
|
||||
PC8 = Pin((1, 72))
|
||||
PC9 = Pin((1, 73))
|
||||
PC10 = Pin((1, 74))
|
||||
PC11 = Pin((1, 75))
|
||||
PC12 = Pin((1, 76))
|
||||
PC13 = Pin((1, 77))
|
||||
PC14 = Pin((1, 78))
|
||||
PC15 = Pin((1, 79))
|
||||
PC16 = Pin((1, 80))
|
||||
|
||||
PD0 = Pin((1, 96))
|
||||
UART3_TX = PD0
|
||||
SPI1_CS = PD0
|
||||
PD1 = Pin((1, 97))
|
||||
SPI1_SCLK = PD1
|
||||
UART3_RX = PD1
|
||||
PD2 = Pin((1, 98))
|
||||
UART4_TX = PD2
|
||||
SPI1_MOSI = PD2
|
||||
PD3 = Pin((1, 99))
|
||||
UART4_RX = PD3
|
||||
SPI1_MISO = PD3
|
||||
PD4 = Pin((1, 100))
|
||||
PD5 = Pin((1, 101))
|
||||
PD6 = Pin((1, 102))
|
||||
|
||||
PE14 = Pin((1, 142))
|
||||
TWI2_SCL = PE14
|
||||
PE15 = Pin((1, 143))
|
||||
TWI2_SDA = PE15
|
||||
|
||||
PH2 = Pin((1, 226))
|
||||
TWI1_SCL = PH2
|
||||
PH3 = Pin((1, 227))
|
||||
TWI1_SDA = PH3
|
||||
PH4 = Pin((1, 228))
|
||||
PH5 = Pin((1, 229))
|
||||
PH6 = Pin((1, 230))
|
||||
PH7 = Pin((1, 231))
|
||||
PH8 = Pin((1, 232))
|
||||
PH9 = Pin((1, 233))
|
||||
|
||||
PL2 = Pin((0, 2))
|
||||
PL3 = Pin((0, 3))
|
||||
PL8 = Pin((0, 8))
|
||||
PL9 = Pin((0, 9))
|
||||
PL10 = Pin((0, 10))
|
||||
|
||||
# ordered as i2cId, sclId, sdaId
|
||||
i2cPorts = ((1, TWI1_SCL, TWI1_SDA), (2, TWI2_SCL, TWI2_SDA))
|
||||
|
||||
# ordered as spiId, sckId, mosiId, misoId
|
||||
spiPorts = (
|
||||
(0, SPI0_SCLK, SPI0_MOSI, SPI0_MISO),
|
||||
(1, SPI1_SCLK, SPI1_MOSI, SPI1_MISO),
|
||||
)
|
||||
# ordered as uartId, txId, rxId
|
||||
uartPorts = (
|
||||
(2, UART2_TX, UART2_RX),
|
||||
(3, UART3_TX, UART3_RX),
|
||||
(4, UART4_TX, UART4_RX),
|
||||
)
|
||||
|
|
@ -0,0 +1 @@
|
|||
"""Definition for the AllWinner H3 chip"""
|
||||
|
|
@ -1,3 +1,4 @@
|
|||
"""Allwinner H3 pin names"""
|
||||
from adafruit_blinka.microcontroller.generic_linux.libgpiod_pin import Pin
|
||||
|
||||
PA0 = Pin(0)
|
||||
|
|
@ -19,8 +20,11 @@ PA13 = Pin(13)
|
|||
UART3_TX = PA13
|
||||
PA14 = Pin(14)
|
||||
UART3_RX = PA14
|
||||
SPI1_SCLK = PA14
|
||||
PA15 = Pin(15)
|
||||
SPI1_MOSI = PA15
|
||||
PA16 = Pin(16)
|
||||
SPI1_MISO = PA16
|
||||
PA17 = Pin(17)
|
||||
PA18 = Pin(18)
|
||||
PA19 = Pin(19)
|
||||
|
|
@ -51,9 +55,14 @@ PG11 = Pin(203)
|
|||
PG12 = Pin(204)
|
||||
PG13 = Pin(205)
|
||||
|
||||
PL2 = Pin((1, 2))
|
||||
PL4 = Pin((1, 4))
|
||||
|
||||
i2cPorts = ( (0, TWI0_SCL, TWI0_SDA), )
|
||||
i2cPorts = ((0, TWI0_SCL, TWI0_SDA),)
|
||||
# ordered as spiId, sckId, mosiId, misoId
|
||||
spiPorts = ( (0, SPI0_SCLK, SPI0_MOSI, SPI0_MISO), )
|
||||
spiPorts = (
|
||||
(0, SPI0_SCLK, SPI0_MOSI, SPI0_MISO),
|
||||
(1, SPI1_SCLK, SPI1_MOSI, SPI1_MISO),
|
||||
)
|
||||
# ordered as uartId, txId, rxId
|
||||
uartPorts = ( (3, UART3_TX, UART3_RX), )
|
||||
uartPorts = ((3, UART3_TX, UART3_RX),)
|
||||
|
|
@ -0,0 +1 @@
|
|||
"""Definition for the AllWinner H5 chip"""
|
||||
68
src/adafruit_blinka/microcontroller/allwinner/h5/pin.py
Normal file
68
src/adafruit_blinka/microcontroller/allwinner/h5/pin.py
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
"""Allwinner H5 pin names"""
|
||||
from adafruit_blinka.microcontroller.generic_linux.libgpiod_pin import Pin
|
||||
|
||||
PA0 = Pin((1, 0))
|
||||
UART2_TX = PA0
|
||||
PA1 = Pin((1, 1))
|
||||
UART2_RX = PA1
|
||||
PA2 = Pin((1, 2))
|
||||
PA3 = Pin((1, 3))
|
||||
PA6 = Pin((1, 6))
|
||||
PA7 = Pin((1, 7))
|
||||
PA8 = Pin((1, 8))
|
||||
PA9 = Pin((1, 9))
|
||||
PA10 = Pin((1, 10))
|
||||
PA11 = Pin((1, 11))
|
||||
TWI0_SCL = PA11
|
||||
PA12 = Pin((1, 12))
|
||||
TWI0_SDA = PA12
|
||||
PA13 = Pin((1, 13))
|
||||
UART3_TX = PA13
|
||||
PA14 = Pin((1, 14))
|
||||
UART3_RX = PA14
|
||||
SPI1_SCLK = PA14
|
||||
PA15 = Pin((1, 15))
|
||||
SPI1_MOSI = PA15
|
||||
PA16 = Pin((1, 16))
|
||||
SPI1_MISO = PA16
|
||||
PA17 = Pin((1, 17))
|
||||
PA18 = Pin((1, 18))
|
||||
PA19 = Pin((1, 19))
|
||||
PA20 = Pin((1, 20))
|
||||
PA21 = Pin((1, 21))
|
||||
|
||||
PC0 = Pin((1, 64))
|
||||
SPI0_MOSI = PC0
|
||||
PC1 = Pin((1, 65))
|
||||
SPI0_MISO = PC1
|
||||
PC2 = Pin((1, 66))
|
||||
SPI0_SCLK = PC2
|
||||
PC3 = Pin((1, 67))
|
||||
SPI0_CS = PC3
|
||||
PC4 = Pin((1, 68))
|
||||
PC7 = Pin((1, 71))
|
||||
|
||||
PD14 = Pin((1, 110))
|
||||
|
||||
PG6 = Pin((1, 198))
|
||||
UART1_TX = PG6
|
||||
PG7 = Pin((1, 199))
|
||||
UART1_RX = PG7
|
||||
PG8 = Pin((1, 200))
|
||||
PG9 = Pin((1, 201))
|
||||
PG10 = Pin((1, 202))
|
||||
PG11 = Pin((1, 203))
|
||||
PG12 = Pin((1, 204))
|
||||
PG13 = Pin((1, 205))
|
||||
|
||||
PL0 = Pin((0, 0))
|
||||
PL1 = Pin((0, 1))
|
||||
|
||||
i2cPorts = ((0, TWI0_SCL, TWI0_SDA),)
|
||||
# ordered as spiId, sckId, mosiId, misoId
|
||||
spiPorts = (
|
||||
(0, SPI0_SCLK, SPI0_MOSI, SPI0_MISO),
|
||||
(1, SPI1_SCLK, SPI1_MOSI, SPI1_MISO),
|
||||
)
|
||||
# ordered as uartId, txId, rxId
|
||||
uartPorts = ((3, UART3_TX, UART3_RX),)
|
||||
|
|
@ -0,0 +1 @@
|
|||
"""Definition for the AllWinner H6 chip"""
|
||||
47
src/adafruit_blinka/microcontroller/allwinner/h6/pin.py
Normal file
47
src/adafruit_blinka/microcontroller/allwinner/h6/pin.py
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
"""Allwinner H6 Pin Names"""
|
||||
from adafruit_blinka.microcontroller.generic_linux.libgpiod_pin import Pin
|
||||
|
||||
PC16 = Pin((1, 79))
|
||||
|
||||
PD14 = Pin((1, 110))
|
||||
PD15 = Pin((1, 111))
|
||||
PD16 = Pin((1, 112))
|
||||
PD17 = Pin((1, 113))
|
||||
PD18 = Pin((1, 114))
|
||||
PD19 = Pin((1, 115))
|
||||
UART2_TX = PD19
|
||||
PD20 = Pin((1, 116))
|
||||
UART2_RX = PD20
|
||||
PD21 = Pin((1, 117))
|
||||
PD22 = Pin((1, 118))
|
||||
PD23 = Pin((1, 119))
|
||||
PD24 = Pin((1, 120))
|
||||
PD25 = Pin((1, 121))
|
||||
TWI0_SCL = PD25
|
||||
PD26 = Pin((1, 122))
|
||||
TWI0_SDA = PD26
|
||||
|
||||
PG10 = Pin((1, 202))
|
||||
PG11 = Pin((1, 203))
|
||||
PG12 = Pin((1, 204))
|
||||
PG13 = Pin((1, 205))
|
||||
PG14 = Pin((1, 206))
|
||||
|
||||
PH2 = Pin((1, 226))
|
||||
PH3 = Pin((1, 227))
|
||||
SPI1_CS = PH3
|
||||
PH4 = Pin((1, 228))
|
||||
SPI1_SCLK = PH4
|
||||
PH5 = Pin((1, 229))
|
||||
SPI1_MOSI = PH5
|
||||
PH6 = Pin((1, 230))
|
||||
SPI1_MISO = PH6
|
||||
PH8 = Pin((1, 230))
|
||||
PH9 = Pin((1, 231))
|
||||
|
||||
PL8 = Pin((1, 360))
|
||||
PL9 = Pin((1, 361))
|
||||
|
||||
i2cPorts = ((0, TWI0_SCL, TWI0_SDA),)
|
||||
spiPorts = ((0, SPI1_SCLK, SPI1_MOSI, SPI1_MISO),)
|
||||
uartPorts = ((2, UART2_TX, UART2_RX),)
|
||||
|
|
@ -1,7 +1,10 @@
|
|||
"""AM335x pin names"""
|
||||
import Adafruit_BBIO.GPIO as GPIO
|
||||
|
||||
# Pins dont exist in CPython so...lets make our own!
|
||||
|
||||
class Pin:
|
||||
"""Pins dont exist in CPython so...lets make our own!"""
|
||||
|
||||
IN = 0
|
||||
OUT = 1
|
||||
LOW = 0
|
||||
|
|
@ -9,11 +12,11 @@ class Pin:
|
|||
PULL_NONE = 0
|
||||
PULL_UP = 1
|
||||
PULL_DOWN = 2
|
||||
|
||||
|
||||
id = None
|
||||
_value = LOW
|
||||
_mode = IN
|
||||
|
||||
|
||||
def __init__(self, pin_name):
|
||||
self.id = pin_name
|
||||
|
||||
|
|
@ -24,7 +27,8 @@ class Pin:
|
|||
return self.id == other
|
||||
|
||||
def init(self, mode=IN, pull=None):
|
||||
if mode != None:
|
||||
"""Initialize the Pin"""
|
||||
if mode is not None:
|
||||
if mode == self.IN:
|
||||
self._mode = self.IN
|
||||
GPIO.setup(self.id, GPIO.IN)
|
||||
|
|
@ -33,7 +37,7 @@ class Pin:
|
|||
GPIO.setup(self.id, GPIO.OUT)
|
||||
else:
|
||||
raise RuntimeError("Invalid mode for pin: %s" % self.id)
|
||||
if pull != None:
|
||||
if pull is not None:
|
||||
if self._mode != self.IN:
|
||||
raise RuntimeError("Cannot set pull resistor on output")
|
||||
if pull == self.PULL_UP:
|
||||
|
|
@ -41,10 +45,11 @@ class Pin:
|
|||
elif pull == self.PULL_DOWN:
|
||||
GPIO.setup(self.id, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
|
||||
else:
|
||||
raise RuntimeError("Invalid pull for pin: %s" % self.id)
|
||||
raise RuntimeError("Invalid pull for pin: %s" % self.id)
|
||||
|
||||
def value(self, val=None):
|
||||
if val != None:
|
||||
"""Set or return the Pin Value"""
|
||||
if val is not None:
|
||||
if val == self.LOW:
|
||||
self._value = val
|
||||
GPIO.output(self.id, val)
|
||||
|
|
@ -53,146 +58,300 @@ class Pin:
|
|||
GPIO.output(self.id, val)
|
||||
else:
|
||||
raise RuntimeError("Invalid value for pin")
|
||||
else:
|
||||
return GPIO.input(self.id)
|
||||
return None
|
||||
return GPIO.input(self.id)
|
||||
|
||||
P8_3 = Pin('P8_3')
|
||||
P8_4 = Pin('P8_4')
|
||||
P8_5 = Pin('P8_5')
|
||||
P8_6 = Pin('P8_6')
|
||||
P8_7 = Pin('P8_7')
|
||||
P8_8 = Pin('P8_8')
|
||||
P8_9 = Pin('P8_9')
|
||||
P8_10 = Pin('P8_10')
|
||||
P8_11 = Pin('P8_11')
|
||||
P8_12 = Pin('P8_12')
|
||||
P8_13 = Pin('P8_13')
|
||||
P8_14 = Pin('P8_14')
|
||||
P8_15 = Pin('P8_15')
|
||||
P8_16 = Pin('P8_16')
|
||||
P8_17 = Pin('P8_17')
|
||||
P8_18 = Pin('P8_18')
|
||||
P8_19 = Pin('P8_19')
|
||||
P8_20 = Pin('P8_20')
|
||||
P8_21 = Pin('P8_21')
|
||||
P8_22 = Pin('P8_22')
|
||||
P8_23 = Pin('P8_23')
|
||||
P8_24 = Pin('P8_24')
|
||||
P8_25 = Pin('P8_25')
|
||||
P8_26 = Pin('P8_26')
|
||||
P8_27 = Pin('P8_27')
|
||||
P8_28 = Pin('P8_28')
|
||||
P8_29 = Pin('P8_29')
|
||||
P8_30 = Pin('P8_30')
|
||||
P8_31 = Pin('P8_31')
|
||||
P8_32 = Pin('P8_32')
|
||||
P8_33 = Pin('P8_33')
|
||||
P8_34 = Pin('P8_34')
|
||||
P8_35 = Pin('P8_35')
|
||||
P8_36 = Pin('P8_36')
|
||||
P8_37 = Pin('P8_37')
|
||||
P8_38 = Pin('P8_38')
|
||||
P8_39 = Pin('P8_39')
|
||||
P8_40 = Pin('P8_40')
|
||||
P8_41 = Pin('P8_41')
|
||||
P8_42 = Pin('P8_42')
|
||||
P8_43 = Pin('P8_43')
|
||||
P8_44 = Pin('P8_44')
|
||||
P8_45 = Pin('P8_45')
|
||||
P8_46 = Pin('P8_46')
|
||||
P9_11 = Pin('P9_11')
|
||||
P9_12 = Pin('P9_12')
|
||||
P9_13 = Pin('P9_13')
|
||||
P9_14 = Pin('P9_14')
|
||||
P9_15 = Pin('P9_15')
|
||||
P9_16 = Pin('P9_16')
|
||||
P9_17 = Pin('P9_17')
|
||||
P9_18 = Pin('P9_18')
|
||||
P9_19 = Pin('P9_19')
|
||||
P9_20 = Pin('P9_20')
|
||||
P9_21 = Pin('P9_21')
|
||||
P9_22 = Pin('P9_22')
|
||||
P9_23 = Pin('P9_23')
|
||||
P9_24 = Pin('P9_24')
|
||||
P9_25 = Pin('P9_25')
|
||||
P9_26 = Pin('P9_26')
|
||||
P9_27 = Pin('P9_27')
|
||||
P9_28 = Pin('P9_28')
|
||||
P9_29 = Pin('P9_29')
|
||||
P9_30 = Pin('P9_30')
|
||||
P9_31 = Pin('P9_31')
|
||||
P9_41 = Pin('P9_41')
|
||||
P9_42 = Pin('P9_42')
|
||||
|
||||
USR0 = Pin('USR0')
|
||||
USR1 = Pin('USR1')
|
||||
USR2 = Pin('USR2')
|
||||
USR3 = Pin('USR3')
|
||||
# names in comments copied from
|
||||
# https://github.com/adafruit/adafruit-beaglebone-io-python/blob/master/source/common.c#L73
|
||||
|
||||
SCL = Pin('P9_19')
|
||||
SDA = Pin('P9_20')
|
||||
# PocketBeagle
|
||||
# P1_1 = SYS VIN # VIN_AC
|
||||
P1_2 = Pin("P1_2") # GPIO2_23 - GPIO_87
|
||||
P1_3 = Pin("P1_3") # USB1_VBUS_OUT - (silkscreen: USB1 V_EN)
|
||||
P1_4 = Pin("P1_4") # GPIO2_25 - GPIO_89
|
||||
# P1_5 = USB VBUS # USB1_VBUS_IN
|
||||
P1_6 = Pin("P1_6") # SPI0_CS0 - GPIO_5
|
||||
# P1_7 = USB VIN # VIN-USB
|
||||
P1_8 = Pin("P1_8") # SPI0_SCLK - GPIO_2
|
||||
# P1_9 = USB1 DN # USB1-DN
|
||||
P1_10 = Pin("P1_10") # SPI0_D0 - GPIO_3
|
||||
# P1_11 = USB1 DP # USB1-DP
|
||||
P1_12 = Pin("P1_12") # SPI0_D1 - GPIO_4
|
||||
# P1_13 = USB1 ID # USB1-ID
|
||||
# P1_14 = SYS 3.3V # VOUT-3.3V
|
||||
# P1_15 = SYS GND # GND
|
||||
# P1_16 = SYS GND # GND
|
||||
# P1_17 = AIN 1.8V REF- # VREFN
|
||||
# P1_18 = AIN 1.8V REF+ # VREFP
|
||||
P1_19 = Pin("P1_19") # AIN0
|
||||
P1_20 = Pin("P1_20") # GPIO0_20 - GPIO_20
|
||||
P1_21 = Pin("P1_21") # AIN1
|
||||
# P1_22 = SYS GND # GND
|
||||
P1_23 = Pin("P1_23") # AIN2
|
||||
# P1_22 = SYS VOUT # VOUT-5V
|
||||
P1_25 = Pin("P1_25") # AIN3
|
||||
P1_26 = Pin("P1_26") # I2C2_SDA - GPIO_12
|
||||
P1_27 = Pin("P1_27") # AIN4
|
||||
P1_28 = Pin("P1_28") # I2C2_SCL - GPIO_13
|
||||
P1_29 = Pin("P1_29") # GPIO3_21 - GPIO_117
|
||||
P1_30 = Pin("P1_30") # UART0_TXD - GPIO_43
|
||||
P1_31 = Pin("P1_31") # GPIO3_18 - GPIO_114
|
||||
P1_32 = Pin("P1_32") # UART0_RXD - GPIO_42
|
||||
P1_33 = Pin("P1_33") # GPIO3_15 - GPIO_111
|
||||
P1_34 = Pin("P1_34") # GPIO0_26 - GPIO_26
|
||||
P1_35 = Pin("P1_35") # GPIO2_24 - GPIO_88
|
||||
P1_36 = Pin("P1_36") # EHRPWM0A - GPIO_110
|
||||
|
||||
# Refer to header default pin modes
|
||||
# http://beagleboard.org/static/images/cape-headers.png
|
||||
#
|
||||
# P9_17 (SPI0_CSO => CE0) enables peripheral device
|
||||
# P9_18 (SPI0_D1 => MOSI) outputs data to peripheral device
|
||||
# P9_21 (SPIO_DO => MISO) receives data from peripheral device
|
||||
# P9_22 (SPI0_SCLK => SCLK) outputs clock signal
|
||||
#
|
||||
# Use config-pin to set pin mode for SPI pins
|
||||
# https://github.com/beagleboard/bb.org-overlays/tree/master/tools/beaglebone-universal-io
|
||||
# config-pin p9.17 spi_cs
|
||||
# config-pin p9.18 spi
|
||||
# config-pin p9.21 spi
|
||||
# config-pin p9.22 spi_sclk
|
||||
#
|
||||
CE0 = Pin('P9_17')
|
||||
MOSI = Pin('P9_18')
|
||||
MISO = Pin('P9_21')
|
||||
SCLK = Pin('P9_22')
|
||||
#CircuitPython naming convention for SPI Clock
|
||||
SCK = Pin('P9_22')
|
||||
|
||||
# Pins for SPI1
|
||||
# refer to:
|
||||
# http://beagleboard.org/static/images/cape-headers-spi.png
|
||||
#
|
||||
# CE1 P9.28 SPI1_CS0
|
||||
# MISO_1 P9.29 SPI1_D0
|
||||
# MOSI_1 P9.30 SPI1_D1
|
||||
# SCLK_1 P9.31 SPI_SCLK
|
||||
#
|
||||
# SPI1 conflicts with HDMI Audio (McASP)
|
||||
#
|
||||
# Refer to:
|
||||
# https://elinux.org/Beagleboard:BeagleBoneBlack_Debian#U-Boot_Overlays
|
||||
#
|
||||
# To Disable HDMI AUDIO, uncomment this line in /boot/uEnv.txt:
|
||||
# disable_uboot_overlay_audio=1
|
||||
#
|
||||
# Set pin modes for SPI1 with:
|
||||
#
|
||||
# config-pin p9.28 spi1_cs
|
||||
# config-pin p9.29 spi1
|
||||
# config-pin p9.30 spi1
|
||||
# config-pin p9.31 spi_sclk
|
||||
CE1 = Pin('P9_28')
|
||||
MOSI_1 = Pin('P9_29')
|
||||
MISO_1 = Pin('P9_30')
|
||||
SCLK_1 = Pin('P9_31')
|
||||
#CircuitPython naming convention for SPI Clock
|
||||
SCK_1 = Pin('P9_31')
|
||||
P2_1 = Pin("P2_1") # EHRPWM1A - GPIO_50
|
||||
P2_2 = Pin("P2_2") # GPIO1_27 - GPIO_59
|
||||
P2_3 = Pin("P2_3") # GPIO0_23 - GPIO_23
|
||||
P2_4 = Pin("P2_4") # GPIO1_26 - GPIO_58
|
||||
P2_5 = Pin("P2_5") # UART4_RXD - GPIO_30
|
||||
P2_6 = Pin("P2_6") # GPIO1_25 - GPIO_57
|
||||
P2_7 = Pin("P2_7") # UART4_TXD - GPIO_31
|
||||
P2_8 = Pin("P2_8") # GPIO1_28 - GPIO_60
|
||||
P2_9 = Pin("P2_9") # I2C1_SCL - GPIO_15
|
||||
P2_10 = Pin("P2_10") # GPIO1_20 - GPIO_52
|
||||
P2_11 = Pin("P2_11") # I2C1_SDA - GPIO_14
|
||||
# P2_12 = SYS PWR BTN # POWER_BUTTON
|
||||
# P2_13 = SYS VOUT # VOUT-5V
|
||||
# P2_14 = BAT VIN # BAT-VIN
|
||||
# P2_15 = SYS GND # GND
|
||||
# P2_16 = BAT TEMP # BAT-TEMP
|
||||
P2_17 = Pin("P2_17") # GPIO2_1 - GPIO_65
|
||||
P2_18 = Pin("P2_18") # GPIO1_15 - GPIO_47
|
||||
P2_19 = Pin("P2_19") # GPIO0_27 - GPIO_27
|
||||
P2_20 = Pin("P2_20") # GPIO2_0 - GPIO_64
|
||||
# P2_21 = SYS GND # GND
|
||||
P2_22 = Pin("P2_22") # GPIO1_14 - GPIO_46
|
||||
# P2_23 = SYS 3.3V # VOUT-3.3V
|
||||
P2_24 = Pin("P2_24") # GPIO1_12 - GPIO_44
|
||||
P2_25 = Pin("P2_25") # SPI1_D1 - GPIO_41
|
||||
# P2_26 = SYS NRST # RESET#
|
||||
P2_27 = Pin("P2_27") # SPI1_D0 - GPIO_40
|
||||
P2_28 = Pin("P2_28") # GPIO3_20 - GPIO_116
|
||||
P2_29 = Pin("P2_29") # SPI1_SCLK - GPIO_7
|
||||
P2_30 = Pin("P2_30") # GPIO3_17 - GPIO_113
|
||||
P2_31 = Pin("P2_31") # SPI1_CS1 - GPIO_19
|
||||
P2_32 = Pin("P2_32") # GPIO3_16 - GPIO_112
|
||||
P2_33 = Pin("P2_33") # GPIO1_13 - GPIO_45
|
||||
P2_34 = Pin("P2_34") # GPIO3_19 - GPIO_115
|
||||
P2_35 = Pin("P2_35") # GPIO2_22 - GPIO_86
|
||||
P2_36 = Pin("P2_36") # AIN7
|
||||
|
||||
|
||||
# BeagleBone Black
|
||||
# P8_1 = DGND # DGND - GPIO_0
|
||||
# P8_2 = DGND # DGND - GPIO_0
|
||||
P8_3 = Pin("P8_3") # GPIO1_6 - GPIO_38
|
||||
P8_4 = Pin("P8_4") # GPIO1_7 - GPIO_39
|
||||
P8_5 = Pin("P8_5") # GPIO1_2 - GPIO_34
|
||||
P8_6 = Pin("P8_6") # GPIO1_3 - GPIO_35
|
||||
P8_7 = Pin("P8_7") # TIMER4 - GPIO_66
|
||||
P8_8 = Pin("P8_8") # TIMER7 - GPIO_67
|
||||
P8_9 = Pin("P8_9") # TIMER5 - GPIO_69
|
||||
P8_10 = Pin("P8_10") # TIMER6 - GPIO_68
|
||||
P8_11 = Pin("P8_11") # GPIO1_13 - GPIO_45
|
||||
P8_12 = Pin("P8_12") # GPIO1_12 - GPIO_44
|
||||
P8_13 = Pin("P8_13") # EHRPWM2B - GPIO_23
|
||||
P8_14 = Pin("P8_14") # GPIO0_26 - GPIO_26
|
||||
P8_15 = Pin("P8_15") # GPIO1_15 - GPIO_47
|
||||
P8_16 = Pin("P8_16") # GPIO1_14 - GPIO_46
|
||||
P8_17 = Pin("P8_17") # GPIO0_27 - GPIO_27
|
||||
P8_18 = Pin("P8_18") # GPIO2_1 - GPIO_65
|
||||
P8_19 = Pin("P8_19") # EHRPWM2A - GPIO_22
|
||||
P8_20 = Pin("P8_20") # GPIO1_31 - GPIO_63
|
||||
P8_21 = Pin("P8_21") # GPIO1_30 - GPIO_62
|
||||
P8_22 = Pin("P8_22") # GPIO1_5 - GPIO_37
|
||||
P8_23 = Pin("P8_23") # GPIO1_4 - GPIO_36
|
||||
P8_24 = Pin("P8_24") # GPIO1_1 - GPIO_33
|
||||
P8_25 = Pin("P8_25") # GPIO1_0 - GPIO_32
|
||||
P8_26 = Pin("P8_26") # GPIO1_29 - GPIO_61
|
||||
P8_27 = Pin("P8_27") # GPIO2_22 - GPIO_86
|
||||
P8_28 = Pin("P8_28") # GPIO2_24 - GPIO_88
|
||||
P8_29 = Pin("P8_29") # GPIO2_23 - GPIO_87
|
||||
P8_30 = Pin("P8_30") # GPIO2_25 - GPIO_89
|
||||
P8_31 = Pin("P8_31") # UART5_CTSN - GPIO_10
|
||||
P8_32 = Pin("P8_32") # UART5_RTSN - GPIO_11
|
||||
P8_33 = Pin("P8_33") # UART4_RTSN - GPIO_9
|
||||
P8_34 = Pin("P8_34") # UART3_RTSN - GPIO_81
|
||||
P8_35 = Pin("P8_35") # UART4_CTSN - GPIO_8
|
||||
P8_36 = Pin("P8_36") # UART3_CTSN - GPIO_80
|
||||
P8_37 = Pin("P8_37") # UART5_TXD - GPIO_78
|
||||
P8_38 = Pin("P8_38") # UART5_RXD - GPIO_79
|
||||
P8_39 = Pin("P8_39") # GPIO2_12 - GPIO_76
|
||||
P8_40 = Pin("P8_40") # GPIO2_13 - GPIO_77
|
||||
P8_41 = Pin("P8_41") # GPIO2_10 - GPIO_74
|
||||
P8_42 = Pin("P8_42") # GPIO2_11 - GPIO_75
|
||||
P8_43 = Pin("P8_43") # GPIO2_8 - GPIO_72
|
||||
P8_44 = Pin("P8_44") # GPIO2_9 - GPIO_73
|
||||
P8_45 = Pin("P8_45") # GPIO2_6 - GPIO_70
|
||||
P8_46 = Pin("P8_46") # GPIO2_7 - GPIO_71
|
||||
|
||||
# P9_1 = DGND # DGND - GPIO_0
|
||||
# P9_2 = DGND # DGND - GPIO_0
|
||||
# P9_3 = VDD_3V3 # VDD_3V3 - GPIO_0
|
||||
# P9_4 = VDD_3V3 # VDD_3V3 - GPIO_0
|
||||
# P9_5 = VDD_5V # VDD_5V - GPIO_0
|
||||
# P9_6 = VDD_5V # VDD_5V - GPIO_0
|
||||
# P9_7 = SYS_5V # SYS_5V - GPIO_0
|
||||
# P9_8 = SYS_5V # SYS_5V - GPIO_0
|
||||
# P9_9 = PWR_BUT # PWR_BUT - GPIO_0
|
||||
# P9_10 = SYS_RESETN # SYS_RESETn - GPIO_0
|
||||
P9_11 = Pin("P9_11") # UART4_RXD - GPIO_30
|
||||
P9_12 = Pin("P9_12") # GPIO1_28 - GPIO_60
|
||||
P9_13 = Pin("P9_13") # UART4_TXD - GPIO_31
|
||||
P9_14 = Pin("P9_14") # EHRPWM1A - GPIO_50
|
||||
P9_15 = Pin("P9_15") # GPIO1_16 - GPIO_48
|
||||
P9_16 = Pin("P9_16") # EHRPWM1B - GPIO_51
|
||||
P9_17 = Pin("P9_17") # I2C1_SCL - GPIO_5
|
||||
P9_18 = Pin("P9_18") # I2C1_SDA - GPIO_4
|
||||
P9_19 = Pin("P9_19") # I2C2_SCL - GPIO_13
|
||||
P9_20 = Pin("P9_20") # I2C2_SDA - GPIO_12
|
||||
P9_21 = Pin("P9_21") # UART2_TXD - GPIO_3
|
||||
P9_22 = Pin("P9_22") # UART2_RXD - GPIO_2
|
||||
P9_23 = Pin("P9_23") # GPIO1_17 - GPIO_49
|
||||
P9_24 = Pin("P9_24") # UART1_TXD - GPIO_15
|
||||
P9_25 = Pin("P9_25") # GPIO3_21 - GPIO_117
|
||||
P9_26 = Pin("P9_26") # UART1_RXD - GPIO_14
|
||||
P9_27 = Pin("P9_27") # GPIO3_19 - GPIO_115
|
||||
P9_28 = Pin("P9_28") # SPI1_CS0 - GPIO_113
|
||||
P9_29 = Pin("P9_29") # SPI1_D0 - GPIO_111
|
||||
P9_30 = Pin("P9_30") # SPI1_D1 - GPIO_112
|
||||
P9_31 = Pin("P9_31") # SPI1_SCLK - GPIO_110
|
||||
# P9_32 = VDD_ADC # VDD_ADC - GPIO_0
|
||||
# P9_33 = AIN4 # AIN4 - GPIO_0
|
||||
# P9_34 = GNDA_ADC # GNDA_ADC - GPIO_0
|
||||
# P9_35 = AIN6 # AIN6 - GPIO_0
|
||||
# P9_36 = AIN5 # AIN5 - GPIO_0
|
||||
# P9_37 = AIN2 # AIN2 - GPIO_0
|
||||
# P9_38 = AIN3 # AIN3 - GPIO_0
|
||||
# P9_39 = AIN0 # AIN0 - GPIO_0
|
||||
# P9_40 = AIN1 # AIN1 - GPIO_0
|
||||
P9_41 = Pin("P9_41") # CLKOUT2 - GPIO_20
|
||||
P9_42 = Pin("P9_42") # GPIO0_7 - GPIO_7
|
||||
# P9_43 = DGND # DGND - GPIO_0
|
||||
# P9_44 = DGND # DGND - GPIO_0
|
||||
# P9_45 = DGND # DGND - GPIO_0
|
||||
# P9_46 = DGND # DGND - GPIO_0
|
||||
|
||||
|
||||
##########################################
|
||||
# common to all beagles
|
||||
USR0 = Pin("USR0") # USR0 - GPIO_53
|
||||
USR1 = Pin("USR1") # USR1 - GPIO_54
|
||||
USR2 = Pin("USR2") # USR2 - GPIO_55
|
||||
USR3 = Pin("USR3") # USR3 - GPIO_56
|
||||
|
||||
|
||||
##########################################
|
||||
# specials
|
||||
|
||||
# analog input
|
||||
AIN0 = Pin("AIN0")
|
||||
AIN1 = Pin("AIN1")
|
||||
AIN2 = Pin("AIN2")
|
||||
AIN3 = Pin("AIN3")
|
||||
AIN4 = Pin("AIN4")
|
||||
AIN5 = Pin("AIN5")
|
||||
AIN6 = Pin("AIN6")
|
||||
AIN7 = Pin("AIN7")
|
||||
|
||||
# PWM
|
||||
EHRPWM0A = Pin("EHRPWM0A")
|
||||
EHRPWM0B = Pin("EHRPWM0B")
|
||||
EHRPWM1A = Pin("EHRPWM1A")
|
||||
EHRPWM1B = Pin("EHRPWM1B")
|
||||
EHRPWM2A = Pin("EHRPWM2A")
|
||||
EHRPWM2B = Pin("EHRPWM2B")
|
||||
ECAPPWM0 = Pin("ECAPPWM0")
|
||||
ECAPPWM2 = Pin("ECAPPWM2")
|
||||
TIMER4 = Pin("TIMER4")
|
||||
TIMER5 = Pin("TIMER5")
|
||||
TIMER6 = Pin("TIMER6")
|
||||
TIMER7 = Pin("TIMER7")
|
||||
|
||||
|
||||
# I2C1
|
||||
I2C1_SDA = Pin("I2C1_SDA")
|
||||
I2C1_SCL = Pin("I2C1_SCL")
|
||||
|
||||
# I2C2
|
||||
I2C2_SDA = Pin("I2C2_SDA")
|
||||
I2C2_SCL = Pin("I2C2_SCL")
|
||||
|
||||
# SPI0
|
||||
SPI0_CS0 = Pin("SPI0_CS0")
|
||||
SPI0_SCLK = Pin("SPI0_SCLK")
|
||||
SPI0_D1 = Pin("SPI0_D1")
|
||||
SPI0_D0 = Pin("SPI0_D0")
|
||||
|
||||
# SPI1
|
||||
SPI1_CS0 = Pin("SPI1_CS0")
|
||||
SPI1_CS1 = Pin("SPI1_CS1")
|
||||
SPI1_SCLK = Pin("SPI1_SCLK")
|
||||
SPI1_D1 = Pin("SPI1_D1")
|
||||
SPI1_D0 = Pin("SPI1_D0")
|
||||
|
||||
# UART0
|
||||
UART0_TXD = Pin("UART0_TXD")
|
||||
UART0_RXD = Pin("UART0_RXD")
|
||||
|
||||
# UART1
|
||||
UART1_TXD = Pin("UART1_TXD")
|
||||
UART1_RXD = Pin("UART1_RXD")
|
||||
UART1_RTSn = Pin("UART1_RTSn")
|
||||
UART1_CTSn = Pin("UART1_CTSn")
|
||||
|
||||
# UART2
|
||||
UART2_TXD = Pin("UART2_TXD")
|
||||
UART2_RXD = Pin("UART2_RXD")
|
||||
|
||||
# UART3
|
||||
UART3_TXD = Pin("UART3_TXD")
|
||||
UART3_RXD = Pin("UART3_RXD")
|
||||
UART3_RTSn = Pin("UART3_RTSn")
|
||||
UART3_CTSn = Pin("UART3_CTSn")
|
||||
|
||||
# UART4
|
||||
UART4_TXD = Pin("UART4_TXD")
|
||||
UART4_RXD = Pin("UART4_RXD")
|
||||
UART4_RTSn = Pin("UART4_RTSn")
|
||||
UART4_CTSn = Pin("UART4_CTSn")
|
||||
|
||||
# UART5
|
||||
UART5_TXD = Pin("UART5_TXD")
|
||||
UART5_RXD = Pin("UART5_RXD")
|
||||
UART5_RTSn = Pin("UART5_RTSn")
|
||||
UART5_CTSn = Pin("UART5_CTSn")
|
||||
|
||||
|
||||
# ordered as spiId, sckId, mosiId, misoId
|
||||
spiPorts = ((0, SCLK, MOSI, MISO), (1, SCLK_1, MOSI_1, MISO_1))
|
||||
spiPorts = (
|
||||
(0, SPI0_SCLK, SPI0_D1, SPI0_D0),
|
||||
(1, SPI1_SCLK, SPI1_D1, SPI1_D0),
|
||||
)
|
||||
|
||||
# ordered as uartId, txId, rxId
|
||||
uartPorts = (
|
||||
(),
|
||||
# (0, UART0_TXD, UART0_RXD),
|
||||
# (1, UART1_TXD, UART1_RXD),
|
||||
# (2, UART2_TXD, UART2_RXD),
|
||||
# (4, UART4_TXD, UART4_RXD),
|
||||
# (5, UART5_TXD, UART5_RXD),
|
||||
)
|
||||
|
||||
# ordered as i2cId, SCL, SDA
|
||||
i2cPorts = (
|
||||
(2, SCL, SDA),
|
||||
(1, I2C1_SCL, I2C1_SDA),
|
||||
(2, I2C2_SCL, I2C2_SDA),
|
||||
)
|
||||
|
||||
PWM1 = P1_36
|
||||
PWM2 = P1_33
|
||||
PWM3 = P2_1
|
||||
PWM4 = P2_3
|
||||
|
||||
pwmOuts = (((0, 0), PWM1), ((0, 1), PWM2), ((2, 0), PWM3), ((4, 1), PWM4))
|
||||
|
|
|
|||
330
src/adafruit_blinka/microcontroller/am335x/sysfs_pwmout.py
Normal file
330
src/adafruit_blinka/microcontroller/am335x/sysfs_pwmout.py
Normal file
|
|
@ -0,0 +1,330 @@
|
|||
"""
|
||||
Much code from https://github.com/vsergeev/python-periphery/blob/master/periphery/pwm.py
|
||||
Copyright (c) 2015-2016 vsergeev / Ivan (Vanya) A. Sergeev
|
||||
License: MIT
|
||||
"""
|
||||
|
||||
import os
|
||||
|
||||
try:
|
||||
from microcontroller.pin import pwmOuts
|
||||
except ImportError:
|
||||
raise RuntimeError("No PWM outputs defined for this board") from ImportError
|
||||
|
||||
# pylint: disable=unnecessary-pass
|
||||
class PWMError(IOError):
|
||||
"""Base class for PWM errors."""
|
||||
|
||||
pass
|
||||
|
||||
|
||||
# pylint: enable=unnecessary-pass
|
||||
|
||||
|
||||
class PWMOut:
|
||||
"""Pulse Width Modulation Output Class"""
|
||||
|
||||
# Sysfs paths
|
||||
_sysfs_path = "/sys/class/pwm/"
|
||||
_channel_path = "pwmchip{}"
|
||||
|
||||
# Channel paths
|
||||
_export_path = "export"
|
||||
_unexport_path = "unexport"
|
||||
_pin_path = "pwm-{}:{}"
|
||||
|
||||
# Pin attribute paths
|
||||
_pin_period_path = "period"
|
||||
_pin_duty_cycle_path = "duty_cycle"
|
||||
_pin_polarity_path = "polarity"
|
||||
_pin_enable_path = "enable"
|
||||
|
||||
def __init__(self, pin, *, frequency=500, duty_cycle=0, variable_frequency=False):
|
||||
"""Instantiate a PWM object and open the sysfs PWM corresponding to the
|
||||
specified channel and pin.
|
||||
|
||||
Args:
|
||||
pin (Pin): CircuitPython Pin object to output to
|
||||
duty_cycle (int) : The fraction of each pulse which is high. 16-bit
|
||||
frequency (int) : target frequency in Hertz (32-bit)
|
||||
variable_frequency (bool) : True if the frequency will change over time
|
||||
|
||||
Returns:
|
||||
PWMOut: PWMOut object.
|
||||
|
||||
Raises:
|
||||
PWMError: if an I/O or OS error occurs.
|
||||
TypeError: if `channel` or `pin` types are invalid.
|
||||
ValueError: if PWM channel does not exist.
|
||||
|
||||
"""
|
||||
|
||||
self._pwmpin = None
|
||||
self._channel = None
|
||||
self._period = 0
|
||||
self._open(pin, duty_cycle, frequency, variable_frequency)
|
||||
|
||||
def __del__(self):
|
||||
self.deinit()
|
||||
|
||||
def __enter__(self):
|
||||
return self
|
||||
|
||||
def __exit__(self, t, value, traceback):
|
||||
self.deinit()
|
||||
|
||||
def _open(self, pin, duty=0, freq=500, variable_frequency=False):
|
||||
self._channel = None
|
||||
for pwmpair in pwmOuts:
|
||||
if pwmpair[1] == pin:
|
||||
self._channel = pwmpair[0][0]
|
||||
self._pwmpin = pwmpair[0][1]
|
||||
|
||||
self._pin = pin
|
||||
if self._channel is None:
|
||||
raise RuntimeError("No PWM channel found for this Pin")
|
||||
|
||||
if variable_frequency:
|
||||
print("Variable Frequency is not supported, continuing without it...")
|
||||
|
||||
channel_path = os.path.join(
|
||||
self._sysfs_path, self._channel_path.format(self._channel)
|
||||
)
|
||||
if not os.path.isdir(channel_path):
|
||||
raise ValueError(
|
||||
"PWM channel does not exist, check that the required modules are loaded."
|
||||
)
|
||||
|
||||
pin_path = os.path.join(
|
||||
channel_path, self._pin_path.format(self._channel, self._pwmpin)
|
||||
)
|
||||
if not os.path.isdir(pin_path):
|
||||
try:
|
||||
with open(
|
||||
os.path.join(channel_path, self._export_path), "w"
|
||||
) as f_export:
|
||||
f_export.write("%d\n" % self._pwmpin)
|
||||
except IOError as e:
|
||||
raise PWMError(e.errno, "Exporting PWM pin: " + e.strerror) from IOError
|
||||
|
||||
# Look up the period, for fast duty cycle updates
|
||||
self._period = self._get_period()
|
||||
|
||||
# set frequency
|
||||
self.frequency = freq
|
||||
# set duty
|
||||
self.duty_cycle = duty
|
||||
|
||||
self._set_enabled(True)
|
||||
|
||||
def deinit(self):
|
||||
"""Deinit the sysfs PWM."""
|
||||
# pylint: disable=broad-except
|
||||
try:
|
||||
channel_path = os.path.join(
|
||||
self._sysfs_path, self._channel_path.format(self._channel)
|
||||
)
|
||||
|
||||
if self._channel is not None:
|
||||
# self.duty_cycle = 0
|
||||
self._set_enabled(False) # make to disable before unexport
|
||||
try:
|
||||
# unexport_path = os.path.join(channel_path, self._unexport_path)
|
||||
with open(
|
||||
os.path.join(channel_path, self._unexport_path), "w"
|
||||
) as f_unexport:
|
||||
f_unexport.write("%d\n" % self._pwmpin)
|
||||
except IOError as e:
|
||||
raise PWMError(
|
||||
e.errno, "Unexporting PWM pin: " + e.strerror
|
||||
) from IOError
|
||||
except Exception as e:
|
||||
# due to a race condition for which I have not yet been
|
||||
# able to find the root cause, deinit() often fails
|
||||
# but it does not effect future usage of the pwm pin
|
||||
print(
|
||||
"warning: failed to deinitialize pwm pin {0}:{1} due to: {2}\n".format(
|
||||
self._channel, self._pwmpin, type(e).__name__
|
||||
)
|
||||
)
|
||||
finally:
|
||||
self._channel = None
|
||||
self._pwmpin = None
|
||||
# pylint: enable=broad-except
|
||||
|
||||
def _is_deinited(self):
|
||||
if self._pwmpin is None:
|
||||
raise ValueError(
|
||||
"Object has been deinitialize and can no longer "
|
||||
"be used. Create a new object."
|
||||
)
|
||||
|
||||
def _write_pin_attr(self, attr, value):
|
||||
# Make sure the pin is active
|
||||
self._is_deinited()
|
||||
|
||||
path = os.path.join(
|
||||
self._sysfs_path,
|
||||
self._channel_path.format(self._channel),
|
||||
self._pin_path.format(self._channel, self._pwmpin),
|
||||
attr,
|
||||
)
|
||||
|
||||
with open(path, "w") as f_attr:
|
||||
f_attr.write(value + "\n")
|
||||
|
||||
def _read_pin_attr(self, attr):
|
||||
# Make sure the pin is active
|
||||
self._is_deinited()
|
||||
|
||||
path = os.path.join(
|
||||
self._sysfs_path,
|
||||
self._channel_path.format(self._channel),
|
||||
self._pin_path.format(self._channel, self._pwmpin),
|
||||
attr,
|
||||
)
|
||||
|
||||
with open(path, "r") as f_attr:
|
||||
return f_attr.read().strip()
|
||||
|
||||
# Mutable properties
|
||||
|
||||
def _get_period(self):
|
||||
period_ns = self._read_pin_attr(self._pin_period_path)
|
||||
try:
|
||||
period_ns = int(period_ns)
|
||||
except ValueError:
|
||||
raise PWMError(
|
||||
None, 'Unknown period value: "%s"' % period_ns
|
||||
) from ValueError
|
||||
|
||||
# Convert period from nanoseconds to seconds
|
||||
period = period_ns / 1e9
|
||||
|
||||
# Update our cached period
|
||||
self._period = period
|
||||
|
||||
return period
|
||||
|
||||
def _set_period(self, period):
|
||||
if not isinstance(period, (int, float)):
|
||||
raise TypeError("Invalid period type, should be int or float.")
|
||||
|
||||
# Convert period from seconds to integer nanoseconds
|
||||
period_ns = int(period * 1e9)
|
||||
|
||||
self._write_pin_attr(self._pin_period_path, "{}".format(period_ns))
|
||||
|
||||
# Update our cached period
|
||||
self._period = float(period)
|
||||
|
||||
period = property(_get_period, _set_period)
|
||||
|
||||
"""Get or set the PWM's output period in seconds.
|
||||
|
||||
Raises:
|
||||
PWMError: if an I/O or OS error occurs.
|
||||
TypeError: if value type is not int or float.
|
||||
|
||||
:type: int, float
|
||||
"""
|
||||
|
||||
def _get_duty_cycle(self):
|
||||
duty_cycle_ns = self._read_pin_attr(self._pin_duty_cycle_path)
|
||||
try:
|
||||
duty_cycle_ns = int(duty_cycle_ns)
|
||||
except ValueError:
|
||||
raise PWMError(
|
||||
None, 'Unknown duty cycle value: "%s"' % duty_cycle_ns
|
||||
) from ValueError
|
||||
|
||||
# Convert duty cycle from nanoseconds to seconds
|
||||
duty_cycle = duty_cycle_ns / 1e9
|
||||
|
||||
# Convert duty cycle to ratio from 0.0 to 1.0
|
||||
duty_cycle = duty_cycle / self._period
|
||||
|
||||
# convert to 16-bit
|
||||
duty_cycle = int(duty_cycle * 65535)
|
||||
return duty_cycle
|
||||
|
||||
def _set_duty_cycle(self, duty_cycle):
|
||||
if not isinstance(duty_cycle, (int, float)):
|
||||
raise TypeError("Invalid duty cycle type, should be int or float.")
|
||||
|
||||
# convert from 16-bit
|
||||
duty_cycle /= 65535.0
|
||||
if not 0.0 <= duty_cycle <= 1.0:
|
||||
raise ValueError("Invalid duty cycle value, should be between 0.0 and 1.0.")
|
||||
|
||||
# Convert duty cycle from ratio to seconds
|
||||
duty_cycle = duty_cycle * self._period
|
||||
|
||||
# Convert duty cycle from seconds to integer nanoseconds
|
||||
duty_cycle_ns = int(duty_cycle * 1e9)
|
||||
|
||||
self._write_pin_attr(self._pin_duty_cycle_path, "{}".format(duty_cycle_ns))
|
||||
|
||||
duty_cycle = property(_get_duty_cycle, _set_duty_cycle)
|
||||
"""Get or set the PWM's output duty cycle as a ratio from 0.0 to 1.0.
|
||||
|
||||
Raises:
|
||||
PWMError: if an I/O or OS error occurs.
|
||||
TypeError: if value type is not int or float.
|
||||
ValueError: if value is out of bounds of 0.0 to 1.0.
|
||||
|
||||
:type: int, float
|
||||
"""
|
||||
|
||||
def _get_frequency(self):
|
||||
return 1.0 / self._get_period()
|
||||
|
||||
def _set_frequency(self, frequency):
|
||||
if not isinstance(frequency, (int, float)):
|
||||
raise TypeError("Invalid frequency type, should be int or float.")
|
||||
|
||||
self._set_period(1.0 / frequency)
|
||||
|
||||
frequency = property(_get_frequency, _set_frequency)
|
||||
"""Get or set the PWM's output frequency in Hertz.
|
||||
|
||||
Raises:
|
||||
PWMError: if an I/O or OS error occurs.
|
||||
TypeError: if value type is not int or float.
|
||||
|
||||
:type: int, float
|
||||
"""
|
||||
|
||||
def _get_enabled(self):
|
||||
enabled = self._read_pin_attr(self._pin_enable_path)
|
||||
|
||||
if enabled == "1":
|
||||
return True
|
||||
if enabled == "0":
|
||||
return False
|
||||
|
||||
raise PWMError(None, 'Unknown enabled value: "%s"' % enabled)
|
||||
|
||||
def _set_enabled(self, value):
|
||||
"""Get or set the PWM's output enabled state.
|
||||
|
||||
Raises:
|
||||
PWMError: if an I/O or OS error occurs.
|
||||
TypeError: if value type is not bool.
|
||||
|
||||
:type: bool
|
||||
"""
|
||||
if not isinstance(value, bool):
|
||||
raise TypeError("Invalid enabled type, should be string.")
|
||||
|
||||
self._write_pin_attr(self._pin_enable_path, "1" if value else "0")
|
||||
|
||||
# String representation
|
||||
|
||||
def __str__(self):
|
||||
return "PWM%d, pin %s (freq=%f Hz, duty_cycle=%f%%)" % (
|
||||
self._channel,
|
||||
self._pin,
|
||||
self.frequency,
|
||||
self.duty_cycle * 100,
|
||||
)
|
||||
|
|
@ -0,0 +1,139 @@
|
|||
"""
|
||||
G12A, G12B, and SM1 Common Definitions
|
||||
Ref:
|
||||
Linux kernel 4.9.y (hardkernel)
|
||||
linux/include/dt-bindings/gpio/meson-g12a-gpio.h
|
||||
Linux kernel 5.4.y (mainline)
|
||||
linux/include/dt-bindings/gpio/meson-g12a-gpio.h
|
||||
linux/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi
|
||||
"""
|
||||
|
||||
import re
|
||||
import gpiod
|
||||
from adafruit_blinka.microcontroller.generic_linux.libgpiod_pin import Pin
|
||||
|
||||
chip0 = gpiod.Chip("0")
|
||||
chip1 = gpiod.Chip("1")
|
||||
|
||||
if chip0.num_lines() < 20:
|
||||
aobus = 0
|
||||
periphs = 1
|
||||
periphs_offset = chip1.num_lines() - 85
|
||||
else:
|
||||
aobus = 1
|
||||
periphs = 0
|
||||
periphs_offset = chip0.num_lines() - 85
|
||||
|
||||
chip0.close()
|
||||
chip1.close()
|
||||
|
||||
GPIOAO_0 = GPIO496 = Pin((aobus, 0))
|
||||
GPIOAO_1 = GPIO497 = Pin((aobus, 1))
|
||||
GPIOAO_2 = GPIO498 = Pin((aobus, 2))
|
||||
GPIOAO_3 = GPIO499 = Pin((aobus, 3))
|
||||
GPIOAO_4 = GPIO500 = Pin((aobus, 4))
|
||||
GPIOAO_5 = GPIO501 = Pin((aobus, 5))
|
||||
GPIOAO_6 = GPIO502 = Pin((aobus, 6))
|
||||
GPIOAO_7 = GPIO503 = Pin((aobus, 7))
|
||||
GPIOAO_8 = GPIO504 = Pin((aobus, 8))
|
||||
GPIOAO_9 = GPIO505 = Pin((aobus, 9))
|
||||
GPIOAO_10 = GPIO506 = Pin((aobus, 10))
|
||||
GPIOAO_11 = GPIO507 = Pin((aobus, 11))
|
||||
GPIOE_0 = GPIO508 = Pin((aobus, 12))
|
||||
GPIOE_1 = GPIO509 = Pin((aobus, 13))
|
||||
GPIOE_2 = GPIO510 = Pin((aobus, 14))
|
||||
GPIO_TEST_N = GPIO511 = Pin((aobus, 15))
|
||||
|
||||
GPIOH_0 = GPIO427 = Pin((periphs, 16 + periphs_offset))
|
||||
GPIOH_1 = GPIO428 = Pin((periphs, 17 + periphs_offset))
|
||||
GPIOH_2 = GPIO429 = Pin((periphs, 18 + periphs_offset))
|
||||
GPIOH_3 = GPIO430 = Pin((periphs, 19 + periphs_offset))
|
||||
GPIOH_4 = GPIO431 = Pin((periphs, 20 + periphs_offset))
|
||||
GPIOH_5 = GPIO432 = Pin((periphs, 21 + periphs_offset))
|
||||
GPIOH_6 = GPIO433 = Pin((periphs, 22 + periphs_offset))
|
||||
GPIOH_7 = GPIO434 = Pin((periphs, 23 + periphs_offset))
|
||||
GPIOH_8 = GPIO435 = Pin((periphs, 24 + periphs_offset))
|
||||
|
||||
GPIOA_0 = GPIO460 = Pin((periphs, 49 + periphs_offset))
|
||||
GPIOA_1 = GPIO461 = Pin((periphs, 50 + periphs_offset))
|
||||
GPIOA_2 = GPIO462 = Pin((periphs, 51 + periphs_offset))
|
||||
GPIOA_3 = GPIO463 = Pin((periphs, 52 + periphs_offset))
|
||||
GPIOA_4 = GPIO464 = Pin((periphs, 53 + periphs_offset))
|
||||
GPIOA_5 = GPIO465 = Pin((periphs, 54 + periphs_offset))
|
||||
GPIOA_6 = GPIO466 = Pin((periphs, 55 + periphs_offset))
|
||||
GPIOA_7 = GPIO467 = Pin((periphs, 56 + periphs_offset))
|
||||
GPIOA_8 = GPIO468 = Pin((periphs, 57 + periphs_offset))
|
||||
GPIOA_9 = GPIO469 = Pin((periphs, 58 + periphs_offset))
|
||||
GPIOA_10 = GPIO470 = Pin((periphs, 59 + periphs_offset))
|
||||
GPIOA_11 = GPIO471 = Pin((periphs, 60 + periphs_offset))
|
||||
GPIOA_12 = GPIO472 = Pin((periphs, 61 + periphs_offset))
|
||||
GPIOA_13 = GPIO473 = Pin((periphs, 62 + periphs_offset))
|
||||
GPIOA_14 = GPIO474 = Pin((periphs, 63 + periphs_offset))
|
||||
GPIOA_15 = GPIO475 = Pin((periphs, 64 + periphs_offset))
|
||||
|
||||
GPIOX_0 = GPIO476 = Pin((periphs, 65 + periphs_offset))
|
||||
GPIOX_1 = GPIO477 = Pin((periphs, 66 + periphs_offset))
|
||||
GPIOX_2 = GPIO478 = Pin((periphs, 67 + periphs_offset))
|
||||
GPIOX_3 = GPIO479 = Pin((periphs, 68 + periphs_offset))
|
||||
GPIOX_4 = GPIO480 = Pin((periphs, 69 + periphs_offset))
|
||||
GPIOX_5 = GPIO481 = Pin((periphs, 70 + periphs_offset))
|
||||
GPIOX_6 = GPIO482 = Pin((periphs, 71 + periphs_offset))
|
||||
GPIOX_7 = GPIO483 = Pin((periphs, 72 + periphs_offset))
|
||||
GPIOX_8 = GPIO484 = Pin((periphs, 73 + periphs_offset))
|
||||
GPIOX_9 = GPIO485 = Pin((periphs, 74 + periphs_offset))
|
||||
GPIOX_10 = GPIO486 = Pin((periphs, 75 + periphs_offset))
|
||||
GPIOX_11 = GPIO487 = Pin((periphs, 76 + periphs_offset))
|
||||
GPIOX_12 = GPIO488 = Pin((periphs, 77 + periphs_offset))
|
||||
GPIOX_13 = GPIO489 = Pin((periphs, 78 + periphs_offset))
|
||||
GPIOX_14 = GPIO490 = Pin((periphs, 79 + periphs_offset))
|
||||
GPIOX_15 = GPIO491 = Pin((periphs, 80 + periphs_offset))
|
||||
GPIOX_16 = GPIO492 = Pin((periphs, 81 + periphs_offset))
|
||||
GPIOX_17 = GPIO493 = Pin((periphs, 82 + periphs_offset))
|
||||
GPIOX_18 = GPIO494 = Pin((periphs, 83 + periphs_offset))
|
||||
GPIOX_19 = GPIO495 = Pin((periphs, 84 + periphs_offset))
|
||||
|
||||
SPI0_SCLK = GPIOX_11
|
||||
SPI0_MISO = GPIOX_9
|
||||
SPI0_MOSI = GPIOX_8
|
||||
SPI0_CS0 = GPIOX_10
|
||||
|
||||
# ordered as spiId, sckId, mosiId, misoId
|
||||
spiPorts = ((0, SPI0_SCLK, SPI0_MOSI, SPI0_MISO),)
|
||||
|
||||
UART1_TX = GPIOX_12
|
||||
UART1_RX = GPIOX_13
|
||||
|
||||
# ordered as uartId, txId, rxId
|
||||
uartPorts = ((1, UART1_TX, UART1_RX),)
|
||||
|
||||
|
||||
def get_dts_alias(device: str) -> str:
|
||||
"""Get the Device Tree Alias"""
|
||||
uevent_path = "/sys/bus/platform/devices/" + device + "/uevent"
|
||||
with open(uevent_path, "r") as fd:
|
||||
pattern = r"^OF_ALIAS_0=(.*)$"
|
||||
uevent = fd.read().split("\n")
|
||||
for line in uevent:
|
||||
match = re.search(pattern, line)
|
||||
if match:
|
||||
return match.group(1).upper()
|
||||
|
||||
return None
|
||||
|
||||
|
||||
# ordered as i2cId, sclId, sdaId
|
||||
i2cPorts = []
|
||||
|
||||
alias = get_dts_alias("ffd1d000.i2c")
|
||||
if alias is not None:
|
||||
globals()[alias + "_SCL"] = GPIOX_18
|
||||
globals()[alias + "_SDA"] = GPIOX_17
|
||||
i2cPorts.append((int(alias[3]), GPIOX_18, GPIOX_17))
|
||||
|
||||
alias = get_dts_alias("ffd1c000.i2c")
|
||||
if alias is not None:
|
||||
globals()[alias + "_SCL"] = GPIOA_15
|
||||
globals()[alias + "_SDA"] = GPIOA_14
|
||||
i2cPorts.append((int(alias[3]), GPIOA_15, GPIOA_14))
|
||||
|
||||
i2cPorts = tuple(i2cPorts)
|
||||
90
src/adafruit_blinka/microcontroller/amlogic/s905/pin.py
Normal file
90
src/adafruit_blinka/microcontroller/amlogic/s905/pin.py
Normal file
|
|
@ -0,0 +1,90 @@
|
|||
"""AmLogic s905 pin names"""
|
||||
from adafruit_blinka.microcontroller.generic_linux.libgpiod_pin import Pin
|
||||
|
||||
GPIO122 = Pin((0, 0))
|
||||
GPIO123 = Pin((0, 1))
|
||||
GPIO124 = Pin((0, 2))
|
||||
GPIO125 = Pin((0, 3))
|
||||
GPIO126 = Pin((0, 4))
|
||||
GPIO127 = Pin((0, 5))
|
||||
GPIO128 = Pin((0, 6))
|
||||
GPIO129 = Pin((0, 7))
|
||||
GPIO130 = Pin((0, 8))
|
||||
GPIO131 = Pin((0, 9))
|
||||
GPIO132 = Pin((0, 10))
|
||||
GPIO133 = Pin((0, 11))
|
||||
GPIO134 = Pin((0, 12))
|
||||
GPIO135 = Pin((0, 13))
|
||||
|
||||
GPIO205 = Pin((1, 69))
|
||||
GPIO206 = Pin((1, 70))
|
||||
GPIO207 = Pin((1, 71))
|
||||
GPIO208 = Pin((1, 72))
|
||||
GPIO209 = Pin((1, 73))
|
||||
GPIO210 = Pin((1, 74))
|
||||
|
||||
GPIO211 = Pin((1, 75))
|
||||
GPIO212 = Pin((1, 76))
|
||||
GPIO213 = Pin((1, 77))
|
||||
GPIO214 = Pin((1, 78))
|
||||
GPIO215 = Pin((1, 79))
|
||||
GPIO216 = Pin((1, 80))
|
||||
GPIO217 = Pin((1, 81))
|
||||
GPIO218 = Pin((1, 82))
|
||||
GPIO219 = Pin((1, 83))
|
||||
GPIO220 = Pin((1, 84))
|
||||
GPIO221 = Pin((1, 85))
|
||||
GPIO222 = Pin((1, 86))
|
||||
GPIO223 = Pin((1, 87))
|
||||
GPIO224 = Pin((1, 88))
|
||||
GPIO225 = Pin((1, 89))
|
||||
GPIO226 = Pin((1, 90))
|
||||
GPIO227 = Pin((1, 91))
|
||||
|
||||
GPIO228 = Pin((1, 92))
|
||||
GPIO229 = Pin((1, 93))
|
||||
GPIO230 = Pin((1, 94))
|
||||
GPIO231 = Pin((1, 95))
|
||||
GPIO232 = Pin((1, 96))
|
||||
GPIO233 = Pin((1, 97))
|
||||
GPIO234 = Pin((1, 98))
|
||||
GPIO235 = Pin((1, 99))
|
||||
GPIO236 = Pin((1, 100))
|
||||
GPIO237 = Pin((1, 101))
|
||||
GPIO238 = Pin((1, 102))
|
||||
GPIO239 = Pin((1, 103))
|
||||
GPIO240 = Pin((1, 104))
|
||||
GPIO241 = Pin((1, 105))
|
||||
GPIO242 = Pin((1, 106))
|
||||
GPIO243 = Pin((1, 107))
|
||||
GPIO247 = Pin((1, 111))
|
||||
GPIO248 = Pin((1, 112))
|
||||
GPIO249 = Pin((1, 113))
|
||||
|
||||
I2C0_SDA = GPIO205
|
||||
I2C0_SCL = GPIO206
|
||||
I2C1_SDA = GPIO207
|
||||
I2C1_SCL = GPIO208
|
||||
I2C2_SDA = GPIO209
|
||||
I2C2_SCL = GPIO210
|
||||
|
||||
UART1_TX = GPIO240
|
||||
UART1_RX = GPIO241
|
||||
UART2_TX = GPIO205
|
||||
UART2_RX = GPIO206
|
||||
|
||||
SPI0_SCLK = GPIO230
|
||||
SPI0_MISO = GPIO232
|
||||
SPI0_MOSI = GPIO235
|
||||
|
||||
i2cPorts = (
|
||||
(0, I2C0_SCL, I2C0_SDA),
|
||||
(1, I2C1_SCL, I2C1_SDA),
|
||||
)
|
||||
# ordered as spiId, sckId, mosiId, misoId
|
||||
spiPorts = ((0, SPI0_SCLK, SPI0_MOSI, SPI0_MISO),)
|
||||
# ordered as uartId, txId, rxId
|
||||
uartPorts = (
|
||||
(1, UART1_TX, UART1_RX),
|
||||
(2, UART2_TX, UART2_RX),
|
||||
)
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
"""AmLogic s905x3 pin names"""
|
||||
# pylint: disable=wildcard-import,unused-wildcard-import
|
||||
from adafruit_blinka.microcontroller.amlogic.meson_g12_common.pin import *
|
||||
3
src/adafruit_blinka/microcontroller/amlogic/s922x/pin.py
Normal file
3
src/adafruit_blinka/microcontroller/amlogic/s922x/pin.py
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
"""AmLogic s922x pin names"""
|
||||
# pylint: disable=wildcard-import,unused-wildcard-import
|
||||
from adafruit_blinka.microcontroller.amlogic.meson_g12_common.pin import *
|
||||
0
src/adafruit_blinka/microcontroller/atheros/__init__.py
Normal file
0
src/adafruit_blinka/microcontroller/atheros/__init__.py
Normal file
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue