Compare commits
554 Commits
v0.3.0
...
d967be0245
| Author | SHA1 | Date | |
|---|---|---|---|
| d967be0245 | |||
| b040f336d4 | |||
| 1bf1ea7596 | |||
|
|
29303f7ec9 | ||
|
|
c6b06d4be6 | ||
|
|
c9b2f9dd23 | ||
|
|
40590d174f | ||
|
|
780fb72bba | ||
|
|
e9977a26e4 | ||
|
|
1d97f0ce84 | ||
|
|
895b6e89c5 | ||
|
|
9114bc4c49 | ||
|
|
9eae0cd253 | ||
|
|
37f096d3b5 | ||
|
|
6bf549b104 | ||
|
|
3054db9d9b | ||
|
|
69e7e2debe | ||
|
|
6083cca72e | ||
|
|
d17ea4da0f | ||
|
|
2ea0066536 | ||
|
|
3d23211c1e | ||
|
|
1769680d9e | ||
|
|
92351c0b92 | ||
|
|
0f6c31386b | ||
|
|
a9009a8cee | ||
|
|
31e1d51dbd | ||
|
|
41819f2fd6 | ||
|
|
17043f634f | ||
|
|
e1c5761df9 | ||
|
|
fbaae21011 | ||
|
|
fa2064b957 | ||
|
|
21a194f43d | ||
|
|
b255402659 | ||
|
|
dfabfbb921 | ||
|
|
3b36a70c9a | ||
|
|
d1386a8e9d | ||
|
|
67b92b7f56 | ||
|
|
a1f8516e60 | ||
|
|
cf52021d38 | ||
|
|
b78c9387a6 | ||
|
|
b748d99437 | ||
|
|
9a33fc0a69 | ||
|
|
4cddc01f22 | ||
|
|
1d80b5fff7 | ||
|
|
140cf07173 | ||
|
|
1e3a82f439 | ||
|
|
c90794e9f5 | ||
|
|
03c723c73d | ||
|
|
bad2ffdd07 | ||
|
|
eed39c9cfb | ||
|
|
7bd6d1d815 | ||
|
|
bb7fcd5c4d | ||
|
|
9b8e00c7fa | ||
|
|
b97825d552 | ||
|
|
085b5aed16 | ||
|
|
7f43624824 | ||
|
|
1ed0000819 | ||
|
|
3b79636d00 | ||
|
|
5a4b932a37 | ||
|
|
dd2ae149ad | ||
|
|
0f5d0a8889 | ||
|
|
3750ae6953 | ||
|
|
5be993f9eb | ||
|
|
57c43ce515 | ||
|
|
159ffa76fd | ||
|
|
1ac3d30d84 | ||
|
|
631ef6ba59 | ||
|
|
27393e47c3 | ||
|
|
bd47772c04 | ||
|
|
f3871388ce | ||
|
|
62874bebf4 | ||
|
|
2ca368305c | ||
|
|
f697ae6f11 | ||
|
|
ef6dd35977 | ||
|
|
ccf21b4eab | ||
|
|
e99c6124e7 | ||
|
|
5721bd74d7 | ||
|
|
ff443ca488 | ||
|
|
93e0a5d066 | ||
|
|
150c2ef26d | ||
|
|
4d81fcac26 | ||
|
|
a3bbdf1c16 | ||
|
|
39df2e7b54 | ||
|
|
6169f68119 | ||
|
|
e38e53bac0 | ||
|
|
b38a4d5d46 | ||
|
|
96412624d9 | ||
|
|
f8876bba87 | ||
|
|
68b5773827 | ||
|
|
74659901c0 | ||
|
|
73ede2838c | ||
|
|
273a86532b | ||
|
|
05e13dafed | ||
|
|
6af97d2691 | ||
|
|
f9fb78feed | ||
|
|
96dbbe0919 | ||
|
|
0ef66af342 | ||
|
|
7ed48bf9fc | ||
|
|
1335b84391 | ||
|
|
e2794d5f84 | ||
|
|
e7f35c584b | ||
|
|
1e49c3ff6f | ||
|
|
e256ac8e46 | ||
|
|
9c6e9d1525 | ||
|
|
41985e5743 | ||
|
|
f1e41f7cc1 | ||
|
|
6135e4f7b0 | ||
|
|
af8c7417b3 | ||
|
|
babdb1287f | ||
|
|
4532c88873 | ||
|
|
bc1b83d931 | ||
|
|
87ad0798e4 | ||
|
|
a80032d46c | ||
|
|
4dae304f51 | ||
|
|
9b7d34fa65 | ||
|
|
c0cc602c9a | ||
|
|
e5f98ff41f | ||
|
|
bc74c21599 | ||
|
|
3836ad20b7 | ||
|
|
b073290989 | ||
|
|
43c9d0db10 | ||
|
|
c40bdd68af | ||
|
|
620e457eb6 | ||
|
|
5c4da6e82b | ||
|
|
8c636e44f7 | ||
|
|
07e9aa1ded | ||
|
|
27a7faaab7 | ||
|
|
752768b1e2 | ||
|
|
f7c28eeea4 | ||
|
|
113b2fc31d | ||
|
|
86924d8785 | ||
|
|
219415174e | ||
|
|
8999cb9091 | ||
|
|
8337ac121e | ||
|
|
d332315e7a | ||
|
|
882f58bae4 | ||
|
|
2c86a36fe0 | ||
|
|
b984519546 | ||
|
|
7b0f6b22c1 | ||
|
|
3b8a4f1b60 | ||
|
|
edd2c0542b | ||
|
|
dbc905dca3 | ||
|
|
461e4c6df0 | ||
|
|
85a687fc56 | ||
|
|
c5361a4738 | ||
|
|
42c18859f3 | ||
|
|
1ba6834391 | ||
|
|
376a4db4cb | ||
|
|
775e06b259 | ||
|
|
3ba3c2a2be | ||
|
|
76ad89e2f1 | ||
|
|
2a7f1b52a0 | ||
|
|
bd75b54dce | ||
|
|
070f2afd66 | ||
|
|
0e84e08a18 | ||
|
|
4c1ab20ba4 | ||
|
|
63ac7b365d | ||
|
|
c51bf0b7db | ||
|
|
201db4668e | ||
|
|
250e67ab1f | ||
|
|
2e30d34021 | ||
|
|
2882eaa0c2 | ||
|
|
8faffedddc | ||
|
|
5260930919 | ||
|
|
24832d3277 | ||
|
|
8f338a6b30 | ||
|
|
3d3f3700a8 | ||
|
|
eae64d34e2 | ||
|
|
a27e76bfa7 | ||
|
|
b050662a5c | ||
|
|
f69b4bea4f | ||
|
|
4e3b081c60 | ||
|
|
a2de77ce30 | ||
|
|
5de98ed56c | ||
|
|
ff8ac6036c | ||
|
|
c3f12ab247 | ||
|
|
dfcb36361e | ||
|
|
c4a3e9e2ee | ||
|
|
fd1afea1bc | ||
|
|
65cf460691 | ||
|
|
046f7df7d1 | ||
|
|
8323bafd4c | ||
|
|
6b92aac1da | ||
|
|
3113b387c3 | ||
|
|
6d2b653f61 | ||
|
|
47daefe675 | ||
|
|
e8c18f4e66 | ||
|
|
76a82768fe | ||
|
|
8be5aeab59 | ||
|
|
fbfd96ecdb | ||
|
|
dee20c859c | ||
|
|
ce0a88147b | ||
|
|
7f62f1e965 | ||
|
|
b51501fb21 | ||
|
|
72ab64461c | ||
|
|
26b393e059 | ||
|
|
bc328657aa | ||
|
|
c579219427 | ||
|
|
3413d70210 | ||
|
|
8bbc7e13fb | ||
|
|
f1ecb312c7 | ||
|
|
3407891e9c | ||
|
|
8f447a4a72 | ||
|
|
8ace11e462 | ||
|
|
949dfe7266 | ||
|
|
f0d490aef9 | ||
|
|
bdedae981a | ||
|
|
9e0750c9d3 | ||
|
|
9a3e512b1b | ||
|
|
861e741030 | ||
|
|
a3e7e21d45 | ||
|
|
86db2fcf61 | ||
|
|
fcd72e013a | ||
|
|
2450f8c64b | ||
|
|
676a9b1686 | ||
|
|
b10db63c74 | ||
|
|
4b25ef7516 | ||
|
|
de0d19cda6 | ||
|
|
c55386af0e | ||
|
|
33fe1c7a54 | ||
|
|
bf6d05e92a | ||
|
|
b6113d8d2b | ||
|
|
bc31154035 | ||
|
|
edfe0329bf | ||
|
|
1e11dd776a | ||
|
|
028526d22d | ||
|
|
7ac2d854f2 | ||
|
|
279c81e431 | ||
|
|
4e319b40ed | ||
|
|
d082b39980 | ||
|
|
277402f577 | ||
|
|
9e95c507b1 | ||
|
|
7440fc6f46 | ||
|
|
a24028f674 | ||
|
|
00913b013f | ||
|
|
447d08d613 | ||
|
|
d4f7736b2d | ||
|
|
60f72fffdf | ||
|
|
77af9c1cba | ||
|
|
1b2414337f | ||
|
|
d41f1f2a4d | ||
|
|
f9967ff990 | ||
|
|
db0ab41ea4 | ||
|
|
da95cc30d3 | ||
|
|
6b3001573e | ||
|
|
b85f6f8c3f | ||
|
|
d036ac9fba | ||
|
|
f63a114371 | ||
|
|
8cb59661ac | ||
|
|
fc1da609f2 | ||
|
|
c6566323fd | ||
|
|
30e1533ad9 | ||
|
|
71dfea1904 | ||
|
|
4fa7457423 | ||
|
|
9583bb35f5 | ||
|
|
e806c4db3a | ||
|
|
665ab22de5 | ||
|
|
ec4e946643 | ||
|
|
9e4bbe3e36 | ||
|
|
1172c1a852 | ||
|
|
8a4392bb22 | ||
|
|
a79a2d60d3 | ||
|
|
9553ff66a3 | ||
|
|
79c6f05291 | ||
|
|
3e691de24a | ||
|
|
303def49cb | ||
|
|
18653781d5 | ||
|
|
2a75bdbeda | ||
|
|
4a6926eb6c | ||
|
|
3dc4007fa7 | ||
|
|
9c3833d66c | ||
|
|
41966f33c2 | ||
|
|
50fea2a8f0 | ||
|
|
05cb7f7947 | ||
|
|
5b6b80e3cd | ||
|
|
2c59af8399 | ||
|
|
b404f9fa42 | ||
|
|
8dc8340ce4 | ||
|
|
30f08a145e | ||
|
|
d3d140fa60 | ||
|
|
5f8e687e68 | ||
|
|
fab640901d | ||
|
|
9a053fb6ff | ||
|
|
24e4b0b376 | ||
|
|
b8eee999e2 | ||
|
|
7fe9a114b7 | ||
|
|
05b2fb4fcb | ||
|
|
830d8762cd | ||
|
|
3f81666369 | ||
|
|
d40f4003b5 | ||
|
|
1585e425ce | ||
|
|
bbc7613079 | ||
|
|
ec54745174 | ||
|
|
a29453de12 | ||
|
|
db5bf4fc46 | ||
|
|
9495e3418c | ||
|
|
83573a743b | ||
|
|
f5dcd82747 | ||
|
|
070ec2f48f | ||
|
|
96c7fdc02c | ||
|
|
dfde2d8a62 | ||
|
|
a3f57114da | ||
|
|
904af10914 | ||
|
|
9b5013a694 | ||
|
|
922adfd3d4 | ||
|
|
362144033b | ||
|
|
caf9a579d3 | ||
|
|
cb40fdcdbe | ||
|
|
ef15e754c9 | ||
|
|
d55568c146 | ||
|
|
e134863db1 | ||
|
|
c37ae51dd3 | ||
|
|
4fc2ff43c1 | ||
|
|
607f13d935 | ||
|
|
44c1a3f695 | ||
|
|
d30decfbc8 | ||
|
|
705b2f794e | ||
|
|
4958690d9e | ||
|
|
d7749d3a24 | ||
|
|
73e07a594f | ||
|
|
755c2ef400 | ||
|
|
3f588e970a | ||
|
|
3264807e77 | ||
|
|
01225d4648 | ||
|
|
48aa809c98 | ||
|
|
4a722d4069 | ||
|
|
07aca2a0e7 | ||
|
|
10000d9b6c | ||
|
|
f0e247f31e | ||
|
|
593dec5e88 | ||
|
|
c45b86c993 | ||
|
|
02f01f2199 | ||
|
|
88b1adc2d6 | ||
|
|
a0a0e6775b | ||
|
|
4096253694 | ||
|
|
33ba44ebda | ||
|
|
9b4cf2a92b | ||
|
|
e6b915d8e3 | ||
|
|
bb73fb5f55 | ||
|
|
10c5945afb | ||
|
|
0bd613d556 | ||
|
|
aae2f65b9e | ||
|
|
d02197474e | ||
|
|
41b37e9c24 | ||
|
|
b03400fac2 | ||
|
|
3e808f7b6b | ||
|
|
1e3a8971fb | ||
|
|
d8c0105b97 | ||
|
|
b3689cbac8 | ||
|
|
1b5d6472f7 | ||
|
|
e9511c507a | ||
|
|
365f64ded5 | ||
|
|
3601fa63d8 | ||
|
|
5d00ddf516 | ||
|
|
0051453cad | ||
|
|
7920ea2dda | ||
|
|
9416e45a75 | ||
|
|
98a65c81af | ||
|
|
8e1f06e79b | ||
|
|
58a09f453d | ||
|
|
7dc69982b6 | ||
|
|
46e4041ed8 | ||
|
|
0e129130b1 | ||
|
|
33c9868f90 | ||
|
|
fb04b1830e | ||
|
|
9509194bd0 | ||
|
|
60322a243a | ||
|
|
4ed7067537 | ||
|
|
69086e8fba | ||
|
|
a4b63bb037 | ||
|
|
5ffb2f6619 | ||
|
|
41eaf9b9e4 | ||
|
|
28bb777399 | ||
|
|
f375a35cc8 | ||
|
|
1d41d84083 | ||
|
|
357be177fc | ||
|
|
23c3335de8 | ||
|
|
963b164783 | ||
|
|
0c22a02641 | ||
|
|
10cb5c2c76 | ||
|
|
6d36c9ef7b | ||
|
|
aed97a5e92 | ||
|
|
b6008fc9bb | ||
|
|
f9359679ad | ||
|
|
052d7be1a9 | ||
|
|
ead577a116 | ||
|
|
ccf7d972ce | ||
|
|
b2df9e6a8b | ||
|
|
e37014ebd6 | ||
|
|
c96ef2ff7a | ||
|
|
c19dd0d87e | ||
|
|
02f972bd5f | ||
|
|
15facd8866 | ||
|
|
cf584c3bd6 | ||
|
|
4744351964 | ||
|
|
31b753ab5a | ||
|
|
3cb944dde2 | ||
|
|
1b4265f522 | ||
|
|
5d16338faa | ||
|
|
673b8233e5 | ||
|
|
0dd2e2583b | ||
|
|
c19f24cbfd | ||
|
|
cfb6830d95 | ||
|
|
27dea356cf | ||
|
|
352a425c4f | ||
|
|
4beaa79d02 | ||
|
|
e54eab83f2 | ||
|
|
e74a491b4a | ||
|
|
a9415c1db7 | ||
|
|
a83959ab5f | ||
|
|
b1896002e5 | ||
|
|
cc39de9b04 | ||
|
|
a286b5d067 | ||
|
|
f071f57abf | ||
|
|
0e0fe334cd | ||
|
|
23410c618d | ||
|
|
b44898f08d | ||
|
|
165f356439 | ||
|
|
1d0df2936b | ||
|
|
1684d63e04 | ||
|
|
cf5dfb43d6 | ||
|
|
ded6638ef6 | ||
|
|
a8228851d9 | ||
|
|
633289def6 | ||
|
|
f4ff13d6b7 | ||
|
|
0493ec2245 | ||
|
|
4c6bbb8aae | ||
|
|
b625f636be | ||
|
|
3bfd62d075 | ||
|
|
b405adb359 | ||
|
|
accf37de39 | ||
|
|
582eed3be8 | ||
|
|
35d5ec03a3 | ||
|
|
737c627d44 | ||
|
|
84a3120c7f | ||
|
|
99b9ed1181 | ||
|
|
0d636a3285 | ||
|
|
79ccd47f71 | ||
|
|
3ffc70abe5 | ||
|
|
f4f2eda481 | ||
|
|
f4b2c74b0e | ||
|
|
111e5a66b6 | ||
|
|
b90723130d | ||
|
|
e6179761d4 | ||
|
|
b371fd3468 | ||
|
|
c8fccdbb47 | ||
|
|
4876401809 | ||
|
|
45af7c188a | ||
|
|
236e9ccda6 | ||
|
|
94e8b9f87e | ||
|
|
c9580d6627 | ||
|
|
87929373e2 | ||
|
|
4e2aec9ced | ||
|
|
fa7957f5e2 | ||
|
|
4f15805246 | ||
|
|
cf67c815e9 | ||
|
|
5533dc807f | ||
|
|
ac2aabe6e3 | ||
|
|
c6a428ddd4 | ||
|
|
a83a845d5a | ||
|
|
c91b188f96 | ||
|
|
53a6f4593e | ||
|
|
0dda769d0f | ||
|
|
848df066c4 | ||
|
|
b4005d8bad | ||
|
|
34c0df2761 | ||
|
|
cedfc2c8db | ||
|
|
c9fe63ec7b | ||
|
|
2fedcb61b5 | ||
|
|
272b033253 | ||
|
|
cae03d54d6 | ||
|
|
e70f1a591f | ||
|
|
0e768ac6e4 | ||
|
|
bc056eaca2 | ||
|
|
a6ad84a3b8 | ||
|
|
a5b953dc80 | ||
|
|
d446b05387 | ||
|
|
e864e5ef24 | ||
|
|
e669507759 | ||
|
|
e50c04cbe1 | ||
|
|
56dd57f4a0 | ||
|
|
f2abb564c7 | ||
|
|
4e7abb2350 | ||
|
|
540e499389 | ||
|
|
191a2bdd2a | ||
|
|
4d1c8357b4 | ||
|
|
85b5b1df91 | ||
|
|
c3e2c105d4 | ||
|
|
dba602a081 | ||
|
|
c3f2ce57f0 | ||
|
|
bbf8e0b6b6 | ||
|
|
03ab020dc8 | ||
|
|
9c1f3225a6 | ||
|
|
f72dd3b7d7 | ||
|
|
48f6210607 | ||
|
|
6f9be2b139 | ||
|
|
3217525873 | ||
|
|
e26972bd2f | ||
|
|
bf31533306 | ||
|
|
0ca0577667 | ||
|
|
0e797e7e04 | ||
|
|
a661ef3a3f | ||
|
|
17dc1dcf8c | ||
|
|
4c27aa57b1 | ||
|
|
a21c07fa03 | ||
|
|
bdffa7ef53 | ||
|
|
22d40825bb | ||
|
|
50f26f546c | ||
|
|
9c7ea46ec3 | ||
|
|
5b4cf53d8a | ||
|
|
79a701a4d4 | ||
|
|
81897e634c | ||
|
|
3e11da4dd4 | ||
|
|
12aa7fef04 | ||
|
|
1ea6420bbc | ||
|
|
f3f1f36525 | ||
|
|
dee9a98cc3 | ||
|
|
3345ce3fb9 | ||
|
|
de70583838 | ||
|
|
a43a737004 | ||
|
|
1f6899354f | ||
|
|
9110a0c47e | ||
|
|
b549790798 | ||
|
|
5df430f3be | ||
|
|
f3e8bcd74a | ||
|
|
4b050e11cf | ||
|
|
7ddbc09564 | ||
|
|
d3d62f80fd | ||
|
|
bc7dbe6eec | ||
|
|
e625f55353 | ||
|
|
aeebff9d5d | ||
|
|
9a3c077ef1 | ||
|
|
91ae692058 | ||
|
|
ad590d1eb2 | ||
|
|
8b00358901 | ||
|
|
bf4d8bb9be | ||
|
|
157dd2f407 | ||
|
|
1dc47878d4 | ||
|
|
36e4b6fd45 | ||
|
|
36d9a6e7e4 | ||
|
|
b7cceed4d3 | ||
|
|
694c06e7f5 | ||
|
|
12338747bf | ||
|
|
f4f9788f68 | ||
|
|
b9cdcad262 | ||
|
|
e4cd2ddec8 | ||
|
|
1477649a50 | ||
|
|
2e80469ab3 | ||
|
|
ccf63a4cdb | ||
|
|
b464871f73 | ||
|
|
e44834a95e | ||
|
|
4efefc5c6c | ||
|
|
dfd852b2db | ||
|
|
afa7141ceb |
@@ -1,11 +1,14 @@
|
||||
# 2025-02-12
|
||||
Language: Cpp
|
||||
BasedOnStyle: LLVM
|
||||
AlignAfterOpenBracket: BlockIndent
|
||||
AlignArrayOfStructures: Left
|
||||
AlignConsecutiveAssignments: true
|
||||
AlignConsecutiveMacros: AcrossComments
|
||||
AlignEscapedNewlinesLeft: true
|
||||
AlignTrailingComments: true
|
||||
AllowAllArgumentsOnNextLine: false
|
||||
AllowAllParametersOfDeclarationOnNextLine: false
|
||||
AllowShortBlocksOnASingleLine: Empty
|
||||
AllowShortFunctionsOnASingleLine: Empty
|
||||
AlwaysBreakTemplateDeclarations: Yes
|
||||
@@ -21,7 +24,7 @@ IndentCaseLabels: true
|
||||
IndentWidth: 4
|
||||
LambdaBodyIndentation: Signature
|
||||
MaxEmptyLinesToKeep: 1
|
||||
# PointerAlignment: Left # TODO enable this and reformat project
|
||||
PenaltyReturnTypeOnItsOwnLine: 1000
|
||||
QualifierAlignment: Left
|
||||
ReflowComments: true
|
||||
SeparateDefinitionBlocks: Always
|
||||
|
||||
3
.github/FUNDING.yml
vendored
Normal file
3
.github/FUNDING.yml
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
ko_fi: kuba2k2
|
||||
custom:
|
||||
- "https://paypal.me/kuba2k2"
|
||||
21
.github/workflows/docs.yml
vendored
21
.github/workflows/docs.yml
vendored
@@ -1,21 +0,0 @@
|
||||
name: Deploy docs on GitHub Pages
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Deploy docs
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout main
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Deploy docs
|
||||
uses: mhausenblas/mkdocs-deploy-gh-pages@master
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
CONFIG_FILE: mkdocs.yml
|
||||
EXTRA_PACKAGES: build-base
|
||||
REQUIREMENTS: docs/requirements.txt
|
||||
35
.github/workflows/lint.yml
vendored
35
.github/workflows/lint.yml
vendored
@@ -1,35 +0,0 @@
|
||||
name: Lint check
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
lint-clang-format:
|
||||
name: Lint with clang-format
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Check code with clang-format
|
||||
uses: jidicula/clang-format-action@v4.5.0
|
||||
with:
|
||||
clang-format-version: "14"
|
||||
lint-black:
|
||||
name: Lint with black
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: "3.9"
|
||||
- name: Install test dependencies
|
||||
uses: BSFishy/pip-action@v1
|
||||
with:
|
||||
packages: |
|
||||
black
|
||||
isort
|
||||
- name: Check code with black
|
||||
run: black --check .
|
||||
- name: Check code with isort
|
||||
run: isort --profile black . --check-only
|
||||
46
.github/workflows/platformio-publish.yml
vendored
46
.github/workflows/platformio-publish.yml
vendored
@@ -1,46 +0,0 @@
|
||||
name: PlatformIO Publish
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- v*.*.*
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.cache/pip
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
- name: Cache PlatformIO
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.platformio
|
||||
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v2
|
||||
- name: Install PlatformIO
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install --upgrade platformio
|
||||
- name: Publish PlatformIO package
|
||||
run: pio package publish --non-interactive
|
||||
env:
|
||||
CI: true
|
||||
PLATFORMIO_AUTH_TOKEN: ${{ secrets.PLATFORMIO_AUTH_TOKEN }}
|
||||
- name: Get latest version
|
||||
id: get_version
|
||||
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
|
||||
- name: Release on GitHub
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
name: ${{ steps.get_version.outputs.VERSION }}
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
13
.github/workflows/push-dev.yml
vendored
Normal file
13
.github/workflows/push-dev.yml
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
name: Push (dev), Pull Request
|
||||
on:
|
||||
push:
|
||||
branches: ["**"]
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
jobs:
|
||||
lint-clang:
|
||||
name: Run Clang lint
|
||||
uses: kuba2k2/kuba2k2/.github/workflows/lint-clang.yml@master
|
||||
lint-python:
|
||||
name: Run Python lint
|
||||
uses: kuba2k2/kuba2k2/.github/workflows/lint-python.yml@master
|
||||
44
.github/workflows/push-master.yml
vendored
Normal file
44
.github/workflows/push-master.yml
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
name: Push (master)
|
||||
on:
|
||||
push:
|
||||
branches: ["master"]
|
||||
workflow_dispatch:
|
||||
jobs:
|
||||
docs:
|
||||
name: Deploy docs
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout main
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.10'
|
||||
|
||||
- name: Install docs dependencies
|
||||
run: pip install -U ltchiptool "boardgen>=0.11.0"
|
||||
|
||||
- name: Generate docs and static JSON files
|
||||
run: |
|
||||
mkdir -p site/
|
||||
boardgen ltci
|
||||
python docs/scripts/write_boards.py
|
||||
python docs/scripts/write_apis.py
|
||||
python docs/scripts/prepare_doxygen.py
|
||||
python docs/scripts/build_json.py
|
||||
cp *.json site/
|
||||
|
||||
- name: Set custom domain
|
||||
run: |
|
||||
mkdir -p site/
|
||||
echo docs.libretiny.eu > site/CNAME
|
||||
|
||||
- name: Deploy docs
|
||||
uses: libretiny-eu/mkdocs-deploy-gh-pages@master
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
CONFIG_FILE: mkdocs.yml
|
||||
EXTRA_PACKAGES: build-base doxygen
|
||||
REQUIREMENTS: docs/requirements.txt
|
||||
CUSTOM_DOMAIN: docs.libretiny.eu
|
||||
22
.github/workflows/release.yml
vendored
Normal file
22
.github/workflows/release.yml
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
name: Release
|
||||
on:
|
||||
push:
|
||||
tags: ["v*.*.*"]
|
||||
jobs:
|
||||
lint-clang:
|
||||
name: Run Clang lint
|
||||
uses: kuba2k2/kuba2k2/.github/workflows/lint-clang.yml@master
|
||||
publish-pio-platform:
|
||||
name: Publish PlatformIO platform
|
||||
needs:
|
||||
- lint-clang
|
||||
uses: kuba2k2/kuba2k2/.github/workflows/publish-pio-platform.yml@master
|
||||
secrets:
|
||||
PLATFORMIO_AUTH_TOKEN: ${{ secrets.PLATFORMIO_AUTH_TOKEN }}
|
||||
gh-release:
|
||||
name: Publish GitHub release
|
||||
needs:
|
||||
- publish-pio-platform
|
||||
uses: kuba2k2/kuba2k2/.github/workflows/gh-release.yml@master
|
||||
permissions:
|
||||
contents: write
|
||||
14
.gitignore
vendored
14
.gitignore
vendored
@@ -252,3 +252,17 @@ cython_debug/
|
||||
# End of https://www.toptal.com/developers/gitignore/api/c,c++,visualstudiocode,python
|
||||
|
||||
.vscode/settings.json
|
||||
|
||||
# mkdocs
|
||||
xml/
|
||||
ltapi/
|
||||
hashChanges.yaml
|
||||
.piopm
|
||||
|
||||
# board files
|
||||
docs/status/supported_*.md
|
||||
docs/status/unsupported_boards_*.md
|
||||
boards/**/*.svg
|
||||
boards/**/*.md
|
||||
# other generated files
|
||||
docs/contrib/lt-api-functions.md
|
||||
|
||||
209
README.md
209
README.md
@@ -1,216 +1,39 @@
|
||||
# LibreTuya
|
||||
# LibreTiny
|
||||
|
||||
<small>(formerly LibreTuya)</small>
|
||||
|
||||
<div align="center" markdown>
|
||||
|
||||
[](https://kuba2k2.github.io/libretuya/)
|
||||

|
||||
[](https://docs.libretiny.eu/)
|
||||

|
||||
|
||||
[](https://github.com/psf/black)
|
||||
[](.clang-format)
|
||||
[](https://github.com/psf/black)
|
||||
|
||||
[](https://discord.gg/SyGCB9Xwtf)
|
||||
[](https://registry.platformio.org/platforms/kuba2k2/libretiny)
|
||||
|
||||

|
||||

|
||||

|
||||
|
||||
<!-- [](https://registry.platformio.org/platforms/kuba2k2/libretuya) -->
|
||||
</div>
|
||||
|
||||
PlatformIO development platform for IoT modules manufactured by Tuya Inc.
|
||||
PlatformIO development platform for BK7231, RTL8710 and LN882H IoT chips.
|
||||
|
||||
The main goal of this project is to provide a usable build environment for IoT developers. While also providing vendor SDKs as PlatformIO cores,
|
||||
the project focuses on developing working Arduino-compatible cores for supported platforms. The cores are inspired by Espressif's official core for ESP32,
|
||||
which should make it easier to port/run existing ESP apps on Tuya IoT (and 3-rd party) platforms.
|
||||
the project focuses on developing working Arduino-compatible cores for supported families. The cores are inspired by Espressif's official core for ESP32,
|
||||
which should make it easier to port/run existing ESP apps on less-common, unsupported IoT modules.
|
||||
|
||||
LibreTuya also provides a common interface for all platform implementations. The interface is based on ESP32 official libraries.
|
||||
**There's an [ESPHome port](https://docs.libretiny.eu/docs/projects/esphome/) based on LibreTiny, which supports BK7231 and RTL8710B chips.**
|
||||
|
||||
**Note:** this project is work-in-progress.
|
||||
|
||||
## Usage
|
||||
<div align="center" markdown>
|
||||
|
||||
1. [Install PlatformIO](https://platformio.org/platformio-ide)
|
||||
2. `platformio platform install https://github.com/kuba2k2/libretuya`
|
||||
3. Create a project, build it and upload!
|
||||
4. See the [docs](https://kuba2k2.github.io/libretuya/) for any questions/problems.
|
||||
## [⭐ Getting started ⭐](https://docs.libretiny.eu/docs/getting-started/)
|
||||
|
||||
## Board List
|
||||
|
||||
A (mostly) complete* list of Tuya wireless module boards.
|
||||
|
||||
| Module Name | MCU | Flash | RAM | Pins** | Wi-Fi | BLE | Platform name
|
||||
------------------------------|------------------------------------------------------------------------------------------------|-------------------------|-------|----------|-------------|-------|-----|---------------
|
||||
❌ | [WB1S](https://developer.tuya.com/en/docs/iot/wb1s?id=K9duevbj3ol4x) | BK7231T @ 120 MHz | 2 MiB | 256 KiB | 18 (11 I/O) | ✔️ | ✔️ | -
|
||||
❌ | [WB2L](https://developer.tuya.com/en/docs/iot/wb2l-datasheet?id=K9duegc9bualu) | BK7231T @ 120 MHz | 2 MiB | 256 KiB | 7 (5 I/O) | ✔️ | ✔️ | -
|
||||
❌ | [WB2S](https://developer.tuya.com/en/docs/iot/wb2s-module-datasheet?id=K9ghecl7kc479) | BK7231T @ 120 MHz | 2 MiB | 256 KiB | 11 (8 I/O) | ✔️ | ✔️ | -
|
||||
❌ | [WB3L](https://developer.tuya.com/en/docs/iot/wb3l-module-datasheet?id=K9duiggw2v8sp) | BK7231T @ 120 MHz | 2 MiB | 256 KiB | 16 (12 I/O) | ✔️ | ✔️ | -
|
||||
❌ | [WB3S](https://developer.tuya.com/en/docs/iot/wb3s-module-datasheet?id=K9dx20n6hz5n4) | BK7231T @ 120 MHz | 2 MiB | 256 KiB | 16 (11 I/O) | ✔️ | ✔️ | -
|
||||
❌ | [WB3S-IPEX](https://developer.tuya.com/en/docs/iot/wb3sipex-module-datasheet?id=K9irq0laun21z) | BK7231T @ 120 MHz | 2 MiB | 256 KiB | 16 (11 I/O) | ✔️ | ✔️ | -
|
||||
❌ | [WB8P](https://developer.tuya.com/en/docs/iot/wb8p-module-datasheet?id=K9fwx4f89tvzd) | BK7231T @ 120 MHz | 2 MiB | 256 KiB | 10 (8 I/O) | ✔️ | ✔️ | -
|
||||
❌ | [WBLC5](https://developer.tuya.com/en/docs/iot/wblc5-module-datasheet?id=K9duilns1f3gi) | BK7231T @ 120 MHz | 2 MiB | 256 KiB | 6 (3 I/O) | ✔️ | ✔️ | -
|
||||
❌ | [WBLC9](https://developer.tuya.com/en/docs/iot/wblc9-module-datasheet?id=K9hgglry2jp5h) | BK7231T @ 120 MHz | 2 MiB | 256 KiB | 8 (6 I/O) | ✔️ | ✔️ | -
|
||||
❌ | [CB1S](https://developer.tuya.com/en/docs/iot/cb1s-module-datasheet?id=Kaij1abmwyjq2) | BK7231N @ 120 MHz | 2 MiB | 256 KiB | 18 (11 I/O) | ✔️ | ✔️ | -
|
||||
❌ | [CB2L](https://developer.tuya.com/en/docs/iot/cb2l-module-datasheet?id=Kai2eku1m3pyl) | BK7231N @ 120 MHz | 2 MiB | 256 KiB | 7 (5 I/O) | ✔️ | ✔️ | -
|
||||
❌ | [CB2S](https://developer.tuya.com/en/docs/iot/cb2s-module-datasheet?id=Kafgfsa2aaypq) | BK7231N @ 120 MHz | 2 MiB | 256 KiB | 11 (8 I/O) | ✔️ | ✔️ | -
|
||||
❌ | [CB3L](https://developer.tuya.com/en/docs/iot/cb3l-module-datasheet?id=Kai51ngmrh3qm) | BK7231N @ 120 MHz | 2 MiB | 256 KiB | 16 (11 I/O) | ✔️ | ✔️ | -
|
||||
❌ | [CB3S](https://developer.tuya.com/en/docs/iot/cb3s?id=Kai94mec0s076) | BK7231N @ 120 MHz | 2 MiB | 256 KiB | 22 (14 I/O) | ✔️ | ✔️ | -
|
||||
❌ | [CB3S-NL](https://developer.tuya.com/en/docs/iot/CB3S-NL-module-datasheet?id=Kbaesan0vyoms) | BK7231NL (?) @ 120 MHz | 2 MiB | 256 KiB | 22 (14 I/O) | ✔️ | ✔️ | -
|
||||
❌ | [CB3SE](https://developer.tuya.com/en/docs/iot/CB3SE-Module-Datasheet?id=Kanoiluul7nl2) | BK7231N @ 120 MHz | 2 MiB | 256 KiB | 22 (17 I/O) | ✔️ | ✔️ | -
|
||||
❌ | [CB8P](https://developer.tuya.com/en/docs/iot/cb8p-module-datasheet?id=Kahvig14r1yk9) | BK7231N @ 120 MHz | 2 MiB | 256 KiB | 10 (8 I/O) | ✔️ | ✔️ | -
|
||||
❌ | [CBLC5](https://developer.tuya.com/en/docs/iot/cblc5-module-datasheet?id=Ka07iqyusq1wm) | BK7231N @ 120 MHz | 2 MiB | 256 KiB | 6 (3 I/O) | ✔️ | ✔️ | -
|
||||
❌ | [CBLC9](https://developer.tuya.com/en/docs/iot/cblc9-module-datasheet?id=Ka42cqnj9r0i5) | BK7231N @ 120 MHz | 2 MiB | 256 KiB | 8 (6 I/O) | ✔️ | ✔️ | -
|
||||
❌ | [CBU](https://developer.tuya.com/en/docs/iot/cbu-module-datasheet?id=Ka07pykl5dk4u) | BK7231N @ 120 MHz | 2 MiB | 256 KiB | 21 (18 I/O) | ✔️ | ✔️ | -
|
||||
❌ | [CBU-IPEX](https://developer.tuya.com/en/docs/iot/cbuipex-module-datasheet?id=Kaedsyurckrhu) | BK7231N @ 120 MHz | 2 MiB | 256 KiB | 21 (18 I/O) | ✔️ | ✔️ | -
|
||||
❌ | [CBU-NL](https://developer.tuya.com/en/docs/iot/CBU-NL-module-datasheet?id=Kbaeq6j53y0yg) | BK7231N (?) @ 120 MHz | 2 MiB | 256 KiB | 21 (18 I/O) | ✔️ | ✔️ | -
|
||||
❌ | [WR1](https://developer.tuya.com/en/docs/iot/wifiwr1module?id=K9605tc0k90t3) | RTL8710BN @ 125 MHz | 1 MiB | 256 KiB | 18 (11 I/O) | ✔️ | ❌ | -
|
||||
❌ | [WR1-IPEX](https://developer.tuya.com/en/docs/iot/wifiwr1ipexmodule?id=K9605t977tx5u) | RTL8710BN @ 125 MHz | 1 MiB | 256 KiB | 18 (11 I/O) | ✔️ | ❌ | -
|
||||
❌ | [WR1E](https://developer.tuya.com/en/docs/iot/wr1e?id=K96smbbeycxtf) | RTL8710BN @ 125 MHz | 2 MiB | 256 KiB | 18 (11 I/O) | ✔️ | ❌ | -
|
||||
❌ | [WR2](https://developer.tuya.com/en/docs/iot/wifiwr2module?id=K9605tko0juc3) | RTL8710BN @ 125 MHz | 2 MiB | 256 KiB | 11 (8 I/O) | ✔️ | ❌ | -
|
||||
❌ | [WR2E](https://developer.tuya.com/en/docs/iot/wr2e?id=K97scnsjhue4h) | RTL8710BN @ 125 MHz | 2 MiB | 256 KiB | 11 (8 I/O) | ✔️ | ❌ | -
|
||||
❌ | [WR2L](https://developer.tuya.com/en/docs/iot/wifiwr2lmodule?id=K9605tnbj7gva) | RTL8710BX @ 62.5 MHz | 2 MiB | 256 KiB | 7 (5 I/O) | ✔️ | ❌ | -
|
||||
❌ | [WR2LE](https://developer.tuya.com/en/docs/iot/wr2le?id=K9eio9y9e8i8c) | RTL8710BX @ 62.5 MHz | 2 MiB | 256 KiB | 7 (5 I/O) | ✔️ | ❌ | -
|
||||
[`wr3`](boards/wr3/README.md) | [WR3](https://developer.tuya.com/en/docs/iot/wr3-module-datasheet?id=K9g3ainzbj9z1) | RTL8710BN @ 125 MHz | 2 MiB | 256 KiB | 16 (12 I/O) | ✔️ | ❌ | `realtek-ambz`
|
||||
❌ | [WR3E](https://developer.tuya.com/en/docs/iot/wr3e-module-datasheet?id=K9elwlqbfosbc) | RTL8710BN @ 125 MHz | 2 MiB | 256 KiB | 16 (12 I/O) | ✔️ | ❌ | -
|
||||
❌ | [WR3L](https://developer.tuya.com/en/docs/iot/wifiwr3lmodule?id=K9605tt0kveqm) | RTL8710BX @ 125 MHz (?) | 2 MiB | 256 KiB | 16 (12 I/O) | ✔️ | ❌ | -
|
||||
❌ | [WR3LE](https://developer.tuya.com/en/docs/iot/wr3le?id=K986l7a1ha8tm) | RTL8710BX @ 62.5 MHz | 2 MiB | 256 KiB | 16 (12 I/O) | ✔️ | ❌ | -
|
||||
❌ | [WR3N](https://developer.tuya.com/en/docs/iot/wr3n-datasheet?id=K98zdx31ztdge) | RTL8710BN @ 125 MHz | 2 MiB | 256 KiB | 16 (10 I/O) | ✔️ | ❌ | -
|
||||
❌ | [WR4](https://developer.tuya.com/en/docs/iot/wifiwr4module?id=K9605tvu78p3e) | RTL8710BN @ 125 MHz | 1 MiB | 256 KiB | 16 (12 I/O) | ✔️ | ❌ | -
|
||||
❌ | [WR5E](https://developer.tuya.com/en/docs/iot/wr5e?id=K986r9pxqxa8i) | RTL8710BX @ 62.5 MHz | 2 MiB | 256 KiB | 15 (12 I/O) | ✔️ | ❌ | -
|
||||
❌ | [WR6-H](https://developer.tuya.com/en/docs/iot/wr6h-module-datasheet?id=K9pork8eeowgl) | RTL8710BN @ 125 MHz | 2 MiB | 256 KiB | 18 (12 I/O) | ✔️ | ❌ | -
|
||||
❌ | [WR6](https://developer.tuya.com/en/docs/iot/wr6-datasheet?id=K97rp45u6gff9) | RTL8710BN @ 125 MHz | 2 MiB | 256 KiB | 18 (12 I/O) | ✔️ | ❌ | -
|
||||
❌ | [WRG1](https://developer.tuya.com/en/docs/iot/wr6-datasheet?id=K97rp45u6gff9) | RTL8711AM @ 166 MHz | 4 MiB | 2048 KiB | 25 (20 I/O) | ✔️ | ❌ | -
|
||||
❌ | [XR1](https://developer.tuya.com/en/docs/iot/xr1?id=K9lq3y9xo0zkx) | XR809 @ 160 MHz | 2 MiB | 384 KiB | 18 (11 I/O) | ✔️ | ❌ | -
|
||||
❌ | [XR1-IPEX](https://developer.tuya.com/en/docs/iot/xr1ipex-module-datasheet?id=K9razqu9gqele) | XR809 @ 160 MHz | 2 MiB | 384 KiB | 18 (11 I/O) | ✔️ | ❌ | -
|
||||
❌ | [XR3](https://developer.tuya.com/en/docs/iot/xr3-datasheet?id=K98s9168qi49g) | XR809 @ 160 MHz | 2 MiB | 384 KiB | 22 (17 I/O) | ✔️ | ❌ | -
|
||||
❌ | [WE1S](https://developer.tuya.com/en/docs/iot/wifie1smodule?id=K9605thnvg3e7) | ESP8266EX @ 80/160 MHz | 2 MiB | 36 KiB | 18 (11 I/O) | ✔️ | ❌ | -
|
||||
❌ | [WE2L](https://developer.tuya.com/en/docs/iot/wifie2lmodule?id=K9605ud0gkjmh) | ESP8285 @ 80/160 MHz | 1 MiB | 50 KiB | 7 (5 I/O) | ✔️ | ❌ | -
|
||||
❌ | [WE2S](https://developer.tuya.com/en/docs/iot/wifie2smodule?id=K9605u79tgxug) | ESP8285 @ 80/160 MHz | 1 MiB | 50 KiB | 11 (8 I/O) | ✔️ | ❌ | -
|
||||
❌ | [WE3L](https://developer.tuya.com/en/docs/iot/wifie3lpinmodule?id=K9605uj1ar87n) | ESP8266 @ 80/160 MHz | 2 MiB | 50 KiB | 16 (12 I/O) | ✔️ | ❌ | -
|
||||
❌ | [WE3S](https://developer.tuya.com/en/docs/iot/wifie3smodule?id=K9605ua1cx9tv) | ESP8266 @ 80/160 MHz | 2 MiB | 50 KiB | 16 (12 I/O) | ✔️ | ❌ | -
|
||||
❌ | [WE3SE](https://developer.tuya.com/en/docs/iot/we3se?id=K97qv6ab7oh8d) | ESP32 @ 240 MHz | 4 MiB | 520 KiB | 22 (17 I/O) | ✔️ | ✔️ | -
|
||||
❌ | [WE5P](https://developer.tuya.com/en/docs/iot/wifie5pmodule?id=K9605um3dtjbx) | ESP8266 @ 80/160 MHz | 1 MiB | 50 KiB | 15 (11 I/O) | ✔️ | ❌ | -
|
||||
|
||||
\* Only modules featuring at least Wi-Fi. WBR, JWBR, CR, (TY)JW and (TY)LC Series are not included here
|
||||
|
||||
** I/O count includes GPIOs, ADCs, PWM outputs and UART, but doesn't count CEN/RST and power pins.
|
||||
|
||||
## Project structure
|
||||
|
||||
```
|
||||
arduino/
|
||||
├─ <platform name>/ Arduino Core for specific SoC
|
||||
│ ├─ cores/ Wiring core files
|
||||
│ ├─ libraries/ Supported built-in platform libraries
|
||||
├─ libretuya/
|
||||
│ ├─ api/ LibreTuya API (interfaces + LT class) for Arduino frameworks
|
||||
│ ├─ common/ Units common to all platforms
|
||||
│ ├─ compat/ Fixes for compatibility with ESP32 framework
|
||||
│ ├─ libraries/ Built-in platform-independent libraries
|
||||
boards/
|
||||
├─ <board name>/ Board-specific code
|
||||
│ ├─ variant.cpp Arduino variant initialization
|
||||
│ ├─ variant.h Arduino variant pin configs
|
||||
├─ <board name>.json PlatformIO board description
|
||||
builder/
|
||||
├─ frameworks/ Framework builders for PlatformIO
|
||||
│ ├─ <platform name>-sdk.py Vanilla SDK build system
|
||||
│ ├─ <platform name>-arduino.py Arduino Core build system
|
||||
├─ arduino-common.py Builder to provide ArduinoCore-API and LibreTuya APIs
|
||||
├─ main.py Main PlatformIO builder
|
||||
├─ utils.py SCons utils used during the build
|
||||
docs/ Project documentation, guides, tips, etc.
|
||||
platform/
|
||||
├─ <platform name>/ Platform-specific configurations
|
||||
│ ├─ bin/ Binary blobs (bootloaders, etc.)
|
||||
│ ├─ fixups/ Code fix-ups to replace SDK parts
|
||||
│ ├─ ld/ Linker scripts
|
||||
│ ├─ openocd/ OpenOCD configuration files
|
||||
tools/
|
||||
├─ <tool name>/ Tools used during the build
|
||||
platform.json PlatformIO manifest
|
||||
platform.py Custom PlatformIO script
|
||||
```
|
||||
|
||||
## Platforms
|
||||
|
||||
A list of platforms currently available in this project.
|
||||
|
||||
Platform name | Supported MCU(s) | Arduino Core | Source SDK (PIO framework)
|
||||
---------------|------------------------------------------------------------------------|--------------|--------------------------------------------------------------------------
|
||||
`realtek-ambz` | Realtek [AmebaZ](https://www.amebaiot.com/en/amebaz/) SoC (`RTL87xxB`) | ✔️ | `framework-realtek-amb1` ([amb1_sdk](https://github.com/ambiot/amb1_sdk))
|
||||
|
||||
### Realtek Ameba
|
||||
|
||||
The logic behind naming of Realtek chips and their series took me some time to figure out:
|
||||
|
||||
- RTL8xxxA - Ameba1/Ameba Series
|
||||
- RTL8xxxB - AmebaZ Series
|
||||
- RTL8xxxC - AmebaZ2/ZII Series
|
||||
- RTL8xxxD - AmebaD Series
|
||||
|
||||
As such, there are numerous CPUs with the same numbers but different series, which makes them require different code and SDKs.
|
||||
|
||||
- [RTL8195AM](https://www.realtek.com/en/products/communications-network-ics/item/rtl8195am)
|
||||
- RTL8710AF (found in amb1_arduino)
|
||||
- [RTL8711AM](https://www.realtek.com/en/products/communications-network-ics/item/rtl8711am)
|
||||
- [RTL8710BN](https://www.realtek.com/en/products/communications-network-ics/item/rtl8710bn)
|
||||
- RTL8710BX (found in Tuya product pages)
|
||||
- RTL8710B? (found in amb1_sdk)
|
||||
- RTL8711B? (found in amb1_sdk)
|
||||
- [RTL8710CM](https://www.realtek.com/en/products/communications-network-ics/item/rtl8710cm)
|
||||
- RTL8722CSM (found in ambd_arduino)
|
||||
- RTL8720DN (found in ambd_arduino)
|
||||
- [RTL8721DM](https://www.realtek.com/en/products/communications-network-ics/item/rtl8721dm)
|
||||
- RTL8722DM (found in ambd_arduino)
|
||||
- and probably many more
|
||||
|
||||
Different Ameba series are not compatible with each other. Apparently, there isn't an official public SDK for AmebaZ that can support C++ properly.
|
||||
|
||||
## Arduino Core support status
|
||||
|
||||
Note: this list will probably change with each functionality update.
|
||||
|
||||
| `realtek-ambz`
|
||||
--------------------|---------------
|
||||
Core functions | ✔️
|
||||
GPIO/PWM/IRQ | ✔️/❓/✔️
|
||||
Analog input | ❓
|
||||
UART I/O | ✔️
|
||||
Flash I/O | ❓
|
||||
**CORE LIBRARIES** |
|
||||
SoftwareSerial | ❌
|
||||
SPI | ❌
|
||||
Wire | ❌
|
||||
**OTHER LIBRARIES** |
|
||||
Wi-Fi STA/AP/Mixed | ✔️
|
||||
Wi-Fi Client (SSL) | ✔️ (✔️)
|
||||
Wi-Fi Server | ✔️
|
||||
Wi-Fi Events | ❌
|
||||
IPv6 | ❌
|
||||
HTTP Client (SSL) | ✔️ (❌)
|
||||
HTTP Server | ✔️
|
||||
NVS / Preferences | ❌
|
||||
SPIFFS | ❌
|
||||
BLE | -
|
||||
HTTP | ❌
|
||||
NTP | ❌
|
||||
OTA | ❌
|
||||
MDNS | ❌
|
||||
MQTT | ✅
|
||||
SD | ❌
|
||||
|
||||
Symbols:
|
||||
|
||||
- ✔️ working
|
||||
- ✅ tested, external library
|
||||
- ❓ untested
|
||||
- ❗ broken
|
||||
- ❌ not implemented (yet?)
|
||||
- \- not applicable
|
||||
|
||||
Names:
|
||||
|
||||
- Core functions - stuff like delay(), millis(), yield(), etc.
|
||||
- **CORE LIBRARIES** - included normally in all Arduino cores
|
||||
- **OTHER LIBRARIES** - included in ESP32 core or downloadable
|
||||
</div>
|
||||
|
||||
## License
|
||||
|
||||
|
||||
65
SUMMARY.md
Normal file
65
SUMMARY.md
Normal file
@@ -0,0 +1,65 @@
|
||||
* [Home](README.md)
|
||||
* [😊 Getting started](docs/getting-started/README.md)
|
||||
* [➡️ Info on accessing GPIOs](docs/getting-started/gpio.md)
|
||||
* [](SUMMARY.md)
|
||||
* [📺 Cloudcutter & ESPHome video guide](https://www.youtube.com/watch?v=sSj8f-HCHQ0)
|
||||
* [💡 ESPHome setup guide](docs/projects/esphome.md)
|
||||
* [🛖 ESPHome Hassio Add-On](https://github.com/libretiny-eu/esphome-hass-addon/pkgs/container/libretiny-esphome-hassio)
|
||||
* [](SUMMARY.md)
|
||||
* [📲 Flashing/dumping guide](docs/flashing/)
|
||||
* [🔌 How to flash/enter download mode?](docs/platform/)
|
||||
* [](SUMMARY.md)
|
||||
* [💻 Chips, boards, features](docs/status/supported.md)
|
||||
* [All boards](boards/)
|
||||
* [](SUMMARY.md)
|
||||
* 🍪 Chip family docs & info
|
||||
* [Beken BK72xx](docs/platform/beken-72xx/README.md)
|
||||
* [Finding encryption keys](docs/platform/beken-72xx/keys.md)
|
||||
* [Realtek Ameba - info](docs/platform/realtek-amb/README.md)
|
||||
* [Realtek AmebaZ](docs/platform/realtek-ambz/README.md)
|
||||
* [Debugging](docs/platform/realtek-ambz/debugging.md)
|
||||
* [Exception decoder](docs/platform/realtek-ambz/exception-decoder.md)
|
||||
* [Lightning LN882x](docs/platform/lightning-ln882x/README.md)
|
||||
* [🔧 LT Configuration](docs/dev/config.md)
|
||||
* 🧑 Programmer's manual
|
||||
* [⚠️ Migration guide](docs/dev/migration_v1.0.0.md)
|
||||
* [🔋 PlatformIO Examples](examples/)
|
||||
* [📖 LibreTiny API](docs/dev/lt-api.md)
|
||||
* [C API](ltapi/dir_c7e317b16142bccc961a83c0babf0065.md)
|
||||
* [C++ API](ltapi/dir_930634efd5dc4a957bbb6e685a3ccda1.md)
|
||||
* 📚 Arduino Libraries
|
||||
* [SoftwareSerial](ltapi/class_software_serial.md)
|
||||
* [WiFi](ltapi/class_wi_fi_class.md)
|
||||
* [](SUMMARY.md)
|
||||
* [Flash](ltapi/class_flash_class.md)
|
||||
* [IPv6Address](ltapi/classarduino_1_1_i_pv6_address.md)
|
||||
* [MD5](ltapi/libraries_2common_2_m_d5_2_m_d5_8h.md)
|
||||
* [mDNS](ltapi/classm_d_n_s.md)
|
||||
* [Update](ltapi/class_update_class.md)
|
||||
* [WiFiClient](ltapi/class_i_wi_fi_client.md)
|
||||
* [WiFiClientSecure](ltapi/class_i_wi_fi_client_secure.md)
|
||||
* [WiFiServer](ltapi/class_i_wi_fi_server.md)
|
||||
* [WiFiUDP](ltapi/class_i_wi_fi_u_d_p.md)
|
||||
* [](SUMMARY.md)
|
||||
* [HTTPClient](ltapi/class_h_t_t_p_client.md)
|
||||
* [StreamString](ltapi/class_stream_string.md)
|
||||
* [WebServer](ltapi/class_web_server.md)
|
||||
* [WiFiMulti](ltapi/class_wi_fi_multi.md)
|
||||
* [](SUMMARY.md)
|
||||
* [External compatible libraries](docs/dev/libs-3rd-party.md)
|
||||
* Full documentation
|
||||
* [Classes](ltapi/classes.md)
|
||||
* [Functions](ltapi/functions.md)
|
||||
* [Macros](ltapi/macros.md)
|
||||
* [File list](ltapi/files.md)
|
||||
* 👷 Contributor's manual (WIP)
|
||||
* [Porting new families](docs/contrib/porting.md)
|
||||
* [API functions guide](docs/contrib/lt-api.md)
|
||||
* [C standard library](docs/contrib/stdlib.md)
|
||||
* [📁 Project structure](docs/contrib/project-structure.md)
|
||||
* [✈️ OTA format](docs/contrib/ota/README.md)
|
||||
* [uf2ota.py tool](docs/contrib/ota/uf2ota.md)
|
||||
* [uf2ota.h library](docs/contrib/ota/library.md)
|
||||
* [📓 TODO](docs/TODO.md)
|
||||
* [](SUMMARY.md)
|
||||
* [🔗 Resources](docs/resources/)
|
||||
@@ -1,2 +0,0 @@
|
||||
realtek-ambz Realtek AmebaZ Arduino Core
|
||||
libretuya Interfaces for LibreTuya Arduino cores
|
||||
@@ -1,27 +0,0 @@
|
||||
/* Copyright (c) Kuba Szczodrzyński 2022-04-24. */
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
typedef struct {
|
||||
uint8_t manufacturerId;
|
||||
uint8_t chipId;
|
||||
uint8_t chipSizeId;
|
||||
} FlashId;
|
||||
|
||||
class IFlashClass {
|
||||
public:
|
||||
IFlashClass() {}
|
||||
|
||||
~IFlashClass() {}
|
||||
|
||||
virtual FlashId getChipId() = 0;
|
||||
virtual uint32_t getSize() = 0;
|
||||
|
||||
virtual bool eraseSector(uint32_t sector) = 0;
|
||||
virtual bool readBlock(uint32_t offset, uint8_t *data, size_t size) = 0;
|
||||
virtual bool writeBlock(uint32_t offset, uint8_t *data, size_t size) = 0;
|
||||
};
|
||||
@@ -1,17 +0,0 @@
|
||||
/* Copyright (c) Kuba Szczodrzyński 2022-04-29. */
|
||||
|
||||
#include "LibreTuyaAPI.h"
|
||||
|
||||
__weak char *strdup(const char *s) {
|
||||
size_t len = strlen(s) + 1;
|
||||
void *newp = malloc(len);
|
||||
if (newp == NULL)
|
||||
return NULL;
|
||||
return (char *)memcpy(newp, s, len);
|
||||
}
|
||||
|
||||
String ipToString(const IPAddress &ip) {
|
||||
char szRet[16];
|
||||
sprintf(szRet, "%hhu.%hhu.%hhu.%hhu", ip[0], ip[1], ip[2], ip[3]);
|
||||
return String(szRet);
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
/* Copyright (c) Kuba Szczodrzyński 2022-04-28. */
|
||||
|
||||
#pragma once
|
||||
|
||||
// LibreTuya version macros
|
||||
#ifndef LT_VERSION
|
||||
#define LT_VERSION 1.0.0
|
||||
#endif
|
||||
#ifndef LT_BOARD
|
||||
#define LT_BOARD unknown
|
||||
#endif
|
||||
#define STRINGIFY(x) #x
|
||||
#define STRINGIFY_MACRO(x) STRINGIFY(x)
|
||||
#define LT_VERSION_STR STRINGIFY_MACRO(LT_VERSION)
|
||||
#define LT_BOARD_STR STRINGIFY_MACRO(LT_BOARD)
|
||||
|
||||
// Includes
|
||||
#include "LibreTuyaConfig.h"
|
||||
#include <Arduino.h>
|
||||
|
||||
// C includes
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif // __cplusplus
|
||||
|
||||
#include "lt_logger.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
// Functional macros
|
||||
#define LT_BANNER() \
|
||||
LT_LOG( \
|
||||
LT_LEVEL_INFO, \
|
||||
__FUNCTION__, \
|
||||
__LINE__, \
|
||||
"LibreTuya v" LT_VERSION_STR " on " LT_BOARD_STR ", compiled at " __DATE__ " " __TIME__ \
|
||||
)
|
||||
|
||||
// ArduinoCore-API doesn't define these anymore
|
||||
#define FPSTR(pstr_pointer) (reinterpret_cast<const __FlashStringHelper *>(pstr_pointer))
|
||||
#define PGM_VOID_P const void *
|
||||
|
||||
// C functions
|
||||
extern char *strdup(const char *);
|
||||
|
||||
// C++ only functions
|
||||
#ifdef __cplusplus
|
||||
String ipToString(const IPAddress &ip);
|
||||
#endif
|
||||
@@ -1,70 +0,0 @@
|
||||
/* Copyright (c) Kuba Szczodrzyński 2022-04-28. */
|
||||
|
||||
#pragma once
|
||||
|
||||
// see docs/API Configuration
|
||||
|
||||
// Loglevels
|
||||
#define LT_LEVEL_VERBOSE LT_LEVEL_TRACE
|
||||
#define LT_LEVEL_TRACE 0
|
||||
#define LT_LEVEL_DEBUG 1
|
||||
#define LT_LEVEL_INFO 2
|
||||
#define LT_LEVEL_WARN 3
|
||||
#define LT_LEVEL_ERROR 4
|
||||
#define LT_LEVEL_FATAL 5
|
||||
|
||||
// Logger enabled/disabled
|
||||
#ifndef LT_LOGGER
|
||||
#define LT_LOGGER 1
|
||||
#endif
|
||||
|
||||
// Logger format options
|
||||
#ifndef LT_LOGGER_TIMESTAMP
|
||||
#define LT_LOGGER_TIMESTAMP 1
|
||||
#endif
|
||||
|
||||
#ifndef LT_LOGGER_CALLER
|
||||
#define LT_LOGGER_CALLER 1
|
||||
#endif
|
||||
|
||||
#ifndef LT_LOGGER_TASK
|
||||
#define LT_LOGGER_TASK 1
|
||||
#endif
|
||||
|
||||
#ifndef LT_LOGGER_COLOR
|
||||
#define LT_LOGGER_COLOR 0
|
||||
#endif
|
||||
|
||||
#ifndef LT_PRINTF_BROKEN
|
||||
#define LT_PRINTF_BROKEN 0
|
||||
#endif
|
||||
|
||||
// Global loglevel
|
||||
#ifndef LT_LOGLEVEL
|
||||
#define LT_LOGLEVEL LT_LEVEL_INFO
|
||||
#endif
|
||||
|
||||
// Per-module debugging
|
||||
#ifndef LT_DEBUG_WIFI
|
||||
#define LT_DEBUG_WIFI 0
|
||||
#endif
|
||||
|
||||
#ifndef LT_DEBUG_WIFI_CLIENT
|
||||
#define LT_DEBUG_WIFI_CLIENT 0
|
||||
#endif
|
||||
|
||||
#ifndef LT_DEBUG_WIFI_SERVER
|
||||
#define LT_DEBUG_WIFI_SERVER 0
|
||||
#endif
|
||||
|
||||
#ifndef LT_DEBUG_WIFI_STA
|
||||
#define LT_DEBUG_WIFI_STA 0
|
||||
#endif
|
||||
|
||||
#ifndef LT_DEBUG_WIFI_AP
|
||||
#define LT_DEBUG_WIFI_AP 0
|
||||
#endif
|
||||
|
||||
#ifndef LT_DEBUG_SSL
|
||||
#define LT_DEBUG_SSL 0
|
||||
#endif
|
||||
@@ -1,177 +0,0 @@
|
||||
/*
|
||||
WiFi.h - esp32 Wifi support.
|
||||
Based on WiFi.h from Arduino WiFi shield library.
|
||||
Copyright (c) 2011-2014 Arduino. All right reserved.
|
||||
Modified by Ivan Grokhotkov, December 2014
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include <api/IPAddress.h>
|
||||
#include <api/IPv6Address.h>
|
||||
#include <api/Print.h>
|
||||
|
||||
#include "WiFiType.h"
|
||||
|
||||
// TODO wifi events
|
||||
// TODO WiFiMulti library
|
||||
|
||||
class IWiFiClass {
|
||||
public:
|
||||
virtual void printDiag(Print &dest) = 0;
|
||||
};
|
||||
|
||||
class IWiFiGenericClass {
|
||||
public:
|
||||
virtual int32_t channel(void) = 0;
|
||||
virtual bool mode(WiFiMode mode) = 0;
|
||||
virtual WiFiMode getMode() = 0;
|
||||
virtual WiFiStatus status() = 0;
|
||||
|
||||
virtual bool enableSTA(bool enable) = 0;
|
||||
virtual bool enableAP(bool enable) = 0;
|
||||
|
||||
virtual bool setSleep(bool enable) = 0;
|
||||
virtual bool getSleep() = 0;
|
||||
|
||||
virtual bool setTxPower(int power) = 0;
|
||||
virtual int getTxPower() = 0;
|
||||
|
||||
virtual int hostByName(const char *hostname, IPAddress &aResult) {
|
||||
aResult = hostByName(hostname);
|
||||
return true;
|
||||
}
|
||||
|
||||
virtual IPAddress hostByName(const char *hostname) = 0;
|
||||
|
||||
static IPAddress calculateNetworkID(IPAddress ip, IPAddress subnet);
|
||||
static IPAddress calculateBroadcast(IPAddress ip, IPAddress subnet);
|
||||
static uint8_t calculateSubnetCIDR(IPAddress subnetMask);
|
||||
static String macToString(uint8_t *mac);
|
||||
};
|
||||
|
||||
class IWiFiSTAClass {
|
||||
public:
|
||||
virtual WiFiStatus begin(
|
||||
const char *ssid,
|
||||
const char *passphrase = NULL,
|
||||
int32_t channel = 0,
|
||||
const uint8_t *bssid = NULL,
|
||||
bool connect = true
|
||||
) = 0;
|
||||
virtual WiFiStatus begin(
|
||||
char *ssid, char *passphrase = NULL, int32_t channel = 0, const uint8_t *bssid = NULL, bool connect = true
|
||||
) = 0;
|
||||
|
||||
virtual bool config(
|
||||
IPAddress localIP,
|
||||
IPAddress gateway,
|
||||
IPAddress subnet,
|
||||
IPAddress dns1 = (uint32_t)0x00000000,
|
||||
IPAddress dns2 = (uint32_t)0x00000000
|
||||
) = 0;
|
||||
|
||||
virtual bool reconnect() = 0;
|
||||
virtual bool disconnect(bool wifiOff = false) = 0;
|
||||
|
||||
virtual bool isConnected();
|
||||
|
||||
virtual bool setAutoReconnect(bool autoReconnect) = 0;
|
||||
virtual bool getAutoReconnect() = 0;
|
||||
|
||||
virtual WiFiStatus waitForConnectResult(unsigned long timeout) = 0;
|
||||
|
||||
virtual IPAddress localIP() = 0;
|
||||
virtual uint8_t *macAddress(uint8_t *mac) = 0;
|
||||
virtual String macAddress() = 0;
|
||||
virtual IPAddress subnetMask() = 0;
|
||||
virtual IPAddress gatewayIP() = 0;
|
||||
virtual IPAddress dnsIP(uint8_t dns_no = 0) = 0;
|
||||
virtual IPAddress broadcastIP() = 0;
|
||||
virtual IPAddress networkID() = 0;
|
||||
virtual uint8_t subnetCIDR() = 0;
|
||||
virtual bool enableIpV6() = 0;
|
||||
virtual IPv6Address localIPv6() = 0;
|
||||
virtual const char *getHostname() = 0;
|
||||
virtual bool setHostname(const char *hostname) = 0;
|
||||
virtual bool setMacAddress(const uint8_t *mac) = 0;
|
||||
|
||||
inline bool hostname(const String &aHostname) {
|
||||
return setHostname(aHostname.c_str());
|
||||
}
|
||||
|
||||
virtual const String SSID() = 0;
|
||||
virtual const String psk() = 0;
|
||||
virtual uint8_t *BSSID() = 0;
|
||||
virtual String BSSIDstr() = 0;
|
||||
virtual int8_t RSSI() = 0;
|
||||
virtual WiFiAuthMode getEncryption() = 0;
|
||||
};
|
||||
|
||||
class IWiFiScanClass {
|
||||
public:
|
||||
virtual int16_t scanNetworks(
|
||||
bool async = false,
|
||||
bool showHidden = false,
|
||||
bool passive = false,
|
||||
uint32_t maxMsPerChannel = 300,
|
||||
uint8_t channel = 0
|
||||
) = 0;
|
||||
virtual bool getNetworkInfo(
|
||||
uint8_t networkItem,
|
||||
String &ssid,
|
||||
WiFiAuthMode &encryptionType,
|
||||
int32_t &RSSI,
|
||||
uint8_t *&BSSID,
|
||||
int32_t &channel
|
||||
) = 0;
|
||||
|
||||
virtual int16_t scanComplete() = 0;
|
||||
virtual void scanDelete() = 0;
|
||||
|
||||
virtual String SSID(uint8_t networkItem) = 0;
|
||||
virtual WiFiAuthMode encryptionType(uint8_t networkItem) = 0;
|
||||
virtual int32_t RSSI(uint8_t networkItem) = 0;
|
||||
virtual uint8_t *BSSID(uint8_t networkItem) = 0;
|
||||
virtual String BSSIDstr(uint8_t networkItem) = 0;
|
||||
virtual int32_t channel(uint8_t networkItem) = 0;
|
||||
};
|
||||
|
||||
class IWiFiAPClass {
|
||||
public:
|
||||
virtual bool softAP(
|
||||
const char *ssid, const char *passphrase = NULL, int channel = 1, bool ssidHidden = false, int maxClients = 4
|
||||
) = 0;
|
||||
virtual bool softAPConfig(IPAddress localIP, IPAddress gateway, IPAddress subnet) = 0;
|
||||
virtual bool softAPdisconnect(bool wifiOff = false) = 0;
|
||||
|
||||
virtual uint8_t softAPgetStationNum() = 0;
|
||||
|
||||
virtual IPAddress softAPIP() = 0;
|
||||
virtual IPAddress softAPBroadcastIP() = 0;
|
||||
virtual IPAddress softAPNetworkID() = 0;
|
||||
virtual uint8_t softAPSubnetCIDR() = 0;
|
||||
virtual bool softAPenableIpV6() = 0;
|
||||
virtual IPv6Address softAPIPv6() = 0;
|
||||
virtual const char *softAPgetHostname() = 0;
|
||||
virtual bool softAPsetHostname(const char *hostname) = 0;
|
||||
virtual uint8_t *softAPmacAddress(uint8_t *mac) = 0;
|
||||
virtual String softAPmacAddress(void) = 0;
|
||||
virtual const String softAPSSID(void) = 0;
|
||||
};
|
||||
@@ -1,66 +0,0 @@
|
||||
/*
|
||||
ESP8266WiFiType.h - esp8266 Wifi support.
|
||||
Copyright (c) 2011-2014 Arduino. All right reserved.
|
||||
Modified by Ivan Grokhotkov, December 2014
|
||||
Reworked by Markus Sattler, December 2015
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#define WIFI_SCAN_RUNNING (-1)
|
||||
#define WIFI_SCAN_FAILED (-2)
|
||||
|
||||
#define WiFiMode_t wifi_mode_t
|
||||
#define WiFiMode wifi_mode_t
|
||||
#define WiFiStatus wl_status_t
|
||||
#define WiFiAuthMode wifi_auth_mode_t
|
||||
|
||||
#define WIFI_OFF WIFI_MODE_NULL
|
||||
#define WIFI_STA WIFI_MODE_STA
|
||||
#define WIFI_AP WIFI_MODE_AP
|
||||
#define WIFI_AP_STA WIFI_MODE_APSTA
|
||||
|
||||
typedef enum {
|
||||
WIFI_MODE_NULL = 0,
|
||||
WIFI_MODE_STA,
|
||||
WIFI_MODE_AP,
|
||||
WIFI_MODE_APSTA,
|
||||
WIFI_MODE_MAX,
|
||||
} wifi_mode_t;
|
||||
|
||||
typedef enum {
|
||||
WL_NO_SHIELD = 255, // for compatibility with WiFi Shield library
|
||||
WL_IDLE_STATUS = 0,
|
||||
WL_NO_SSID_AVAIL = 1,
|
||||
WL_SCAN_COMPLETED = 2,
|
||||
WL_CONNECTED = 3,
|
||||
WL_CONNECT_FAILED = 4,
|
||||
WL_CONNECTION_LOST = 5,
|
||||
WL_DISCONNECTED = 6,
|
||||
} wl_status_t;
|
||||
|
||||
typedef enum {
|
||||
WIFI_AUTH_INVALID = 255,
|
||||
WIFI_AUTH_AUTO = 200,
|
||||
WIFI_AUTH_OPEN = 0,
|
||||
WIFI_AUTH_WEP = 1,
|
||||
WIFI_AUTH_WPA = 5,
|
||||
WIFI_AUTH_WPA2 = 6,
|
||||
WIFI_AUTH_WPA_PSK = 2,
|
||||
WIFI_AUTH_WPA2_PSK = 3,
|
||||
WIFI_AUTH_WPA_WPA2_PSK = 4,
|
||||
} wifi_auth_mode_t;
|
||||
@@ -1,11 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <Arduino.h>
|
||||
#include <api/Udp.h>
|
||||
|
||||
class IWiFiUDP : public UDP {
|
||||
public:
|
||||
uint8_t beginMulticast(IPAddress ip, uint16_t port);
|
||||
int beginMulticastPacket();
|
||||
int beginPacket();
|
||||
};
|
||||
@@ -1,157 +0,0 @@
|
||||
/* Copyright (c) Kuba Szczodrzyński 2022-04-28. */
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "LibreTuyaConfig.h"
|
||||
#include <stdint.h>
|
||||
|
||||
#if LT_LOGGER_CALLER
|
||||
#define LT_LOG(level, caller, line, ...) lt_log(level, caller, line, __VA_ARGS__)
|
||||
void lt_log(const uint8_t level, const char *caller, const unsigned short line, const char *format, ...);
|
||||
#else
|
||||
#define LT_LOG(level, caller, line, ...) lt_log(level, __VA_ARGS__)
|
||||
void lt_log(const uint8_t level, const char *format, ...);
|
||||
#endif
|
||||
|
||||
#if LT_LEVEL_TRACE >= LT_LOGLEVEL
|
||||
#define LT_T(...) LT_LOG(LT_LEVEL_TRACE, __FUNCTION__, __LINE__, __VA_ARGS__)
|
||||
#define LT_V(...) LT_LOG(LT_LEVEL_TRACE, __FUNCTION__, __LINE__, __VA_ARGS__)
|
||||
#else
|
||||
#define LT_T(...)
|
||||
#define LT_V(...)
|
||||
#endif
|
||||
|
||||
#if LT_LEVEL_DEBUG >= LT_LOGLEVEL
|
||||
#define LT_D(...) LT_LOG(LT_LEVEL_DEBUG, __FUNCTION__, __LINE__, __VA_ARGS__)
|
||||
#else
|
||||
#define LT_D(...)
|
||||
#endif
|
||||
|
||||
#if LT_LEVEL_INFO >= LT_LOGLEVEL
|
||||
#define LT_I(...) LT_LOG(LT_LEVEL_INFO, __FUNCTION__, __LINE__, __VA_ARGS__)
|
||||
#else
|
||||
#define LT_I(...)
|
||||
#endif
|
||||
|
||||
#if LT_LEVEL_WARN >= LT_LOGLEVEL
|
||||
#define LT_W(...) LT_LOG(LT_LEVEL_WARN, __FUNCTION__, __LINE__, __VA_ARGS__)
|
||||
#else
|
||||
#define LT_W(...)
|
||||
#endif
|
||||
|
||||
#if LT_LEVEL_ERROR >= LT_LOGLEVEL
|
||||
#define LT_E(...) LT_LOG(LT_LEVEL_ERROR, __FUNCTION__, __LINE__, __VA_ARGS__)
|
||||
#else
|
||||
#define LT_E(...)
|
||||
#endif
|
||||
|
||||
#if LT_LEVEL_FATAL >= LT_LOGLEVEL
|
||||
#define LT_F(...) LT_LOG(LT_LEVEL_FATAL, __FUNCTION__, __LINE__, __VA_ARGS__)
|
||||
#else
|
||||
#define LT_F(...)
|
||||
#endif
|
||||
|
||||
// ESP32 compat
|
||||
#define log_printf(...) LT_I(__VA_ARGS__)
|
||||
#define log_v(...) LT_V(__VA_ARGS__)
|
||||
#define log_d(...) LT_D(__VA_ARGS__)
|
||||
#define log_i(...) LT_I(__VA_ARGS__)
|
||||
#define log_w(...) LT_W(__VA_ARGS__)
|
||||
#define log_e(...) LT_E(__VA_ARGS__)
|
||||
#define log_n(...) LT_E(__VA_ARGS__)
|
||||
#define isr_log_v(...) LT_V(__VA_ARGS__)
|
||||
#define isr_log_d(...) LT_D(__VA_ARGS__)
|
||||
#define isr_log_i(...) LT_I(__VA_ARGS__)
|
||||
#define isr_log_w(...) LT_W(__VA_ARGS__)
|
||||
#define isr_log_e(...) LT_E(__VA_ARGS__)
|
||||
#define isr_log_n(...) LT_E(__VA_ARGS__)
|
||||
#define ESP_LOGV(...) LT_V(__VA_ARGS__)
|
||||
#define ESP_LOGD(...) LT_D(__VA_ARGS__)
|
||||
#define ESP_LOGI(...) LT_I(__VA_ARGS__)
|
||||
#define ESP_LOGW(...) LT_W(__VA_ARGS__)
|
||||
#define ESP_LOGE(...) LT_E(__VA_ARGS__)
|
||||
#define ESP_EARLY_LOGV(...) LT_V(__VA_ARGS__)
|
||||
#define ESP_EARLY_LOGD(...) LT_D(__VA_ARGS__)
|
||||
#define ESP_EARLY_LOGI(...) LT_I(__VA_ARGS__)
|
||||
#define ESP_EARLY_LOGW(...) LT_W(__VA_ARGS__)
|
||||
#define ESP_EARLY_LOGE(...) LT_E(__VA_ARGS__)
|
||||
|
||||
#define LT_T_MOD(module, ...) \
|
||||
do { \
|
||||
if (module) { \
|
||||
LT_T(__VA_ARGS__); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define LT_D_MOD(module, ...) \
|
||||
do { \
|
||||
if (module) { \
|
||||
LT_D(__VA_ARGS__); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define LT_RET(ret) \
|
||||
LT_E("ret=%d", ret); \
|
||||
return ret;
|
||||
|
||||
#define LT_RET_NZ(ret) \
|
||||
if (ret) { \
|
||||
LT_E("ret=%d", ret); \
|
||||
return ret; \
|
||||
}
|
||||
#define LT_RET_LZ(ret) \
|
||||
if (ret < 0) { \
|
||||
LT_E("ret=%d", ret); \
|
||||
return ret; \
|
||||
}
|
||||
#define LT_RET_LEZ(ret) \
|
||||
if (ret <= 0) { \
|
||||
LT_E("ret=%d", ret); \
|
||||
return ret; \
|
||||
}
|
||||
|
||||
#define LT_ERRNO_NZ(ret) \
|
||||
if (ret) { \
|
||||
LT_E("errno=%d, ret=%d", errno, ret); \
|
||||
return ret; \
|
||||
}
|
||||
#define LT_ERRNO_LZ(ret) \
|
||||
if (ret < 0) { \
|
||||
LT_E("errno=%d, ret=%d", errno, ret); \
|
||||
return ret; \
|
||||
}
|
||||
#define LT_ERRNO_LEZ(ret) \
|
||||
if (ret <= 0) { \
|
||||
LT_E("errno=%d, ret=%d", errno, ret); \
|
||||
return ret; \
|
||||
}
|
||||
|
||||
// WiFi.cpp
|
||||
#define LT_T_WG(...) LT_T_MOD(LT_DEBUG_WIFI, __VA_ARGS__)
|
||||
#define LT_V_WG(...) LT_T_MOD(LT_DEBUG_WIFI, __VA_ARGS__)
|
||||
#define LT_D_WG(...) LT_D_MOD(LT_DEBUG_WIFI, __VA_ARGS__)
|
||||
|
||||
// WiFiClient.cpp
|
||||
#define LT_T_WC(...) LT_T_MOD(LT_DEBUG_WIFI_CLIENT, __VA_ARGS__)
|
||||
#define LT_V_WC(...) LT_T_MOD(LT_DEBUG_WIFI_CLIENT, __VA_ARGS__)
|
||||
#define LT_D_WC(...) LT_D_MOD(LT_DEBUG_WIFI_CLIENT, __VA_ARGS__)
|
||||
|
||||
// WiFiServer.cpp
|
||||
#define LT_T_WS(...) LT_T_MOD(LT_DEBUG_WIFI_SERVER, __VA_ARGS__)
|
||||
#define LT_V_WS(...) LT_T_MOD(LT_DEBUG_WIFI_SERVER, __VA_ARGS__)
|
||||
#define LT_D_WS(...) LT_D_MOD(LT_DEBUG_WIFI_SERVER, __VA_ARGS__)
|
||||
|
||||
// WiFiSTA.cpp
|
||||
#define LT_T_WSTA(...) LT_T_MOD(LT_DEBUG_WIFI_STA, __VA_ARGS__)
|
||||
#define LT_V_WSTA(...) LT_T_MOD(LT_DEBUG_WIFI_STA, __VA_ARGS__)
|
||||
#define LT_D_WSTA(...) LT_D_MOD(LT_DEBUG_WIFI_STA, __VA_ARGS__)
|
||||
|
||||
// WiFiAP.cpp
|
||||
#define LT_T_WAP(...) LT_T_MOD(LT_DEBUG_WIFI_AP, __VA_ARGS__)
|
||||
#define LT_V_WAP(...) LT_T_MOD(LT_DEBUG_WIFI_AP, __VA_ARGS__)
|
||||
#define LT_D_WAP(...) LT_D_MOD(LT_DEBUG_WIFI_AP, __VA_ARGS__)
|
||||
|
||||
// WiFiClientSecure.cpp & implementations
|
||||
#define LT_T_SSL(...) LT_T_MOD(LT_DEBUG_SSL, __VA_ARGS__)
|
||||
#define LT_V_SSL(...) LT_T_MOD(LT_DEBUG_SSL, __VA_ARGS__)
|
||||
#define LT_D_SSL(...) LT_D_MOD(LT_DEBUG_SSL, __VA_ARGS__)
|
||||
@@ -1,61 +0,0 @@
|
||||
/*
|
||||
Copyright (c) 2015 Arduino LLC. All right reserved.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/**
|
||||
* Empty yield() hook.
|
||||
*
|
||||
* This function is intended to be used by library writers to build
|
||||
* libraries or sketches that supports cooperative threads.
|
||||
*
|
||||
* Its defined as a weak symbol and it can be redefined to implement a
|
||||
* real cooperative scheduler.
|
||||
*/
|
||||
static void __empty() {
|
||||
// Empty
|
||||
}
|
||||
|
||||
void yield(void) __attribute__((weak, alias("__empty")));
|
||||
|
||||
/**
|
||||
* SysTick hook
|
||||
*
|
||||
* This function is called from SysTick handler, before the default
|
||||
* handler provided by Arduino.
|
||||
*/
|
||||
static int __false() {
|
||||
// Return false
|
||||
return 0;
|
||||
}
|
||||
|
||||
int sysTickHook(void) __attribute__((weak, alias("__false")));
|
||||
|
||||
/**
|
||||
* SVC hook
|
||||
* PendSV hook
|
||||
*
|
||||
* These functions are called from SVC handler, and PensSV handler.
|
||||
* Default action is halting.
|
||||
*/
|
||||
static void __halt() {
|
||||
// Halts
|
||||
while (1)
|
||||
;
|
||||
}
|
||||
|
||||
void svcHook(void) __attribute__((weak, alias("__halt")));
|
||||
void pendSVHook(void) __attribute__((weak, alias("__halt")));
|
||||
@@ -1,7 +0,0 @@
|
||||
/* Copyright (c) Kuba Szczodrzyński 2022-04-29. */
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <time.h>
|
||||
|
||||
extern char *strptime(const char *buf, const char *fmt, struct tm *tm);
|
||||
@@ -1,56 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
/* Request Methods */
|
||||
#define HTTP_METHOD_MAP(XX) \
|
||||
XX(0, DELETE, DELETE) \
|
||||
XX(1, GET, GET) \
|
||||
XX(2, HEAD, HEAD) \
|
||||
XX(3, POST, POST) \
|
||||
XX(4, PUT, PUT) \
|
||||
/* pathological */ \
|
||||
XX(5, CONNECT, CONNECT) \
|
||||
XX(6, OPTIONS, OPTIONS) \
|
||||
XX(7, TRACE, TRACE) \
|
||||
/* WebDAV */ \
|
||||
XX(8, COPY, COPY) \
|
||||
XX(9, LOCK, LOCK) \
|
||||
XX(10, MKCOL, MKCOL) \
|
||||
XX(11, MOVE, MOVE) \
|
||||
XX(12, PROPFIND, PROPFIND) \
|
||||
XX(13, PROPPATCH, PROPPATCH) \
|
||||
XX(14, SEARCH, SEARCH) \
|
||||
XX(15, UNLOCK, UNLOCK) \
|
||||
XX(16, BIND, BIND) \
|
||||
XX(17, REBIND, REBIND) \
|
||||
XX(18, UNBIND, UNBIND) \
|
||||
XX(19, ACL, ACL) \
|
||||
/* subversion */ \
|
||||
XX(20, REPORT, REPORT) \
|
||||
XX(21, MKACTIVITY, MKACTIVITY) \
|
||||
XX(22, CHECKOUT, CHECKOUT) \
|
||||
XX(23, MERGE, MERGE) \
|
||||
/* upnp */ \
|
||||
XX(24, MSEARCH, M - SEARCH) \
|
||||
XX(25, NOTIFY, NOTIFY) \
|
||||
XX(26, SUBSCRIBE, SUBSCRIBE) \
|
||||
XX(27, UNSUBSCRIBE, UNSUBSCRIBE) \
|
||||
/* RFC-5789 */ \
|
||||
XX(28, PATCH, PATCH) \
|
||||
XX(29, PURGE, PURGE) \
|
||||
/* CalDAV */ \
|
||||
XX(30, MKCALENDAR, MKCALENDAR) \
|
||||
/* RFC-2068, section 19.6.1.2 */ \
|
||||
XX(31, LINK, LINK) \
|
||||
XX(32, UNLINK, UNLINK) \
|
||||
/* icecast */ \
|
||||
XX(33, SOURCE, SOURCE)
|
||||
|
||||
enum http_method {
|
||||
|
||||
#define XX(num, name, string) HTTP_##name = num,
|
||||
HTTP_METHOD_MAP(XX)
|
||||
#undef XX
|
||||
};
|
||||
|
||||
typedef enum http_method HTTPMethod;
|
||||
#define HTTP_ANY (HTTPMethod)(255)
|
||||
@@ -1,29 +0,0 @@
|
||||
/* Copyright (c) Kuba Szczodrzyński 2022-04-23. */
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
#include "WCharacterFixup.h"
|
||||
#endif
|
||||
|
||||
#define PinMode PinModeArduino // this conflicts with SDK enum
|
||||
#include <api/ArduinoAPI.h>
|
||||
#include <api/LibreTuyaAPI.h>
|
||||
#undef PinMode
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" uint32_t SystemCoreClock;
|
||||
#else
|
||||
extern uint32_t SystemCoreClock;
|
||||
#endif
|
||||
#define clockCyclesPerMicrosecond() (SystemCoreClock / 1000000L)
|
||||
#define clockCyclesToMicroseconds(a) (((a)*1000L) / (SystemCoreClock / 1000L))
|
||||
#define microsecondsToClockCycles(a) ((a) * (SystemCoreClock / 1000000L))
|
||||
|
||||
#define interrupts() vPortClearInterruptMask(0)
|
||||
#define noInterrupts() ulPortSetInterruptMask()
|
||||
|
||||
// Include platform-specific code
|
||||
#include "WVariant.h"
|
||||
// Include board variant
|
||||
#include "variant.h"
|
||||
@@ -1,98 +0,0 @@
|
||||
/*
|
||||
Copyright (c) 2011 Arduino. All right reserved.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "LOGUARTClass.h"
|
||||
|
||||
#include <Arduino.h>
|
||||
|
||||
#define LOG_UART_MODIFIABLE_BAUD_RATE 1
|
||||
|
||||
RingBuffer rx_buffer0;
|
||||
|
||||
LOGUARTClass::LOGUARTClass(int dwIrq, RingBuffer *pRx_buffer) {
|
||||
_rx_buffer = pRx_buffer;
|
||||
_dwIrq = dwIrq;
|
||||
}
|
||||
|
||||
void IrqHandler(void) {
|
||||
uint8_t data = 0;
|
||||
BOOL PullMode = _FALSE;
|
||||
uint32_t IrqEn = DiagGetIsrEnReg();
|
||||
|
||||
DiagSetIsrEnReg(0);
|
||||
|
||||
data = DiagGetChar(PullMode);
|
||||
if (data > 0)
|
||||
rx_buffer0.store_char(data);
|
||||
|
||||
DiagSetIsrEnReg(IrqEn);
|
||||
}
|
||||
|
||||
void LOGUARTClass::begin(const uint32_t dwBaudRate) {
|
||||
DIAG_UartReInit((IRQ_FUN)IrqHandler);
|
||||
NVIC_SetPriority(UART_LOG_IRQ, 10);
|
||||
LOGUART_SetBaud(dwBaudRate);
|
||||
}
|
||||
|
||||
void LOGUARTClass::end(void) {
|
||||
// clear any received data
|
||||
_rx_buffer->_iHead = _rx_buffer->_iTail;
|
||||
}
|
||||
|
||||
int LOGUARTClass::available(void) {
|
||||
return (uint32_t)(SERIAL_BUFFER_SIZE + _rx_buffer->_iHead - _rx_buffer->_iTail) % SERIAL_BUFFER_SIZE;
|
||||
}
|
||||
|
||||
int LOGUARTClass::peek(void) {
|
||||
|
||||
if (_rx_buffer->_iHead == _rx_buffer->_iTail)
|
||||
return -1;
|
||||
|
||||
return _rx_buffer->_aucBuffer[_rx_buffer->_iTail];
|
||||
}
|
||||
|
||||
int LOGUARTClass::read(void) {
|
||||
// if the head isn't ahead of the tail, we don't have any characters
|
||||
if (_rx_buffer->_iHead == _rx_buffer->_iTail)
|
||||
return -1;
|
||||
|
||||
uint8_t uc = _rx_buffer->_aucBuffer[_rx_buffer->_iTail];
|
||||
_rx_buffer->_iTail = (unsigned int)(_rx_buffer->_iTail + 1) % SERIAL_BUFFER_SIZE;
|
||||
return uc;
|
||||
}
|
||||
|
||||
void LOGUARTClass::flush(void) {
|
||||
// TODO:
|
||||
// while ( serial_writable(&(this->sobj)) != 1 );
|
||||
/*
|
||||
// Wait for transmission to complete
|
||||
while ((_pUart->UART_SR & UART_SR_TXRDY) != UART_SR_TXRDY)
|
||||
;
|
||||
*/
|
||||
}
|
||||
|
||||
size_t LOGUARTClass::write(const uint8_t uc_data) {
|
||||
DiagPutChar(uc_data);
|
||||
return 1;
|
||||
}
|
||||
|
||||
LOGUARTClass Serial(UART_LOG_IRQ, &rx_buffer0);
|
||||
|
||||
bool Serial_available() {
|
||||
return Serial.available() > 0;
|
||||
}
|
||||
@@ -1,58 +0,0 @@
|
||||
/*
|
||||
Copyright (c) 2011 Arduino. All right reserved.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <api/HardwareSerial.h>
|
||||
#include <api/RingBuffer.h>
|
||||
|
||||
using namespace arduino;
|
||||
|
||||
// TODO this class begs to be rewritten :(
|
||||
|
||||
class LOGUARTClass : public HardwareSerial {
|
||||
public:
|
||||
LOGUARTClass(int dwIrq, RingBuffer *pRx_buffer);
|
||||
|
||||
void begin(const uint32_t dwBaudRate);
|
||||
|
||||
inline void begin(const uint32_t dwBaudRate, uint16_t config) {
|
||||
begin(dwBaudRate); // TODO implement this properly
|
||||
}
|
||||
|
||||
void end(void);
|
||||
int available(void);
|
||||
int peek(void);
|
||||
int read(void);
|
||||
void flush(void);
|
||||
size_t write(const uint8_t c);
|
||||
|
||||
using Print::write; // pull in write(str) and write(buf, size) from Print
|
||||
|
||||
operator bool() {
|
||||
return true; // UART always active
|
||||
}
|
||||
|
||||
protected:
|
||||
RingBuffer *_rx_buffer;
|
||||
|
||||
int _dwIrq;
|
||||
|
||||
private:
|
||||
friend bool Serial_available();
|
||||
};
|
||||
@@ -1,12 +0,0 @@
|
||||
#include <Arduino.h>
|
||||
|
||||
extern void pinRemoveMode(pin_size_t pinNumber);
|
||||
extern void _tone(uint32_t ulPin, unsigned int frequency, unsigned long duration);
|
||||
|
||||
void tone(uint32_t ulPin, unsigned int frequency, unsigned long duration) {
|
||||
_tone(ulPin, frequency, duration);
|
||||
}
|
||||
|
||||
void noTone(uint32_t ulPin) {
|
||||
pinRemoveMode(ulPin);
|
||||
}
|
||||
@@ -1,78 +0,0 @@
|
||||
#include <Arduino.h>
|
||||
#include <gpio_api.h>
|
||||
#include <gpio_irq_api.h>
|
||||
#include <gpio_irq_ex_api.h>
|
||||
|
||||
extern void *gpio_pin_struct[PINS_COUNT];
|
||||
extern void *gpio_irq_handler_list[PINS_COUNT];
|
||||
|
||||
extern bool pinInvalid(pin_size_t pinNumber);
|
||||
extern void pinRemoveMode(pin_size_t pinNumber);
|
||||
|
||||
void gpioIrqHandler(uint32_t id, gpio_irq_event event) {
|
||||
if (gpio_irq_handler_list[id] != NULL) {
|
||||
((void (*)(uint32_t, uint32_t))gpio_irq_handler_list[id])(id, (uint32_t)event);
|
||||
}
|
||||
}
|
||||
|
||||
void attachInterrupt(pin_size_t interruptNumber, voidFuncPtr callback, PinStatus mode) {
|
||||
if (pinInvalid(interruptNumber))
|
||||
return;
|
||||
|
||||
gpio_irq_handler_list[interruptNumber] = callback;
|
||||
|
||||
if (g_APinDescription[interruptNumber].ulPinType == PIO_GPIO_IRQ &&
|
||||
g_APinDescription[interruptNumber].ulPinMode == mode)
|
||||
// Nothing changes in pin mode
|
||||
return;
|
||||
|
||||
if (g_APinDescription[interruptNumber].ulPinType != PIO_GPIO_IRQ)
|
||||
// pin mode changes; deinit gpio and free memory
|
||||
pinRemoveMode(interruptNumber);
|
||||
|
||||
gpio_irq_t *gpio;
|
||||
|
||||
if (g_APinDescription[interruptNumber].ulPinType == NOT_INITIAL) {
|
||||
// allocate memory if pin not used before
|
||||
gpio = malloc(sizeof(gpio_irq_t));
|
||||
gpio_pin_struct[interruptNumber] = gpio;
|
||||
gpio_irq_init(gpio, g_APinDescription[interruptNumber].pinname, gpioIrqHandler, interruptNumber);
|
||||
g_APinDescription[interruptNumber].ulPinType = PIO_GPIO_IRQ;
|
||||
} else {
|
||||
// pin already used as irq
|
||||
gpio = (gpio_irq_t *)gpio_pin_struct[interruptNumber];
|
||||
}
|
||||
g_APinDescription[interruptNumber].ulPinMode = mode;
|
||||
|
||||
gpio_irq_event event;
|
||||
|
||||
switch (mode) {
|
||||
case LOW:
|
||||
event = IRQ_LOW;
|
||||
break;
|
||||
case HIGH:
|
||||
event = IRQ_HIGH;
|
||||
break;
|
||||
case FALLING:
|
||||
event = IRQ_FALL;
|
||||
break;
|
||||
case RISING:
|
||||
event = IRQ_RISE;
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
gpio_irq_set(gpio, event, 1);
|
||||
gpio_irq_enable(gpio);
|
||||
}
|
||||
|
||||
void detachInterrupt(pin_size_t interruptNumber) {
|
||||
if (pinInvalid(interruptNumber))
|
||||
return;
|
||||
|
||||
if (g_APinDescription[interruptNumber].ulPinType == PIO_GPIO_IRQ) {
|
||||
pinRemoveMode(interruptNumber);
|
||||
}
|
||||
gpio_irq_handler_list[interruptNumber] = NULL;
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "sdk_extern.h"
|
||||
#include "sdk_mem.h"
|
||||
#include "sdk_os.h"
|
||||
|
||||
#define NOT_INITIAL (1UL << 0)
|
||||
#define PIO_GPIO (1UL << 1)
|
||||
#define PIO_PWM (1UL << 2)
|
||||
#define PIO_I2C (1UL << 3)
|
||||
#define PIO_ADC (1UL << 4)
|
||||
#define PIO_DAC (1UL << 5)
|
||||
#define PIO_GPIO_IRQ (1UL << 6)
|
||||
|
||||
#define PWM_MODE_ENABLED 1
|
||||
#define PWM_MODE_DISABLED 0
|
||||
|
||||
#define DEFAULT 1
|
||||
#define EXTERNAL 0
|
||||
|
||||
#define round(x) ((x) >= 0 ? (long)((x) + 0.5) : (long)((x)-0.5))
|
||||
|
||||
typedef enum _eAnalogReference {
|
||||
AR_DEFAULT,
|
||||
} eAnalogReference;
|
||||
|
||||
// Types used for the table below
|
||||
typedef struct _PinDescription {
|
||||
// HW PinNames
|
||||
uint32_t pinname;
|
||||
// Current Pin Type
|
||||
uint32_t ulPinType;
|
||||
// Supported Pin Function
|
||||
uint32_t ulPinAttribute;
|
||||
// Current Pin Mode
|
||||
uint32_t ulPinMode;
|
||||
} PinDescription;
|
||||
|
||||
// Pins table to be instantiated into variant.cpp
|
||||
extern PinDescription g_APinDescription[];
|
||||
|
||||
// Additional Wiring functions
|
||||
extern uint32_t digitalPinToPort(uint32_t pinNumber);
|
||||
extern uint32_t digitalPinToBitMask(uint32_t pinNumber);
|
||||
extern void analogReadResolution(int res);
|
||||
extern void analogWriteResolution(int res);
|
||||
extern void analogOutputInit(void);
|
||||
extern void analogWritePeriod(int us);
|
||||
extern void wait_for_debug();
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
@@ -1,79 +0,0 @@
|
||||
/*
|
||||
main.cpp - Main loop for Arduino sketches
|
||||
Copyright (c) 2005-2013 Arduino Team. All right reserved.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#define ARDUINO_MAIN
|
||||
|
||||
#include <Arduino.h>
|
||||
#include <cmsis_os.h>
|
||||
|
||||
// Weak empty variant initialization function.
|
||||
// May be redefined by variant files.
|
||||
void initVariant() __attribute__((weak));
|
||||
|
||||
void initVariant() {}
|
||||
|
||||
// Initialize C library
|
||||
extern "C" void __libc_init_array(void);
|
||||
|
||||
osThreadId main_tid = 0;
|
||||
|
||||
void main_task(const void *arg) {
|
||||
setup();
|
||||
|
||||
for (;;) {
|
||||
loop();
|
||||
if (serialEventRun)
|
||||
serialEventRun();
|
||||
yield();
|
||||
}
|
||||
}
|
||||
|
||||
int main(void) {
|
||||
LT_BANNER();
|
||||
init();
|
||||
|
||||
__libc_init_array();
|
||||
|
||||
initVariant();
|
||||
|
||||
osThreadDef(main_task, osPriorityRealtime, 1, 4096 * 4);
|
||||
main_tid = osThreadCreate(osThread(main_task), NULL);
|
||||
|
||||
osKernelStart();
|
||||
|
||||
while (1)
|
||||
;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void serialEvent() __attribute__((weak));
|
||||
bool Serial_available() __attribute__((weak));
|
||||
|
||||
void serialEventRun(void) {
|
||||
if (Serial_available && serialEvent && Serial_available())
|
||||
serialEvent();
|
||||
}
|
||||
|
||||
void wait_for_debug() {
|
||||
while (((CoreDebug->DHCSR) & CoreDebug_DHCSR_C_DEBUGEN_Msk) == 0) {
|
||||
asm("nop");
|
||||
}
|
||||
delay(1000);
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
/* Copyright (c) Kuba Szczodrzyński 2022-05-06. */
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#define boolean boolean_rtl
|
||||
#include <ameba_soc.h>
|
||||
#include <gpio_api.h>
|
||||
#include <rand.h>
|
||||
#include <rt_lib_rom.h>
|
||||
#include <rtl_lib.h>
|
||||
#include <wait_api.h>
|
||||
#undef boolean
|
||||
|
||||
// stdio.h
|
||||
#define printf rtl_printf
|
||||
#define sprintf rtl_sprintf
|
||||
|
||||
// moved from syscalls.h
|
||||
#define _close __rtl_close
|
||||
#define _fstat __rtl_fstat
|
||||
#define _isatty __rtl_isatty
|
||||
#define _lseek __rtl_lseek
|
||||
#define _open __rtl_open
|
||||
#define _read __rtl_read
|
||||
#define _write __rtl_write
|
||||
#define _sbrk __rtl_sbrk
|
||||
|
||||
#define delay_us wait_us
|
||||
|
||||
extern void wait_us(int us);
|
||||
extern int LOGUART_SetBaud(uint32_t BaudRate); // from fixups/log_uart.c
|
||||
extern void DumpForOneBytes(void *addr, int cnt); // cnt max 0x70!
|
||||
extern void SystemCoreClockUpdate(void);
|
||||
@@ -1,16 +0,0 @@
|
||||
/* Copyright (c) Kuba Szczodrzyński 2022-05-06. */
|
||||
|
||||
#include "sdk_mem.h"
|
||||
|
||||
#include <Arduino.h> // for memset
|
||||
|
||||
void *pvPortZalloc(size_t size) {
|
||||
void *pvReturn = pvPortMalloc(size);
|
||||
if (pvReturn)
|
||||
memset(pvReturn, 0, size);
|
||||
return pvReturn;
|
||||
}
|
||||
|
||||
void *pvPortCalloc(size_t nmemb, size_t size) {
|
||||
return pvPortZalloc(nmemb * size);
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
/* Copyright (c) Kuba Szczodrzyński 2022-05-06. */
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
// provide extern functions directly, as callers
|
||||
// generally don't expect needing to include malloc()
|
||||
extern void *pvPortMalloc(size_t xWantedSize);
|
||||
extern void *pvPortZalloc(size_t size);
|
||||
extern void *pvPortCalloc(size_t nmemb, size_t size);
|
||||
extern void *pvPortReAlloc(void *pv, size_t xWantedSize);
|
||||
extern void vPortFree(void *pv);
|
||||
|
||||
#define malloc pvPortMalloc
|
||||
#define zalloc pvPortZalloc
|
||||
#define calloc pvPortCalloc
|
||||
#define realloc pvPortReAlloc
|
||||
#define free vPortFree
|
||||
@@ -1,110 +0,0 @@
|
||||
#include "sdk_os.h"
|
||||
|
||||
#include <Arduino.h>
|
||||
#include <cmsis_os.h>
|
||||
|
||||
uint32_t os_thread_create(void (*task)(const void *argument), void *argument, int priority, uint32_t stack_size) {
|
||||
|
||||
osThreadDef_t thread_def;
|
||||
|
||||
thread_def.pthread = task;
|
||||
thread_def.tpriority = (osPriority)priority;
|
||||
// the underlying freertos implementation on cmsis os divide stack size by 4
|
||||
thread_def.stacksize = stack_size * 4;
|
||||
thread_def.name = "ARDUINO";
|
||||
|
||||
return (uint32_t)osThreadCreate(&thread_def, argument);
|
||||
}
|
||||
|
||||
uint32_t os_thread_get_id(void) {
|
||||
return osThreadGetId();
|
||||
}
|
||||
|
||||
uint32_t os_thread_terminate(uint32_t thread_id) {
|
||||
return (uint32_t)osThreadTerminate(thread_id);
|
||||
}
|
||||
|
||||
uint32_t os_thread_yield(void) {
|
||||
return (uint32_t)osThreadYield();
|
||||
}
|
||||
|
||||
uint32_t os_thread_set_priority(uint32_t thread_id, int priority) {
|
||||
return (uint32_t)osThreadSetPriority(thread_id, (osPriority)priority);
|
||||
}
|
||||
|
||||
int os_thread_get_priority(uint32_t thread_id) {
|
||||
return (int)osThreadGetPriority(thread_id);
|
||||
}
|
||||
|
||||
int32_t os_signal_set(uint32_t thread_id, int32_t signals) {
|
||||
return osSignalSet(thread_id, signals);
|
||||
}
|
||||
|
||||
int32_t os_signal_clear(uint32_t thread_id, int32_t signals) {
|
||||
return osSignalClear(thread_id, signals);
|
||||
}
|
||||
|
||||
os_event_t os_signal_wait(int32_t signals, uint32_t millisec) {
|
||||
|
||||
osEvent evt;
|
||||
os_event_t ret;
|
||||
|
||||
evt = osSignalWait(signals, millisec);
|
||||
ret.status = (uint32_t)evt.status;
|
||||
ret.value.signals = evt.value.signals;
|
||||
ret.def.message_id = evt.def.message_id;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
typedef void (*os_ptimer)(const void *argument);
|
||||
|
||||
uint32_t os_timer_create(void (*callback)(const void *argument), uint8_t isPeriodic, void *argument) {
|
||||
|
||||
osTimerDef_t *pTimerDef;
|
||||
|
||||
pTimerDef = (osTimerDef_t *)malloc(sizeof(osTimerDef_t));
|
||||
pTimerDef->ptimer = callback;
|
||||
pTimerDef->custom = (struct os_timer_custom *)malloc(sizeof(struct os_timer_custom));
|
||||
|
||||
return osTimerCreate(pTimerDef, (isPeriodic ? osTimerPeriodic : osTimerOnce), argument);
|
||||
}
|
||||
|
||||
uint32_t os_timer_start(uint32_t timer_id, uint32_t millisec) {
|
||||
return osTimerStart(timer_id, millisec);
|
||||
}
|
||||
|
||||
uint32_t os_timer_stop(uint32_t timer_id) {
|
||||
return osTimerStop(timer_id);
|
||||
}
|
||||
|
||||
uint32_t os_timer_delete(uint32_t timer_id) {
|
||||
|
||||
osTimerDef_t *pTimerDef;
|
||||
|
||||
pTimerDef = (osTimerDef_t *)pvTimerGetTimerID(timer_id);
|
||||
free(pTimerDef->custom);
|
||||
free(pTimerDef);
|
||||
|
||||
return osTimerDelete(timer_id);
|
||||
}
|
||||
|
||||
uint32_t os_semaphore_create(int32_t count) {
|
||||
return (uint32_t)osSemaphoreCreate(NULL, count);
|
||||
}
|
||||
|
||||
int32_t os_semaphore_wait(uint32_t semaphore_id, uint32_t millisec) {
|
||||
if (osSemaphoreWait((osSemaphoreId)semaphore_id, millisec) == 0) {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t os_semaphore_release(uint32_t semaphore_id) {
|
||||
return (uint32_t)osSemaphoreRelease((osSemaphoreId)semaphore_id);
|
||||
}
|
||||
|
||||
uint32_t os_semaphore_delete(uint32_t semaphore_id) {
|
||||
return (uint32_t)osSemaphoreDelete((osSemaphoreId)semaphore_id);
|
||||
}
|
||||
@@ -1,302 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
/**
|
||||
* @defgroup os_status os_status
|
||||
* Redefinition from enum osStatus
|
||||
* @{
|
||||
*/
|
||||
/** function completed; no error or event occurred. */
|
||||
#define OS_OK 0x00
|
||||
/** function completed; signal event occurred. */
|
||||
#define OS_EVENT_SIGNAL 0x08
|
||||
/** function completed; message event occurred. */
|
||||
#define OS_EVENT_MESSAGE 0x10
|
||||
/** function completed; mail event occurred. */
|
||||
#define OS_EVENT_MAIL 0x20
|
||||
/** function completed; timeout occurred. */
|
||||
#define OS_EVENT_TIMEOUT 0x40
|
||||
/** parameter error: a mandatory parameter was missing or specified an incorrect object. */
|
||||
#define OS_ERROR_PARAMETER 0x80
|
||||
/** resource not available: a specified resource was not available. */
|
||||
#define OS_ERROR_RESOURCE 0x81
|
||||
/** resource not available within given time: a specified resource was not available within the timeout period. */
|
||||
#define OS_ERROR_TIMEOUT_RESOURCE 0xC1
|
||||
/** not allowed in ISR context: the function cannot be called from interrupt service routines. */
|
||||
#define OS_ERROR_ISR 0x82
|
||||
/** function called multiple times from ISR with same object. */
|
||||
#define OS_ERROR_ISR_RECURSIVE 0x83
|
||||
/** system cannot determine priority or thread has illegal priority. */
|
||||
#define OS_ERROR_PRIORITY 0x84
|
||||
/** system is out of memory: it was impossible to allocate or reserve memory for the operation. */
|
||||
#define OS_ERROR_NO_MEMORY 0x85
|
||||
/** value of a parameter is out of range. */
|
||||
#define OS_ERROR_VALUE 0x86
|
||||
/** unspecified RTOS error: run-time error but no other error message fits. */
|
||||
#define OS_ERROR_OS 0xFF
|
||||
/** @} */ // end of group os_status
|
||||
|
||||
/**
|
||||
* @defgroup os_priority os_priority
|
||||
* Redefinition from enum osPriority
|
||||
* @{
|
||||
*/
|
||||
/** priority: idle (lowest) */
|
||||
#define OS_PRIORITY_IDLE (-3)
|
||||
/** priority: low */
|
||||
#define OS_PRIORITY_LOW (-2)
|
||||
/** priority: below normal */
|
||||
#define OS_PRIORITY_BELOW_NORMAL (-1)
|
||||
/** priority: normal (default) */
|
||||
#define OS_PRIORITY_NORMAL (0)
|
||||
/** priority: above normal */
|
||||
#define OS_PRIORITY_ABOVENORMAL (+1)
|
||||
/** priority: high */
|
||||
#define OS_PRIORITY_HIGH (+2)
|
||||
/** priority: realtime (highest) */
|
||||
#define OS_PRIORITY_REALTIME (+3)
|
||||
/** @} */ // end of group os_priority
|
||||
|
||||
#ifndef DEFAULT_STACK_SIZE
|
||||
/**
|
||||
* @ingroup wiring_os
|
||||
* @brief default stack size
|
||||
*
|
||||
* It is suggest that thread is assigned stack size more than DEFAULT_STACK_SIZE
|
||||
*/
|
||||
#define DEFAULT_STACK_SIZE 512
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @ingroup wiring_os
|
||||
* @struct os_event_t
|
||||
* Redefine osEvent in cmsis_os.h
|
||||
*/
|
||||
typedef struct {
|
||||
uint32_t status; ///< status code: event or error information
|
||||
|
||||
union {
|
||||
uint32_t v; ///< message as 32-bit value
|
||||
void *p; ///< message or mail as void pointer
|
||||
int32_t signals; ///< signal flags
|
||||
} value; ///< event value
|
||||
|
||||
union {
|
||||
void *mail_id; ///< mail id obtained by osMailCreate
|
||||
void *message_id; ///< message id obtained by osMessageCreate
|
||||
} def; ///< event definition
|
||||
} os_event_t;
|
||||
|
||||
/**
|
||||
* @defgroup thread_management thread_management
|
||||
* Thread management include create, get thread id, terminate, yield, and set/get priority
|
||||
**/
|
||||
|
||||
/**
|
||||
* @ingroup thread_management
|
||||
* @brief Create a thread and add it to Active Threads and set it to state READY.
|
||||
*
|
||||
* @param[in] task Function pointer which is the thread body. It should not run into the end of function unless
|
||||
* os_thread_terminate is invoked
|
||||
* @param[in] argument the data pointer which brings to task
|
||||
* @param[in] priority The underlying os is FreeRTOS. It executes tasks with highest priority which are not in idle
|
||||
* state.\n If there are more than 2 tasks to be executed, then they share the time slice.
|
||||
* @param[in] stack_size The stack_size is used as memory heap only for this task. \n
|
||||
* The local variables and call stacks would occupy this heap. Please make sure the the stack_size is big enough to
|
||||
* avoid curroption
|
||||
* @return The thread id which is used in thread operation and signaling.
|
||||
*/
|
||||
extern uint32_t os_thread_create(void (*task)(const void *argument), void *argument, int priority, uint32_t stack_size);
|
||||
|
||||
/**
|
||||
* @ingroup thread_management
|
||||
* @brief Return the thread ID of the current running thread.
|
||||
*
|
||||
* @return Current thread id which calls os_thread_get_id
|
||||
*/
|
||||
extern uint32_t os_thread_get_id(void);
|
||||
|
||||
/**
|
||||
* @ingroup thread_management
|
||||
* @brief Terminate execution of a thread and remove it from Active Threads.
|
||||
*
|
||||
* Thread should not ended without terminate first
|
||||
*
|
||||
* @param[in] thread_id Terminate the thread with specific thread_id
|
||||
* @return os_status code
|
||||
*/
|
||||
extern uint32_t os_thread_terminate(uint32_t thread_id);
|
||||
|
||||
/**
|
||||
* @ingroup thread_management
|
||||
* @brief Pass control to next thread that is in state \b READY.
|
||||
*
|
||||
* By default the minimal execution unit is 1 millisecond. In a scenario that if a thread with smaller want to handout
|
||||
* execution right to a thread with higher priority immediately without waiting for the ending of current 1 millisecond,
|
||||
* then invoke os_thread_yield can transfer exection right to OS's idle task and check which is the next execution
|
||||
* thread.
|
||||
*
|
||||
* @return os_status code
|
||||
*/
|
||||
extern uint32_t os_thread_yield(void);
|
||||
|
||||
/**
|
||||
* @ingroup thread_management
|
||||
* @brief Change priority of an active thread.
|
||||
*
|
||||
* @param[in] thread_id The target thread with the thread id to be changed
|
||||
* @param[in] priority The updated priority
|
||||
* @return os_status code
|
||||
*/
|
||||
extern uint32_t os_thread_set_priority(uint32_t thread_id, int priority);
|
||||
|
||||
/**
|
||||
* @ingroup thread_management
|
||||
* @brief Get current priority of an active thread.
|
||||
*
|
||||
* @param[in] thread_id The target thread with the thread id to be searched
|
||||
* @return os_priority
|
||||
*/
|
||||
extern int os_thread_get_priority(uint32_t thread_id);
|
||||
|
||||
/**
|
||||
* @defgroup signal_management signal_management
|
||||
* Signaling between threads include set, clear, and wait
|
||||
*/
|
||||
|
||||
/**
|
||||
* @ingroup signal_management
|
||||
* @brief Set the specified Signal Flags of an active thread.
|
||||
*
|
||||
* @param[in] thread_id Send signal to a thread with the thread id
|
||||
* @param[in] signals the signals to be send
|
||||
* @return os_status code
|
||||
*/
|
||||
extern int32_t os_signal_set(uint32_t thread_id, int32_t signals);
|
||||
|
||||
/**
|
||||
* @ingroup signal_management
|
||||
* @brief Clear the specified Signal Flags of an active thread.
|
||||
*
|
||||
* @param[in] thread_id Clear signal to a thread with the thread id
|
||||
* @param[in] signals The signals to be clear
|
||||
* @return os_status code
|
||||
*/
|
||||
extern int32_t os_signal_clear(uint32_t thread_id, int32_t signals);
|
||||
|
||||
/**
|
||||
* @ingroup signal_management
|
||||
* @brief Wait for one or more Signal Flags to become signaled for the current \b RUNNING thread.
|
||||
*
|
||||
* @param[in] signals the signals to be wait
|
||||
* @param[in] millisec the timeout value if no signal comes in. Fill in 0xFFFFFFFF for infinite wait.
|
||||
* @return os_status code
|
||||
*/
|
||||
extern os_event_t os_signal_wait(int32_t signals, uint32_t millisec);
|
||||
|
||||
/**
|
||||
* @defgroup timer_management timer_management
|
||||
* Software timer management include create, start, stop, delete.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @ingroup timer_management
|
||||
* @brief specify timer type that invoke only once
|
||||
*/
|
||||
#define OS_TIMER_ONCE (0)
|
||||
|
||||
/**
|
||||
* @ingroup timer_management
|
||||
* @brief specify timer type that invoke periodically
|
||||
*/
|
||||
#define OS_TIMER_PERIODIC (1)
|
||||
|
||||
/**
|
||||
* @ingroup timer_management
|
||||
* @brief Create a timer.
|
||||
*
|
||||
* @param[in] callback The function to be invoke when timer timeout
|
||||
* @param[in] isPeriodic \b OS_TIMER_ONCE or \b OS_TIMER_PERIODIC
|
||||
* @param[in] argument The argument that is bring into callback function
|
||||
* @return timer id
|
||||
*/
|
||||
extern uint32_t os_timer_create(void (*callback)(const void *argument), uint8_t isPeriodic, void *argument);
|
||||
|
||||
/**
|
||||
* @ingroup timer_management
|
||||
* @brief Start or restart a timer.
|
||||
*
|
||||
* @param[in] timer_id The timer id obtained from by os_timer_create
|
||||
* @param[in] millisec The delays after timer starts
|
||||
* @return os_status code
|
||||
*/
|
||||
extern uint32_t os_timer_start(uint32_t timer_id, uint32_t millisec);
|
||||
|
||||
/**
|
||||
* @ingroup timer_management
|
||||
* @brief Stop the timer.
|
||||
*
|
||||
* @param[in] timer_id The timer id obtained from by os_timer_create
|
||||
* @return os_status code
|
||||
*/
|
||||
extern uint32_t os_timer_stop(uint32_t timer_id);
|
||||
|
||||
/**
|
||||
* @ingroup timer_management
|
||||
* @brief Delete a timer that was created by os_timer_create
|
||||
*
|
||||
* @param[in] timer_id The timer id obtained from by os_timer_create
|
||||
* @return os_status code
|
||||
*/
|
||||
extern uint32_t os_timer_delete(uint32_t timer_id);
|
||||
|
||||
/**
|
||||
* @defgroup semaphore_management semaphore_management
|
||||
* Semaphore API between threads include create, wait, release, delete.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @ingroup semaphore_management
|
||||
* @brief Create and Initialize a Semaphore object used for managing resources
|
||||
*
|
||||
* @param[in] count The number of available resources
|
||||
* @return semaphore ID
|
||||
*/
|
||||
extern uint32_t os_semaphore_create(int32_t count);
|
||||
|
||||
/**
|
||||
* @ingroup semaphore_management
|
||||
* @brief Wait until a Semaphore token becomes available
|
||||
*
|
||||
* @param[in] semaphore_id semaphore id obtained from os_semaphore_create
|
||||
* @param[in] millisec timeout value
|
||||
* @return os_status code
|
||||
*/
|
||||
extern int32_t os_semaphore_wait(uint32_t semaphore_id, uint32_t millisec);
|
||||
|
||||
/**
|
||||
* @ingroup semaphore_management
|
||||
* @brief Release a Semaphore token
|
||||
*
|
||||
* @param[in] semaphore_id semaphore id obtained from os_semaphore_create
|
||||
* @return os_status code
|
||||
*/
|
||||
extern uint32_t os_semaphore_release(uint32_t semaphore_id);
|
||||
|
||||
/**
|
||||
* @ingroup semaphore_management
|
||||
* @brief Delete a Semaphore that was created by os_semaphore_create.
|
||||
*
|
||||
* @param[in] semaphore_id semaphore id obtained from os_semaphore_create
|
||||
* @return os_status code
|
||||
*/
|
||||
extern uint32_t os_semaphore_delete(uint32_t semaphore_id);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -1,95 +0,0 @@
|
||||
/*
|
||||
Copyright (c) 2011 Arduino. All right reserved.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include <Arduino.h>
|
||||
#include <cmsis_os.h>
|
||||
|
||||
#ifndef portNVIC_SYSTICK_CURRENT_VALUE_REG
|
||||
#define portNVIC_SYSTICK_CURRENT_VALUE_REG (*((volatile uint32_t *)0xe000e018))
|
||||
#endif
|
||||
|
||||
extern uint32_t xTaskGetTickCount();
|
||||
extern uint32_t xTaskGetTickCountFromISR();
|
||||
|
||||
static __inline uint32_t __get_ipsr__(void) {
|
||||
volatile uint32_t __regIPSR __asm("ipsr");
|
||||
return (__regIPSR);
|
||||
}
|
||||
|
||||
void init(void) {
|
||||
// nop
|
||||
}
|
||||
|
||||
void delay(uint32_t ms) {
|
||||
/* osStatus ret; */
|
||||
|
||||
/* ret = */ osDelay(ms);
|
||||
/* if ((ret != osEventTimeout) && (ret != osOK)) {
|
||||
printf("delay : ERROR : 0x%x \n", ret);
|
||||
} */
|
||||
}
|
||||
|
||||
void delayMicroseconds(unsigned int us) {
|
||||
int i;
|
||||
uint32_t t0, tn;
|
||||
int dfactor = 20 * us - 10 + (81 * us / 100);
|
||||
|
||||
if (us > 100) {
|
||||
t0 = micros();
|
||||
do {
|
||||
tn = micros();
|
||||
} while (tn >= t0 && tn < (t0 + us - 1));
|
||||
} else {
|
||||
for (i = 0; i < dfactor; i++) {
|
||||
asm("nop");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t millis(void) {
|
||||
return (__get_ipsr__() == 0) ? xTaskGetTickCount() : xTaskGetTickCountFromISR();
|
||||
}
|
||||
|
||||
uint32_t micros(void) {
|
||||
uint32_t tick1, tick2;
|
||||
uint32_t us;
|
||||
uint32_t tick_per_us = 166666;
|
||||
|
||||
if (__get_ipsr__() == 0) {
|
||||
tick1 = xTaskGetTickCount();
|
||||
us = portNVIC_SYSTICK_CURRENT_VALUE_REG;
|
||||
tick2 = xTaskGetTickCount();
|
||||
} else {
|
||||
tick1 = xTaskGetTickCountFromISR();
|
||||
us = portNVIC_SYSTICK_CURRENT_VALUE_REG;
|
||||
tick2 = xTaskGetTickCountFromISR();
|
||||
}
|
||||
|
||||
if (tick1 == tick2) {
|
||||
return tick1 * 1000 - us * 1000 / tick_per_us;
|
||||
} else if ((us * 1000 / tick_per_us) < 500) {
|
||||
return tick1 * 1000 - us * 1000 / tick_per_us;
|
||||
} else {
|
||||
return tick1 * 1000;
|
||||
}
|
||||
}
|
||||
|
||||
void yield(void) {
|
||||
vTaskDelay(1);
|
||||
taskYIELD();
|
||||
}
|
||||
@@ -1,205 +0,0 @@
|
||||
/*
|
||||
Copyright (c) 2011 Arduino. All right reserved.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include <Arduino.h>
|
||||
#include <analogin_api.h>
|
||||
#include <analogout_api.h>
|
||||
#include <gpio_ex_api.h>
|
||||
#include <pwmout_api.h>
|
||||
|
||||
/* ADC */
|
||||
analogin_t adc1;
|
||||
analogin_t adc2;
|
||||
analogin_t adc3;
|
||||
|
||||
static const float ADC_slope1 = (3.12) / (3410.0 - 674.0);
|
||||
static const float ADC_slope2 = (3.3 - 3.12) / (3454.0 - 3410.0);
|
||||
|
||||
bool g_adc_enabled[] = {false, false, false};
|
||||
|
||||
extern void *gpio_pin_struct[];
|
||||
|
||||
extern void pinRemoveMode(pin_size_t pinNumber);
|
||||
|
||||
static int _readResolution = 10;
|
||||
static int _writeResolution = 8;
|
||||
static int _writePeriod = 20000;
|
||||
|
||||
void analogReadResolution(int res) {
|
||||
_readResolution = res;
|
||||
}
|
||||
|
||||
void analogWriteResolution(int res) {
|
||||
_writeResolution = res;
|
||||
}
|
||||
|
||||
void analogWritePeriod(int us) {
|
||||
_writePeriod = us;
|
||||
}
|
||||
|
||||
static inline uint32_t mapResolution(uint32_t value, uint32_t from, uint32_t to) {
|
||||
if (from == to)
|
||||
return value;
|
||||
if (from > to)
|
||||
return value >> (from - to);
|
||||
else
|
||||
return value << (to - from);
|
||||
}
|
||||
|
||||
uint8_t analog_reference = AR_DEFAULT;
|
||||
|
||||
void analogReference(uint8_t mode) {
|
||||
analog_reference = mode;
|
||||
}
|
||||
|
||||
int analogRead(pin_size_t pinNumber) {
|
||||
uint32_t ulValue = 0;
|
||||
uint32_t ulChannel;
|
||||
uint16_t ret = 0;
|
||||
float voltage;
|
||||
float adc_value;
|
||||
|
||||
switch (pinNumber) {
|
||||
case PIN_A0:
|
||||
if (g_adc_enabled[0] == false) {
|
||||
analogin_init(&adc1, AD_1);
|
||||
g_adc_enabled[0] = true;
|
||||
}
|
||||
case PIN_A1:
|
||||
if (g_adc_enabled[1] == false) {
|
||||
analogin_init(&adc2, AD_2);
|
||||
g_adc_enabled[1] = true;
|
||||
}
|
||||
ret = analogin_read_u16(&adc2);
|
||||
break;
|
||||
case PIN_A2:
|
||||
if (g_adc_enabled[2] == false) {
|
||||
analogin_init(&adc3, AD_3);
|
||||
g_adc_enabled[2] = true;
|
||||
}
|
||||
ret = analogin_read_u16(&adc3);
|
||||
break;
|
||||
default:
|
||||
printf("%s : pinNumber %d wrong\n", __FUNCTION__, pinNumber);
|
||||
return 0;
|
||||
}
|
||||
|
||||
ret >>= 4;
|
||||
if (ret < 674) {
|
||||
voltage = 0;
|
||||
} else if (ret > 3410) {
|
||||
voltage = (float)(ret - 3410) * ADC_slope2 + 3.12;
|
||||
} else {
|
||||
voltage = (float)(ret - 674) * ADC_slope1;
|
||||
}
|
||||
|
||||
ret = round((1 << _readResolution) * voltage / 3.3);
|
||||
if (ret >= (1 << _readResolution))
|
||||
ret = (1 << _readResolution) - 1;
|
||||
return ret;
|
||||
}
|
||||
|
||||
void analogOutputInit(void) {
|
||||
// nop
|
||||
}
|
||||
|
||||
// Right now, PWM output only works on the pins with
|
||||
// hardware support. These are defined in the appropriate
|
||||
// pins_*.c file. For the rest of the pins, we default
|
||||
// to digital output.
|
||||
void analogWrite(pin_size_t pinNumber, int value) {
|
||||
pwmout_t *obj;
|
||||
|
||||
if ((g_APinDescription[pinNumber].ulPinAttribute & PIO_PWM) == PIO_PWM) {
|
||||
/* Handle */
|
||||
if (g_APinDescription[pinNumber].ulPinType != PIO_PWM) {
|
||||
if ((g_APinDescription[pinNumber].ulPinType == PIO_GPIO) ||
|
||||
(g_APinDescription[pinNumber].ulPinType == PIO_GPIO_IRQ)) {
|
||||
pinRemoveMode(pinNumber);
|
||||
}
|
||||
gpio_pin_struct[pinNumber] = malloc(sizeof(pwmout_t));
|
||||
pwmout_t *obj = (pwmout_t *)gpio_pin_struct[pinNumber];
|
||||
pwmout_init(obj, g_APinDescription[pinNumber].pinname);
|
||||
pwmout_period_us(obj, _writePeriod);
|
||||
pwmout_write(obj, value * 1.0 / (1 << _writeResolution));
|
||||
g_APinDescription[pinNumber].ulPinType = PIO_PWM;
|
||||
g_APinDescription[pinNumber].ulPinMode = PWM_MODE_ENABLED;
|
||||
} else {
|
||||
pwmout_t *obj = (pwmout_t *)gpio_pin_struct[pinNumber];
|
||||
pwmout_period_us(obj, _writePeriod);
|
||||
pwmout_write(obj, value * 1.0 / (1 << _writeResolution));
|
||||
/* if ( g_APinDescription[pinNumber].ulPinMode == PWM_MODE_DISABLED ) {
|
||||
HAL_Pwm_Enable( &obj->pwm_hal_adp );
|
||||
} */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
typedef struct _tone_argument {
|
||||
uint32_t ulPin;
|
||||
uint32_t timer_id;
|
||||
};
|
||||
|
||||
void _tone_timer_handler(const void *argument) {
|
||||
struct _tone_argument *arg = (struct _tone_argument *)argument;
|
||||
|
||||
uint32_t ulPin = (uint32_t)argument;
|
||||
|
||||
noTone(arg->ulPin);
|
||||
|
||||
os_timer_delete(arg->timer_id);
|
||||
|
||||
free((struct _tone_argument *)arg);
|
||||
}
|
||||
|
||||
void _tone(uint32_t ulPin, unsigned int frequency, unsigned long duration) {
|
||||
pwmout_t *obj;
|
||||
|
||||
if ((g_APinDescription[ulPin].ulPinAttribute & PIO_PWM) != PIO_PWM) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (g_APinDescription[ulPin].ulPinType != PIO_PWM) {
|
||||
if ((g_APinDescription[ulPin].ulPinType == PIO_GPIO) || (g_APinDescription[ulPin].ulPinType == PIO_GPIO_IRQ)) {
|
||||
pinRemoveMode(ulPin);
|
||||
}
|
||||
gpio_pin_struct[ulPin] = malloc(sizeof(pwmout_t));
|
||||
pwmout_t *obj = (pwmout_t *)gpio_pin_struct[ulPin];
|
||||
pwmout_init(obj, g_APinDescription[ulPin].pinname);
|
||||
pwmout_period(obj, 1.0 / frequency);
|
||||
pwmout_pulsewidth(obj, 1.0 / (frequency * 2));
|
||||
g_APinDescription[ulPin].ulPinType = PIO_PWM;
|
||||
g_APinDescription[ulPin].ulPinMode = PWM_MODE_ENABLED;
|
||||
|
||||
} else {
|
||||
// There is already a PWM configured
|
||||
pwmout_t *obj = (pwmout_t *)gpio_pin_struct[ulPin];
|
||||
pwmout_period(obj, 1.0 / frequency);
|
||||
pwmout_pulsewidth(obj, 1.0 / (frequency * 2));
|
||||
/* if (g_APinDescription[ulPin].ulPinMode == PWM_MODE_DISABLED) {
|
||||
HAL_Pwm_Enable( &obj->pwm_hal_adp );
|
||||
} */
|
||||
}
|
||||
|
||||
if (duration > 0) {
|
||||
struct _tone_argument *arg = (struct _tone_argument *)malloc(sizeof(struct _tone_argument));
|
||||
arg->ulPin = ulPin;
|
||||
arg->timer_id = os_timer_create(_tone_timer_handler, 0, arg);
|
||||
os_timer_start(arg->timer_id, duration);
|
||||
}
|
||||
}
|
||||
@@ -1,135 +0,0 @@
|
||||
#include <Arduino.h>
|
||||
#include <gpio_api.h>
|
||||
#include <gpio_irq_api.h>
|
||||
#include <gpio_irq_ex_api.h>
|
||||
#include <pwmout_api.h>
|
||||
|
||||
extern void *gpio_pin_struct[PINS_COUNT];
|
||||
extern void *gpio_irq_handler_list[PINS_COUNT];
|
||||
|
||||
bool pinInvalid(pin_size_t pinNumber) {
|
||||
return pinNumber < 0 || pinNumber >= PINS_COUNT || g_APinDescription[pinNumber].pinname == NC;
|
||||
}
|
||||
|
||||
void pinRemoveMode(pin_size_t pinNumber) {
|
||||
if (pinInvalid(pinNumber))
|
||||
return;
|
||||
if (g_APinDescription[pinNumber].ulPinType == PIO_PWM) {
|
||||
pwmout_t *obj = (pwmout_t *)gpio_pin_struct[pinNumber];
|
||||
pwmout_free(obj);
|
||||
}
|
||||
if (g_APinDescription[pinNumber].ulPinType == PIO_GPIO) {
|
||||
gpio_t *obj = (gpio_t *)gpio_pin_struct[pinNumber];
|
||||
gpio_deinit(obj, g_APinDescription[pinNumber].pinname);
|
||||
free(obj);
|
||||
}
|
||||
if (g_APinDescription[pinNumber].ulPinType == PIO_GPIO_IRQ) {
|
||||
gpio_irq_t *obj = (gpio_irq_t *)gpio_pin_struct[pinNumber];
|
||||
gpio_irq_deinit(obj);
|
||||
free(obj);
|
||||
}
|
||||
gpio_pin_struct[pinNumber] = NULL;
|
||||
g_APinDescription[pinNumber].ulPinType = NOT_INITIAL;
|
||||
g_APinDescription[pinNumber].ulPinMode = NOT_INITIAL;
|
||||
}
|
||||
|
||||
void pinMode(pin_size_t pinNumber, PinModeArduino pinMode) {
|
||||
if (pinInvalid(pinNumber))
|
||||
return;
|
||||
|
||||
if (g_APinDescription[pinNumber].ulPinType == PIO_GPIO && g_APinDescription[pinNumber].ulPinMode == pinMode)
|
||||
// Nothing changes in pin mode
|
||||
return;
|
||||
|
||||
/* if (g_APinDescription[pinNumber].ulPinType == PIO_PWM) {
|
||||
// If this pin has been configured as PWM, then it cannot change to another mode
|
||||
return;
|
||||
} */
|
||||
|
||||
if (g_APinDescription[pinNumber].ulPinType != PIO_GPIO)
|
||||
// pin mode changes; deinit gpio and free memory
|
||||
pinRemoveMode(pinNumber);
|
||||
|
||||
gpio_t *gpio;
|
||||
|
||||
if (g_APinDescription[pinNumber].ulPinType == NOT_INITIAL) {
|
||||
// allocate memory if pin not used before
|
||||
gpio = malloc(sizeof(gpio_t));
|
||||
gpio_pin_struct[pinNumber] = gpio;
|
||||
gpio_init(gpio, g_APinDescription[pinNumber].pinname);
|
||||
g_APinDescription[pinNumber].ulPinType = PIO_GPIO;
|
||||
} else {
|
||||
// pin already used as gpio
|
||||
gpio = (gpio_t *)gpio_pin_struct[pinNumber];
|
||||
}
|
||||
g_APinDescription[pinNumber].ulPinMode = pinMode;
|
||||
|
||||
PinDirection dir;
|
||||
PinMode mode;
|
||||
|
||||
switch (pinMode) {
|
||||
case INPUT:
|
||||
dir = PIN_INPUT;
|
||||
mode = PullNone;
|
||||
break;
|
||||
case INPUT_PULLDOWN:
|
||||
dir = PIN_INPUT;
|
||||
mode = PullDown;
|
||||
break;
|
||||
case INPUT_PULLUP:
|
||||
dir = PIN_INPUT;
|
||||
mode = PullUp;
|
||||
break;
|
||||
case OUTPUT:
|
||||
dir = PIN_OUTPUT;
|
||||
mode = PullNone;
|
||||
break;
|
||||
case OUTPUT_OPENDRAIN:
|
||||
dir = PIN_OUTPUT;
|
||||
mode = OpenDrain;
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
gpio_dir(gpio, dir);
|
||||
gpio_mode(gpio, mode);
|
||||
}
|
||||
|
||||
void digitalWrite(pin_size_t pinNumber, PinStatus status) {
|
||||
if (pinInvalid(pinNumber))
|
||||
return;
|
||||
if (g_APinDescription[pinNumber].ulPinType != PIO_GPIO)
|
||||
return;
|
||||
|
||||
gpio_t *gpio = (gpio_t *)gpio_pin_struct[pinNumber];
|
||||
gpio_write(gpio, status);
|
||||
}
|
||||
|
||||
PinStatus digitalRead(pin_size_t pinNumber) {
|
||||
if (pinInvalid(pinNumber))
|
||||
return;
|
||||
if (g_APinDescription[pinNumber].ulPinType != PIO_GPIO)
|
||||
return;
|
||||
|
||||
gpio_t *gpio = (gpio_t *)gpio_pin_struct[pinNumber];
|
||||
return gpio_read(gpio);
|
||||
}
|
||||
|
||||
/**************************** Extend API by RTK ***********************************/
|
||||
|
||||
uint32_t digitalPinToPort(uint32_t pinNumber) {
|
||||
if (pinInvalid(pinNumber))
|
||||
return 0xFFFFFFFF;
|
||||
|
||||
uint32_t pin_name = HAL_GPIO_GetPinName(g_APinDescription[pinNumber].pinname);
|
||||
return HAL_GPIO_GET_PORT_BY_NAME(pin_name);
|
||||
}
|
||||
|
||||
uint32_t digitalPinToBitMask(uint32_t pinNumber) {
|
||||
if (pinInvalid(pinNumber))
|
||||
return 0xFFFFFFFF;
|
||||
|
||||
uint32_t pin_name = HAL_GPIO_GetPinName(g_APinDescription[pinNumber].pinname);
|
||||
return 1 << (HAL_GPIO_GET_PIN_BY_NAME(pin_name));
|
||||
}
|
||||
@@ -1,71 +0,0 @@
|
||||
/* Copyright (c) Kuba Szczodrzyński 2022-04-24. */
|
||||
|
||||
#include "Flash.h"
|
||||
|
||||
#include <Arduino.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif // __cplusplus
|
||||
|
||||
#include <flash_api.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
FlashClass::FlashClass() {
|
||||
flash = NULL;
|
||||
}
|
||||
|
||||
FlashClass::~FlashClass() {
|
||||
if (!flash)
|
||||
return;
|
||||
free(flash);
|
||||
flash = NULL;
|
||||
}
|
||||
|
||||
void FlashClass::initialize() {
|
||||
if (flash)
|
||||
return;
|
||||
flash = (flash_t *)malloc(sizeof(flash_t));
|
||||
flash_get_status(flash);
|
||||
}
|
||||
|
||||
FlashId FlashClass::getChipId() {
|
||||
initialize();
|
||||
FlashId id;
|
||||
uint8_t idBytes[3];
|
||||
flash_read_id(flash, idBytes, 3);
|
||||
id.manufacturerId = idBytes[0];
|
||||
id.chipId = idBytes[1];
|
||||
id.chipSizeId = idBytes[2];
|
||||
return id;
|
||||
}
|
||||
|
||||
uint32_t FlashClass::getSize() {
|
||||
initialize();
|
||||
FlashId id = getChipId();
|
||||
if (id.chipSizeId >= 0x14 && id.chipSizeId <= 0x19) {
|
||||
return (1 << id.chipSizeId);
|
||||
}
|
||||
return 1024 * 1024;
|
||||
}
|
||||
|
||||
bool FlashClass::eraseSector(uint32_t offset) {
|
||||
initialize();
|
||||
flash_erase_sector(flash, offset);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool FlashClass::readBlock(uint32_t offset, uint8_t *data, size_t size) {
|
||||
initialize();
|
||||
return flash_stream_read(flash, offset, size, data);
|
||||
}
|
||||
|
||||
bool FlashClass::writeBlock(uint32_t offset, uint8_t *data, size_t size) {
|
||||
initialize();
|
||||
return flash_stream_write(flash, offset, size, data);
|
||||
}
|
||||
|
||||
FlashClass Flash;
|
||||
@@ -1,27 +0,0 @@
|
||||
/* Copyright (c) Kuba Szczodrzyński 2022-04-24. */
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "api/Flash.h"
|
||||
|
||||
struct flash_s;
|
||||
typedef struct flash_s flash_t;
|
||||
|
||||
class FlashClass : public IFlashClass {
|
||||
private:
|
||||
flash_t *flash;
|
||||
void initialize();
|
||||
|
||||
public:
|
||||
FlashClass();
|
||||
~FlashClass();
|
||||
|
||||
FlashId getChipId();
|
||||
uint32_t getSize();
|
||||
|
||||
bool eraseSector(uint32_t offset);
|
||||
bool readBlock(uint32_t offset, uint8_t *data, size_t size);
|
||||
bool writeBlock(uint32_t offset, uint8_t *data, size_t size);
|
||||
};
|
||||
|
||||
extern FlashClass Flash;
|
||||
@@ -1,58 +0,0 @@
|
||||
#include "PowerManagement.h"
|
||||
|
||||
#include <Arduino.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#include <freertos_pmu.h>
|
||||
#include <sleep_ex_api.h>
|
||||
#include <sys_api.h>
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(BOARD_RTL8195A)
|
||||
#define SAVE_LOCK_PIN 18
|
||||
#elif defined(BOARD_RTL8710)
|
||||
#define SAVE_LOCK_PIN 7 // PB_1
|
||||
#else
|
||||
#define SAVE_LOCK_PIN 18
|
||||
#endif
|
||||
|
||||
bool PowerManagementClass::reservePLL = true;
|
||||
|
||||
void PowerManagementClass::sleep(uint32_t bitflg) {
|
||||
if (!safeLock()) {
|
||||
pmu_release_wakelock(bitflg);
|
||||
}
|
||||
}
|
||||
|
||||
void PowerManagementClass::sleep(void) {
|
||||
if (!safeLock()) {
|
||||
pmu_release_wakelock(BIT(PMU_OS));
|
||||
}
|
||||
}
|
||||
|
||||
void PowerManagementClass::active(uint32_t bitflg) {
|
||||
pmu_acquire_wakelock(bitflg);
|
||||
}
|
||||
|
||||
void PowerManagementClass::active(void) {
|
||||
pmu_acquire_wakelock(BIT(PMU_OS));
|
||||
}
|
||||
|
||||
void PowerManagementClass::deepsleep(uint32_t duration_ms) {
|
||||
if (!safeLock()) {
|
||||
deepsleep_ex(DSLEEP_WAKEUP_BY_TIMER, duration_ms);
|
||||
}
|
||||
}
|
||||
|
||||
bool PowerManagementClass::safeLock() {
|
||||
pinMode(SAVE_LOCK_PIN, INPUT_PULLUP);
|
||||
return (digitalRead(SAVE_LOCK_PIN) == 1) ? false : true;
|
||||
}
|
||||
|
||||
void PowerManagementClass::softReset() {
|
||||
sys_reset();
|
||||
}
|
||||
|
||||
PowerManagementClass PowerManagement;
|
||||
@@ -1,73 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <inttypes.h>
|
||||
|
||||
/**
|
||||
* @class PowerManagementClass PowerManagement.h
|
||||
* @brief Power management in Ameba
|
||||
*/
|
||||
class PowerManagementClass {
|
||||
public:
|
||||
/**
|
||||
* @brief Allow OS automatically save power while idle
|
||||
*
|
||||
* As OS consider it would idle for more than 2s, it will invoke system suspend.
|
||||
* If wlan is associated with AP, than it will under asslociated idle state.
|
||||
*/
|
||||
static void sleep(void);
|
||||
static void sleep(uint32_t bitflg);
|
||||
|
||||
/**
|
||||
* @brief Disallow OS automatically save power while idle
|
||||
*/
|
||||
static void active(void);
|
||||
static void active(uint32_t bitflg);
|
||||
|
||||
/**
|
||||
* @brief Reserved PLL while sleep
|
||||
*
|
||||
* Reserve PLL would keep FIFO of peripherals (Ex. UART) but cost more power (around 5mA).
|
||||
* If we don't reserve PLL, it saves more power but we might missing data because FIFO is turned of this way.
|
||||
*
|
||||
* @param[in] reserve true for reserved, false for non-reserved
|
||||
*/
|
||||
static void setPllReserved(bool reserve);
|
||||
|
||||
/**
|
||||
* @brief Enter deepsleep immediately
|
||||
*
|
||||
* Invoke deepsleep would make system enter deepsleep state immediately.
|
||||
* It's the state that saves most power.
|
||||
* As it wakeup from deepsleep, the system would behave just like reboot.
|
||||
*
|
||||
* @param[in] duration_ms wakeup after specific time in unit of millisecond
|
||||
*/
|
||||
static void deepsleep(uint32_t duration_ms);
|
||||
|
||||
/**
|
||||
* @brief Check if system is allowed enter any power save state
|
||||
*
|
||||
* The pin 18 (GPIOE_5) is designed as safe lock.
|
||||
* If pin 18 is HIGH, then we prevent Ameba enter any power save state.\n\n
|
||||
* Under any power save state, we are not able to flash image to Ameba.
|
||||
* Thus if user misuse deepsleep and make Ameba enter deepsleep immediately after boot up,
|
||||
* then he would find it's hard to flash image.
|
||||
* In this case, he can pull up pin 18.
|
||||
*
|
||||
* @return true if system not allowed enter any power save state, and false vise versa
|
||||
*/
|
||||
static bool safeLock();
|
||||
|
||||
/**
|
||||
* @brief Reboot system
|
||||
*
|
||||
* Reboot system in soft way. Some registers is not powered off in this case, but mostly we could regard this as
|
||||
* reboot.
|
||||
*/
|
||||
static void softReset();
|
||||
|
||||
private:
|
||||
static bool reservePLL;
|
||||
};
|
||||
|
||||
extern PowerManagementClass PowerManagement;
|
||||
@@ -1,96 +0,0 @@
|
||||
/* Copyright (c) Kuba Szczodrzyński 2022-04-25. */
|
||||
|
||||
#include "WiFi.h"
|
||||
#include "WiFiPriv.h"
|
||||
|
||||
rtw_network_info_t wifi = {0};
|
||||
rtw_ap_info_t ap = {0};
|
||||
rtw_wifi_setting_t wifi_setting;
|
||||
unsigned char sta_password[65] = {0};
|
||||
unsigned char ap_password[65] = {0};
|
||||
|
||||
void reset_wifi_struct(void) {
|
||||
memset(wifi.ssid.val, 0, sizeof(wifi.ssid.val));
|
||||
memset(wifi.bssid.octet, 0, ETH_ALEN);
|
||||
memset(sta_password, 0, sizeof(sta_password));
|
||||
memset(ap_password, 0, sizeof(ap_password));
|
||||
wifi.ssid.len = 0;
|
||||
wifi.password = NULL;
|
||||
wifi.password_len = 0;
|
||||
wifi.key_id = -1;
|
||||
memset(ap.ssid.val, 0, sizeof(ap.ssid.val));
|
||||
ap.ssid.len = 0;
|
||||
ap.password = NULL;
|
||||
ap.password_len = 0;
|
||||
ap.channel = 1;
|
||||
}
|
||||
|
||||
WiFiClass::WiFiClass() {
|
||||
_scanSem = xSemaphoreCreateBinary();
|
||||
}
|
||||
|
||||
WiFiClass::~WiFiClass() {
|
||||
vSemaphoreDelete(_scanSem);
|
||||
}
|
||||
|
||||
void WiFiClass::printDiag(Print &dest) {
|
||||
const char *modes[] = {"NULL", "STA", "AP", "STA+AP"};
|
||||
const char *enc[] = {"Open", "WEP", "WPA PSK", "WPA2 PSK", "WPA/WPA2", "WPA", "WPA2"};
|
||||
|
||||
dest.print("Mode: ");
|
||||
dest.println(modes[getMode()]);
|
||||
|
||||
if (wifi_mode & WIFI_MODE_STA) {
|
||||
dest.println("-- Station --");
|
||||
dest.print("SSID: ");
|
||||
dest.println(SSID());
|
||||
if (isConnected()) {
|
||||
dest.print("BSSID: ");
|
||||
dest.println(BSSIDstr());
|
||||
dest.print("RSSI: ");
|
||||
dest.println(RSSI());
|
||||
dest.print("Encryption: ");
|
||||
dest.println(enc[getEncryption()]);
|
||||
dest.print("IP: ");
|
||||
dest.println(localIP());
|
||||
dest.print("MAC: ");
|
||||
dest.println(macAddress());
|
||||
dest.print("Hostname: ");
|
||||
dest.println(getHostname());
|
||||
}
|
||||
}
|
||||
|
||||
if (wifi_mode & WIFI_MODE_AP) {
|
||||
dest.println("-- Access Point --");
|
||||
dest.print("SSID: ");
|
||||
dest.println(softAPSSID());
|
||||
dest.print("IP: ");
|
||||
dest.println(softAPIP());
|
||||
dest.print("MAC: ");
|
||||
dest.println(softAPmacAddress());
|
||||
dest.print("Hostname: ");
|
||||
dest.println(softAPgetHostname());
|
||||
}
|
||||
}
|
||||
|
||||
WiFiAuthMode WiFiClass::securityTypeToAuthMode(uint8_t type) {
|
||||
switch (wifi_setting.security_type) {
|
||||
case RTW_SECURITY_OPEN:
|
||||
return WIFI_AUTH_OPEN;
|
||||
case RTW_SECURITY_WEP_SHARED:
|
||||
return WIFI_AUTH_WEP;
|
||||
case RTW_SECURITY_WPA_TKIP_PSK:
|
||||
return WIFI_AUTH_WPA_PSK;
|
||||
case RTW_SECURITY_WPA_AES_PSK:
|
||||
return WIFI_AUTH_WPA;
|
||||
case RTW_SECURITY_WPA2_TKIP_PSK:
|
||||
return WIFI_AUTH_WPA2_PSK;
|
||||
case RTW_SECURITY_WPA2_AES_PSK:
|
||||
return WIFI_AUTH_WPA2;
|
||||
case RTW_SECURITY_WPA_WPA2_MIXED:
|
||||
return WIFI_AUTH_WPA_WPA2_PSK;
|
||||
}
|
||||
return WIFI_AUTH_INVALID;
|
||||
}
|
||||
|
||||
WiFiClass WiFi;
|
||||
@@ -1,182 +0,0 @@
|
||||
/* Copyright (c) Kuba Szczodrzyński 2022-04-25. */
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <Arduino.h>
|
||||
#include <api/WiFi.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif // __cplusplus
|
||||
|
||||
#include <FreeRTOS.h>
|
||||
#include <semphr.h>
|
||||
#include <wifi_structures.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
#include "WiFiClient.h"
|
||||
#include "WiFiServer.h"
|
||||
|
||||
class WiFiClass : public IWiFiClass,
|
||||
public IWiFiGenericClass,
|
||||
public IWiFiSTAClass,
|
||||
public IWiFiScanClass,
|
||||
public IWiFiAPClass {
|
||||
private:
|
||||
static WiFiAuthMode securityTypeToAuthMode(uint8_t type);
|
||||
|
||||
bool _initialized;
|
||||
bool _sleep;
|
||||
|
||||
bool _scanning = false;
|
||||
SemaphoreHandle_t _scanSem;
|
||||
uint8_t _netCount = 0;
|
||||
char **_netSsid = NULL;
|
||||
WiFiAuthMode *_netEncr = NULL;
|
||||
int32_t *_netRssi = NULL;
|
||||
rtw_mac_t *_netBssid = NULL;
|
||||
int32_t *_netChannel = NULL;
|
||||
|
||||
static rtw_result_t scanHandler(rtw_scan_handler_result_t *result);
|
||||
|
||||
public:
|
||||
// IWiFiClass
|
||||
WiFiClass();
|
||||
~WiFiClass();
|
||||
void printDiag(Print &dest);
|
||||
|
||||
public:
|
||||
// IWiFiGenericClass
|
||||
int32_t channel(void);
|
||||
|
||||
bool mode(WiFiMode mode) override;
|
||||
WiFiMode getMode();
|
||||
WiFiStatus status();
|
||||
|
||||
bool enableSTA(bool enable);
|
||||
bool enableAP(bool enable);
|
||||
|
||||
bool setSleep(bool enable);
|
||||
bool getSleep();
|
||||
|
||||
bool setTxPower(int power);
|
||||
int getTxPower();
|
||||
|
||||
IPAddress hostByName(const char *hostname);
|
||||
|
||||
static IPAddress calculateNetworkID(IPAddress ip, IPAddress subnet);
|
||||
static IPAddress calculateBroadcast(IPAddress ip, IPAddress subnet);
|
||||
static uint8_t calculateSubnetCIDR(IPAddress subnetMask);
|
||||
static String macToString(uint8_t *mac);
|
||||
|
||||
public:
|
||||
// IWiFiSTAClass
|
||||
WiFiStatus begin(
|
||||
const char *ssid,
|
||||
const char *passphrase = NULL,
|
||||
int32_t channel = 0,
|
||||
const uint8_t *bssid = NULL,
|
||||
bool connect = true
|
||||
) override;
|
||||
WiFiStatus
|
||||
begin(char *ssid, char *passphrase = NULL, int32_t channel = 0, const uint8_t *bssid = NULL, bool connect = true);
|
||||
|
||||
bool config(
|
||||
IPAddress localIP,
|
||||
IPAddress gateway,
|
||||
IPAddress subnet,
|
||||
IPAddress dns1 = (uint32_t)0x00000000,
|
||||
IPAddress dns2 = (uint32_t)0x00000000
|
||||
);
|
||||
|
||||
inline bool reconnect() {
|
||||
return reconnect(NULL);
|
||||
}
|
||||
|
||||
bool reconnect(const uint8_t *bssid = NULL);
|
||||
bool disconnect(bool wifiOff = false);
|
||||
|
||||
bool isConnected() override;
|
||||
|
||||
bool setAutoReconnect(bool autoReconnect);
|
||||
bool getAutoReconnect();
|
||||
|
||||
WiFiStatus waitForConnectResult(unsigned long timeout);
|
||||
|
||||
IPAddress localIP();
|
||||
uint8_t *macAddress(uint8_t *mac);
|
||||
String macAddress();
|
||||
IPAddress subnetMask();
|
||||
IPAddress gatewayIP();
|
||||
IPAddress dnsIP(uint8_t dns_no);
|
||||
IPAddress broadcastIP();
|
||||
IPAddress networkID();
|
||||
uint8_t subnetCIDR();
|
||||
bool enableIpV6();
|
||||
IPv6Address localIPv6();
|
||||
const char *getHostname();
|
||||
bool setHostname(const char *hostname);
|
||||
bool setMacAddress(const uint8_t *mac);
|
||||
|
||||
const String SSID();
|
||||
const String psk();
|
||||
uint8_t *BSSID();
|
||||
String BSSIDstr();
|
||||
int8_t RSSI();
|
||||
WiFiAuthMode getEncryption();
|
||||
|
||||
public:
|
||||
// IWiFiScanClass
|
||||
int16_t scanNetworks(
|
||||
bool async = false,
|
||||
bool showHidden = false,
|
||||
bool passive = false,
|
||||
uint32_t maxMsPerChannel = 300,
|
||||
uint8_t channel = 0
|
||||
);
|
||||
bool getNetworkInfo(
|
||||
uint8_t networkItem,
|
||||
String &ssid,
|
||||
WiFiAuthMode &encryptionType,
|
||||
int32_t &RSSI,
|
||||
uint8_t *&BSSID,
|
||||
int32_t &channel
|
||||
);
|
||||
|
||||
int16_t scanComplete();
|
||||
void scanDelete();
|
||||
|
||||
String SSID(uint8_t networkItem);
|
||||
WiFiAuthMode encryptionType(uint8_t networkItem);
|
||||
int32_t RSSI(uint8_t networkItem);
|
||||
uint8_t *BSSID(uint8_t networkItem);
|
||||
String BSSIDstr(uint8_t networkItem);
|
||||
int32_t channel(uint8_t networkItem);
|
||||
|
||||
public:
|
||||
// IWiFiAPClass
|
||||
bool softAP(
|
||||
const char *ssid, const char *passphrase = NULL, int channel = 1, bool ssidHidden = false, int maxClients = 4
|
||||
);
|
||||
bool softAPConfig(IPAddress localIP, IPAddress gateway, IPAddress subnet);
|
||||
bool softAPdisconnect(bool wifiOff = false);
|
||||
|
||||
uint8_t softAPgetStationNum();
|
||||
|
||||
IPAddress softAPIP();
|
||||
IPAddress softAPBroadcastIP();
|
||||
IPAddress softAPNetworkID();
|
||||
uint8_t softAPSubnetCIDR();
|
||||
bool softAPenableIpV6();
|
||||
IPv6Address softAPIPv6();
|
||||
const char *softAPgetHostname();
|
||||
bool softAPsetHostname(const char *hostname);
|
||||
uint8_t *softAPmacAddress(uint8_t *mac);
|
||||
String softAPmacAddress(void);
|
||||
const String softAPSSID(void);
|
||||
};
|
||||
|
||||
extern WiFiClass WiFi;
|
||||
@@ -1,164 +0,0 @@
|
||||
/* Copyright (c) Kuba Szczodrzyński 2022-04-25. */
|
||||
|
||||
#include "WiFi.h"
|
||||
#include "WiFiPriv.h"
|
||||
|
||||
bool WiFiClass::softAP(const char *ssid, const char *passphrase, int channel, bool ssidHidden, int maxClients) {
|
||||
if (!enableAP(true))
|
||||
return false;
|
||||
|
||||
vTaskDelay(20);
|
||||
|
||||
if (!ssid || *ssid == 0x00 || strlen(ssid) > 32) {
|
||||
LT_W("SSID not specified or too long");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (passphrase && strlen(passphrase) < 8) {
|
||||
LT_W("Passphrase too short");
|
||||
return false;
|
||||
}
|
||||
|
||||
strcpy((char *)ap.ssid.val, ssid);
|
||||
ap.ssid.len = strlen(ssid);
|
||||
ap.channel = channel;
|
||||
|
||||
ap.security_type = RTW_SECURITY_OPEN;
|
||||
ap.password = NULL;
|
||||
ap.password_len = 0;
|
||||
|
||||
if (passphrase) {
|
||||
strcpy((char *)ap_password, passphrase);
|
||||
ap.security_type = RTW_SECURITY_WPA2_AES_PSK;
|
||||
ap.password = ap_password;
|
||||
ap.password_len = strlen(passphrase);
|
||||
}
|
||||
|
||||
dhcps_deinit();
|
||||
|
||||
LT_I("Creating SoftAP %s", ssid);
|
||||
|
||||
int ret;
|
||||
if (!ssidHidden) {
|
||||
ret = wifi_start_ap(
|
||||
(char *)ap.ssid.val,
|
||||
ap.security_type,
|
||||
(char *)ap.password,
|
||||
ap.ssid.len,
|
||||
ap.password_len,
|
||||
ap.channel
|
||||
);
|
||||
} else {
|
||||
ret = wifi_start_ap_with_hidden_ssid(
|
||||
(char *)ap.ssid.val,
|
||||
ap.security_type,
|
||||
(char *)ap.password,
|
||||
ap.ssid.len,
|
||||
ap.password_len,
|
||||
ap.channel
|
||||
);
|
||||
}
|
||||
|
||||
if (ret < 0) {
|
||||
LT_E("SoftAP failed; ret=%d", ret);
|
||||
return false;
|
||||
}
|
||||
|
||||
uint8_t timeout = 20;
|
||||
unsigned char essid[33];
|
||||
|
||||
const char *ifname = NETNAME_AP;
|
||||
struct netif *ifs = NETIF_RTW_AP;
|
||||
|
||||
while (1) {
|
||||
if (wext_get_ssid(ifname, essid) > 0) {
|
||||
if (strcmp((const char *)essid, (const char *)ap.ssid.val) == 0)
|
||||
break;
|
||||
}
|
||||
|
||||
if (!timeout)
|
||||
return false;
|
||||
|
||||
vTaskDelay(1 * configTICK_RATE_HZ);
|
||||
timeout--;
|
||||
}
|
||||
|
||||
dhcps_init(ifs);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool WiFiClass::softAPConfig(IPAddress localIP, IPAddress gateway, IPAddress subnet) {
|
||||
if (!enableAP(true))
|
||||
return false;
|
||||
struct netif *ifs = NETIF_RTW_AP;
|
||||
struct ip_addr ipaddr, netmask, gw;
|
||||
ipaddr.addr = localIP;
|
||||
netmask.addr = subnet;
|
||||
gw.addr = gateway;
|
||||
netif_set_addr(ifs, &ipaddr, &netmask, &gw);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool WiFiClass::softAPdisconnect(bool wifiOff) {
|
||||
// TODO implement wifi_restart_ap
|
||||
if (wifiOff)
|
||||
return enableAP(false);
|
||||
return true;
|
||||
}
|
||||
|
||||
uint8_t WiFiClass::softAPgetStationNum() {
|
||||
// TODO
|
||||
// the struct is at wifi_conf.c:2576
|
||||
return 0;
|
||||
}
|
||||
|
||||
IPAddress WiFiClass::softAPIP() {
|
||||
return LwIP_GetIP(NETIF_RTW_AP);
|
||||
}
|
||||
|
||||
IPAddress WiFiClass::softAPBroadcastIP() {
|
||||
return calculateBroadcast(softAPIP(), LwIP_GetMASK(NETIF_RTW_AP));
|
||||
}
|
||||
|
||||
IPAddress WiFiClass::softAPNetworkID() {
|
||||
return calculateNetworkID(softAPIP(), LwIP_GetMASK(NETIF_RTW_AP));
|
||||
}
|
||||
|
||||
uint8_t WiFiClass::softAPSubnetCIDR() {
|
||||
return calculateSubnetCIDR(LwIP_GetMASK(NETIF_RTW_AP));
|
||||
}
|
||||
|
||||
bool WiFiClass::softAPenableIpV6() {
|
||||
return false;
|
||||
}
|
||||
|
||||
IPv6Address WiFiClass::softAPIPv6() {
|
||||
return IPv6Address();
|
||||
}
|
||||
|
||||
const char *WiFiClass::softAPgetHostname() {
|
||||
return netif_get_hostname(NETIF_RTW_AP);
|
||||
}
|
||||
|
||||
bool WiFiClass::softAPsetHostname(const char *hostname) {
|
||||
netif_set_hostname(NETIF_RTW_AP, (char *)hostname);
|
||||
return true;
|
||||
}
|
||||
|
||||
uint8_t *WiFiClass::softAPmacAddress(uint8_t *mac) {
|
||||
uint8_t *macLocal = LwIP_GetMAC(NETIF_RTW_AP);
|
||||
memcpy(mac, macLocal, ETH_ALEN);
|
||||
free(macLocal);
|
||||
return mac;
|
||||
}
|
||||
|
||||
String WiFiClass::softAPmacAddress(void) {
|
||||
uint8_t mac[ETH_ALEN];
|
||||
macAddress(mac);
|
||||
return macToString(mac);
|
||||
}
|
||||
|
||||
const String WiFiClass::softAPSSID(void) {
|
||||
wifi_get_setting(NETNAME_AP, &wifi_setting);
|
||||
return (char *)wifi_setting.ssid;
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
/* Copyright (c) Kuba Szczodrzyński 2022-05-04. */
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <WiFi.h>
|
||||
#include <ssl/MbedTLSClient.h>
|
||||
|
||||
typedef MbedTLSClient WiFiClientSecure;
|
||||
@@ -1,155 +0,0 @@
|
||||
/* Copyright (c) Kuba Szczodrzyński 2022-04-25. */
|
||||
|
||||
#include "WiFi.h"
|
||||
#include "WiFiPriv.h"
|
||||
|
||||
int32_t WiFiClass::channel() {
|
||||
int channel;
|
||||
wifi_get_channel(&channel);
|
||||
return channel;
|
||||
}
|
||||
|
||||
bool WiFiClass::mode(WiFiMode mode) {
|
||||
WiFiMode currentMode = getMode();
|
||||
LT_D_WG("Mode changing %u -> %u", currentMode, mode);
|
||||
if (mode == currentMode)
|
||||
return true;
|
||||
|
||||
if (!currentMode && mode && !_initialized) {
|
||||
// initialize wifi first
|
||||
LT_I("Initializing LwIP");
|
||||
LwIP_Init();
|
||||
reset_wifi_struct();
|
||||
// wifi_manager_init(); // these are events!
|
||||
_initialized = true;
|
||||
}
|
||||
if (currentMode) {
|
||||
// stop wifi to change mode
|
||||
LT_D_WG("Stopping WiFi to change mode");
|
||||
if (wifi_off() != RTW_SUCCESS)
|
||||
return false;
|
||||
vTaskDelay(20);
|
||||
if (mode == WIFI_MODE_NULL)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (wifi_on((rtw_mode_t)mode) != RTW_SUCCESS) {
|
||||
LT_E("Error while changing mode(%u)", mode);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
WiFiMode WiFiClass::getMode() {
|
||||
if (!_initialized)
|
||||
return WIFI_MODE_NULL;
|
||||
return (WiFiMode)wifi_mode;
|
||||
}
|
||||
|
||||
WiFiStatus WiFiClass::status() {
|
||||
if (wifi_is_connected_to_ap() == 0) {
|
||||
return WL_CONNECTED;
|
||||
} else {
|
||||
return WL_DISCONNECTED;
|
||||
}
|
||||
}
|
||||
|
||||
bool WiFiClass::enableSTA(bool enable) {
|
||||
WiFiMode currentMode = getMode();
|
||||
if (((currentMode & WIFI_MODE_STA) != 0) != enable) {
|
||||
return mode((WiFiMode)(currentMode ^ WIFI_MODE_STA));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool WiFiClass::enableAP(bool enable) {
|
||||
WiFiMode currentMode = getMode();
|
||||
if (((currentMode & WIFI_MODE_AP) != 0) != enable) {
|
||||
return mode((WiFiMode)(currentMode ^ WIFI_MODE_AP));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool WiFiClass::setSleep(bool enable) {
|
||||
LT_D_WG("WiFi sleep mode %u", enable);
|
||||
if (enable)
|
||||
if (wifi_enable_powersave() != RTW_SUCCESS)
|
||||
return false;
|
||||
else if (wifi_disable_powersave() != RTW_SUCCESS)
|
||||
return false;
|
||||
_sleep = enable;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool WiFiClass::getSleep() {
|
||||
return _sleep;
|
||||
}
|
||||
|
||||
bool WiFiClass::setTxPower(int power) {
|
||||
return false; // wifi_set_txpower(power) == RTW_SUCCESS;
|
||||
}
|
||||
|
||||
int WiFiClass::getTxPower() {
|
||||
return 0;
|
||||
int power = 0;
|
||||
wifi_get_txpower(&power);
|
||||
return power;
|
||||
}
|
||||
|
||||
IPAddress WiFiClass::hostByName(const char *hostname) {
|
||||
ip_addr_t ip;
|
||||
int ret = netconn_gethostbyname(hostname, &ip);
|
||||
if (ret == ERR_OK) {
|
||||
return ip.addr;
|
||||
}
|
||||
return IPAddress();
|
||||
}
|
||||
|
||||
IPAddress WiFiClass::calculateNetworkID(IPAddress ip, IPAddress subnet) {
|
||||
IPAddress networkID;
|
||||
|
||||
for (size_t i = 0; i < 4; i++)
|
||||
networkID[i] = subnet[i] & ip[i];
|
||||
|
||||
return networkID;
|
||||
}
|
||||
|
||||
IPAddress WiFiClass::calculateBroadcast(IPAddress ip, IPAddress subnet) {
|
||||
IPAddress broadcastIp;
|
||||
|
||||
for (int i = 0; i < 4; i++)
|
||||
broadcastIp[i] = ~subnet[i] | ip[i];
|
||||
|
||||
return broadcastIp;
|
||||
}
|
||||
|
||||
uint8_t WiFiClass::calculateSubnetCIDR(IPAddress subnetMask) {
|
||||
uint8_t CIDR = 0;
|
||||
|
||||
for (uint8_t i = 0; i < 4; i++) {
|
||||
if (subnetMask[i] == 0x80) // 128
|
||||
CIDR += 1;
|
||||
else if (subnetMask[i] == 0xC0) // 192
|
||||
CIDR += 2;
|
||||
else if (subnetMask[i] == 0xE0) // 224
|
||||
CIDR += 3;
|
||||
else if (subnetMask[i] == 0xF0) // 242
|
||||
CIDR += 4;
|
||||
else if (subnetMask[i] == 0xF8) // 248
|
||||
CIDR += 5;
|
||||
else if (subnetMask[i] == 0xFC) // 252
|
||||
CIDR += 6;
|
||||
else if (subnetMask[i] == 0xFE) // 254
|
||||
CIDR += 7;
|
||||
else if (subnetMask[i] == 0xFF) // 255
|
||||
CIDR += 8;
|
||||
}
|
||||
|
||||
return CIDR;
|
||||
}
|
||||
|
||||
String WiFiClass::macToString(uint8_t *mac) {
|
||||
char macStr[ETH_ALEN * 3];
|
||||
sprintf(macStr, "%02X:%02X:%02X:%02X:%02X:%02X", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
|
||||
return macStr;
|
||||
}
|
||||
@@ -1,68 +0,0 @@
|
||||
/* Copyright (c) Kuba Szczodrzyński 2022-04-25. */
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif // __cplusplus
|
||||
|
||||
// these are defined in PIO builder (for IDE to understand)
|
||||
#define LWIP_TIMEVAL_PRIVATE 0
|
||||
#define LWIP_NETIF_HOSTNAME 1
|
||||
// this should define all errno values, as well as the extern int
|
||||
#define LWIP_PROVIDE_ERRNO 1
|
||||
#define LWIP_SO_RCVBUF 1
|
||||
|
||||
#define MAX_SOCK_NUM 4
|
||||
#define WIFI_CLIENT_CONNECT_TIMEOUT 3000
|
||||
#define WIFI_CLIENT_READ_TIMEOUT 3000
|
||||
#define WIFI_CLIENT_WRITE_RETRY 10
|
||||
#define WIFI_CLIENT_SELECT_TIMEOUT 1000
|
||||
#define WIFI_CLIENT_FLUSH_BUF_SIZE 1024
|
||||
|
||||
// I think I don't understand how that works.
|
||||
// For some reason, LwIP uses a different (extern) errno,
|
||||
// while this macro refers to a function __errno, which
|
||||
// reads a totally different variable.
|
||||
#undef errno
|
||||
#include <lwip/arch.h>
|
||||
|
||||
// disable #defines removing lwip_ prefix
|
||||
#undef LWIP_COMPAT_SOCKETS
|
||||
#define LWIP_COMPAT_SOCKETS 0
|
||||
#include <lwip/sockets.h>
|
||||
|
||||
#include <autoconf.h>
|
||||
#include <dhcp/dhcps.h>
|
||||
#include <lwip/api.h>
|
||||
#include <lwip/dns.h>
|
||||
#include <lwip/err.h>
|
||||
#include <lwip_netconf.h>
|
||||
#include <sys/time.h>
|
||||
#include <wifi_conf.h>
|
||||
#include <wifi_constants.h>
|
||||
#include <wifi_structures.h>
|
||||
|
||||
extern struct netif xnetif[NET_IF_NUM];
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
#include <Arduino.h>
|
||||
|
||||
#include "WiFi.h"
|
||||
|
||||
extern rtw_network_info_t wifi;
|
||||
extern rtw_ap_info_t ap;
|
||||
extern rtw_wifi_setting_t wifi_setting;
|
||||
extern unsigned char sta_password[65];
|
||||
extern unsigned char ap_password[65];
|
||||
extern void reset_wifi_struct(void);
|
||||
extern rtw_mode_t wifi_mode;
|
||||
|
||||
#define NETIF_RTW_STA &xnetif[RTW_STA_INTERFACE]
|
||||
#define NETIF_RTW_AP (wifi_mode == WIFI_MODE_APSTA ? &xnetif[RTW_AP_INTERFACE] : NETIF_RTW_STA)
|
||||
|
||||
#define NETNAME_STA WLAN0_NAME
|
||||
#define NETNAME_AP (wifi_mode == WIFI_MODE_APSTA ? WLAN1_NAME : WLAN0_NAME)
|
||||
@@ -1,237 +0,0 @@
|
||||
/* Copyright (c) Kuba Szczodrzyński 2022-04-25. */
|
||||
|
||||
#include "WiFi.h"
|
||||
#include "WiFiPriv.h"
|
||||
|
||||
WiFiStatus WiFiClass::begin(char *ssid, char *passphrase, int32_t channel, const uint8_t *bssid, bool connect) {
|
||||
return begin((const char *)ssid, (const char *)passphrase, channel, bssid, connect);
|
||||
}
|
||||
|
||||
WiFiStatus
|
||||
WiFiClass::begin(const char *ssid, const char *passphrase, int32_t channel, const uint8_t *bssid, bool connect) {
|
||||
if (!enableSTA(true))
|
||||
return WL_CONNECT_FAILED;
|
||||
|
||||
if (!ssid || *ssid == 0x00 || strlen(ssid) > 32) {
|
||||
LT_W("SSID not specified or too long");
|
||||
return WL_CONNECT_FAILED;
|
||||
}
|
||||
|
||||
if (passphrase && strlen(passphrase) > 64) {
|
||||
LT_W("Passphrase too long");
|
||||
return WL_CONNECT_FAILED;
|
||||
}
|
||||
|
||||
memset(wifi.bssid.octet, 0, ETH_ALEN);
|
||||
strcpy((char *)wifi.ssid.val, ssid);
|
||||
wifi.ssid.len = strlen(ssid);
|
||||
|
||||
wifi.security_type = RTW_SECURITY_OPEN;
|
||||
wifi.password = NULL;
|
||||
wifi.password_len = 0;
|
||||
wifi.key_id = 0;
|
||||
|
||||
if (passphrase) {
|
||||
strcpy((char *)sta_password, passphrase);
|
||||
wifi.security_type = RTW_SECURITY_WPA2_AES_PSK;
|
||||
wifi.password = sta_password;
|
||||
wifi.password_len = strlen(passphrase);
|
||||
}
|
||||
|
||||
if (reconnect(bssid))
|
||||
return WL_CONNECTED;
|
||||
else
|
||||
return WL_CONNECT_FAILED;
|
||||
}
|
||||
|
||||
bool WiFiClass::config(IPAddress localIP, IPAddress gateway, IPAddress subnet, IPAddress dns1, IPAddress dns2) {
|
||||
if (!enableSTA(true))
|
||||
return false;
|
||||
struct netif *ifs = NETIF_RTW_STA;
|
||||
struct ip_addr ipaddr, netmask, gw, d1, d2;
|
||||
ipaddr.addr = localIP;
|
||||
netmask.addr = subnet;
|
||||
gw.addr = gateway;
|
||||
d1.addr = dns1;
|
||||
d2.addr = dns2;
|
||||
netif_set_addr(ifs, &ipaddr, &netmask, &gw);
|
||||
if (dns1[0])
|
||||
dns_setserver(0, &d1);
|
||||
if (dns2[0])
|
||||
dns_setserver(0, &d2);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool WiFiClass::reconnect(const uint8_t *bssid) {
|
||||
int ret;
|
||||
uint8_t dhcpRet;
|
||||
|
||||
LT_I("Connecting to %s", wifi.ssid.val);
|
||||
|
||||
if (!bssid) {
|
||||
ret = wifi_connect(
|
||||
(char *)wifi.ssid.val,
|
||||
wifi.security_type,
|
||||
(char *)wifi.password,
|
||||
wifi.ssid.len,
|
||||
wifi.password_len,
|
||||
wifi.key_id,
|
||||
NULL
|
||||
);
|
||||
} else {
|
||||
ret = wifi_connect_bssid(
|
||||
(unsigned char *)bssid,
|
||||
(char *)wifi.ssid.val,
|
||||
wifi.security_type,
|
||||
(char *)wifi.password,
|
||||
ETH_ALEN,
|
||||
wifi.ssid.len,
|
||||
wifi.password_len,
|
||||
wifi.key_id,
|
||||
NULL
|
||||
);
|
||||
}
|
||||
|
||||
if (ret == RTW_SUCCESS) {
|
||||
dhcpRet = LwIP_DHCP(0, DHCP_START);
|
||||
if (dhcpRet == DHCP_ADDRESS_ASSIGNED)
|
||||
return true;
|
||||
LT_E("DHCP failed; dhcpRet=%d", dhcpRet);
|
||||
wifi_disconnect();
|
||||
return false;
|
||||
}
|
||||
LT_E("Connection failed; ret=%d", ret);
|
||||
return false;
|
||||
}
|
||||
|
||||
bool WiFiClass::disconnect(bool wifiOff) {
|
||||
int ret = wifi_disconnect();
|
||||
if (wifiOff)
|
||||
enableSTA(false);
|
||||
return ret == RTW_SUCCESS;
|
||||
}
|
||||
|
||||
bool WiFiClass::isConnected() {
|
||||
return status() == WL_CONNECTED;
|
||||
}
|
||||
|
||||
bool WiFiClass::setAutoReconnect(bool autoReconnect) {
|
||||
return wifi_set_autoreconnect(autoReconnect) == RTW_SUCCESS;
|
||||
}
|
||||
|
||||
bool WiFiClass::getAutoReconnect() {
|
||||
bool autoReconnect;
|
||||
wifi_get_autoreconnect((uint8_t *)&autoReconnect);
|
||||
return autoReconnect;
|
||||
}
|
||||
|
||||
WiFiStatus WiFiClass::waitForConnectResult(unsigned long timeout) {
|
||||
if ((wifi_mode & WIFI_MODE_STA) == 0) {
|
||||
return WL_DISCONNECTED;
|
||||
}
|
||||
unsigned long start = millis();
|
||||
while ((!status() || status() >= WL_DISCONNECTED) && (millis() - start) < timeout) {
|
||||
delay(100);
|
||||
}
|
||||
return status();
|
||||
}
|
||||
|
||||
IPAddress WiFiClass::localIP() {
|
||||
if (!wifi_mode)
|
||||
return IPAddress();
|
||||
return LwIP_GetIP(NETIF_RTW_STA);
|
||||
}
|
||||
|
||||
uint8_t *WiFiClass::macAddress(uint8_t *mac) {
|
||||
uint8_t *macLocal = LwIP_GetMAC(NETIF_RTW_STA);
|
||||
memcpy(mac, macLocal, ETH_ALEN);
|
||||
free(macLocal);
|
||||
return mac;
|
||||
}
|
||||
|
||||
String WiFiClass::macAddress(void) {
|
||||
uint8_t mac[ETH_ALEN];
|
||||
macAddress(mac);
|
||||
return macToString(mac);
|
||||
}
|
||||
|
||||
IPAddress WiFiClass::subnetMask() {
|
||||
return LwIP_GetMASK(NETIF_RTW_STA);
|
||||
}
|
||||
|
||||
IPAddress WiFiClass::gatewayIP() {
|
||||
return LwIP_GetGW(NETIF_RTW_STA);
|
||||
}
|
||||
|
||||
IPAddress WiFiClass::dnsIP(uint8_t dns_no) {
|
||||
struct ip_addr dns;
|
||||
LwIP_GetDNS(&dns);
|
||||
return dns.addr;
|
||||
}
|
||||
|
||||
IPAddress WiFiClass::broadcastIP() {
|
||||
return LwIP_GetBC(NETIF_RTW_STA);
|
||||
}
|
||||
|
||||
IPAddress WiFiClass::networkID() {
|
||||
return calculateNetworkID(gatewayIP(), subnetMask());
|
||||
}
|
||||
|
||||
uint8_t WiFiClass::subnetCIDR() {
|
||||
return calculateSubnetCIDR(subnetMask());
|
||||
}
|
||||
|
||||
bool WiFiClass::enableIpV6() {
|
||||
return false;
|
||||
}
|
||||
|
||||
IPv6Address WiFiClass::localIPv6() {
|
||||
return IPv6Address();
|
||||
}
|
||||
|
||||
const char *WiFiClass::getHostname() {
|
||||
return netif_get_hostname(NETIF_RTW_STA);
|
||||
}
|
||||
|
||||
bool WiFiClass::setHostname(const char *hostname) {
|
||||
netif_set_hostname(NETIF_RTW_STA, (char *)hostname);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool WiFiClass::setMacAddress(const uint8_t *mac) {
|
||||
return wifi_set_mac_address((char *)mac) == RTW_SUCCESS;
|
||||
}
|
||||
|
||||
const String WiFiClass::SSID() {
|
||||
if (!isConnected())
|
||||
return "";
|
||||
wifi_get_setting(NETNAME_STA, &wifi_setting);
|
||||
return (char *)wifi_setting.ssid;
|
||||
}
|
||||
|
||||
const String WiFiClass::psk() {
|
||||
if (!isConnected() || !wifi.password)
|
||||
return "";
|
||||
return (char *)wifi.password;
|
||||
}
|
||||
|
||||
uint8_t *WiFiClass::BSSID() {
|
||||
uint8_t bssid[ETH_ALEN];
|
||||
wext_get_bssid(NETNAME_STA, bssid);
|
||||
return bssid;
|
||||
}
|
||||
|
||||
String WiFiClass::BSSIDstr() {
|
||||
return macToString(BSSID());
|
||||
}
|
||||
|
||||
int8_t WiFiClass::RSSI() {
|
||||
int rssi = 0;
|
||||
wifi_get_rssi(&rssi);
|
||||
return rssi;
|
||||
}
|
||||
|
||||
WiFiAuthMode WiFiClass::getEncryption() {
|
||||
wifi_get_setting(NETNAME_STA, &wifi_setting);
|
||||
return WiFiClass::securityTypeToAuthMode(wifi_setting.security_type);
|
||||
}
|
||||
@@ -1,124 +0,0 @@
|
||||
/* Copyright (c) Kuba Szczodrzyński 2022-04-25. */
|
||||
|
||||
#include "WiFi.h"
|
||||
#include "WiFiPriv.h"
|
||||
|
||||
rtw_result_t WiFiClass::scanHandler(rtw_scan_handler_result_t *result) {
|
||||
WiFiClass *cls = (WiFiClass *)result->user_data;
|
||||
|
||||
if (result->scan_complete == RTW_TRUE) {
|
||||
cls->_scanning = false;
|
||||
xSemaphoreGive(cls->_scanSem);
|
||||
return RTW_SUCCESS;
|
||||
}
|
||||
|
||||
rtw_scan_result_t *net = &result->ap_details;
|
||||
net->SSID.val[net->SSID.len] = '\0';
|
||||
|
||||
uint8_t newSize = cls->_netCount + 1;
|
||||
cls->_netSsid = (char **)realloc(cls->_netSsid, newSize * sizeof(char *));
|
||||
cls->_netEncr = (WiFiAuthMode *)realloc(cls->_netEncr, newSize * sizeof(WiFiAuthMode));
|
||||
cls->_netRssi = (int32_t *)realloc(cls->_netRssi, newSize * sizeof(int32_t));
|
||||
cls->_netBssid = (rtw_mac_t *)realloc(cls->_netBssid, newSize * sizeof(rtw_mac_t));
|
||||
cls->_netChannel = (int32_t *)realloc(cls->_netChannel, newSize * sizeof(int32_t));
|
||||
|
||||
cls->_netSsid[cls->_netCount] = (char *)malloc((net->SSID.len + 1) * sizeof(char));
|
||||
strcpy(cls->_netSsid[cls->_netCount], (char *)net->SSID.val);
|
||||
cls->_netEncr[cls->_netCount] = WiFiClass::securityTypeToAuthMode(net->security);
|
||||
cls->_netRssi[cls->_netCount] = net->signal_strength;
|
||||
memcpy(cls->_netBssid[cls->_netCount].octet, net->BSSID.octet, ETH_ALEN);
|
||||
cls->_netChannel[cls->_netCount] = net->channel;
|
||||
cls->_netCount++;
|
||||
|
||||
return RTW_SUCCESS;
|
||||
}
|
||||
|
||||
int16_t WiFiClass::scanNetworks(bool async, bool showHidden, bool passive, uint32_t maxMsPerChannel, uint8_t channel) {
|
||||
if (_scanning)
|
||||
return WIFI_SCAN_RUNNING;
|
||||
if (wifi_mode == WIFI_MODE_NULL)
|
||||
enableSTA(true);
|
||||
scanDelete();
|
||||
|
||||
LT_I("Starting WiFi scan");
|
||||
|
||||
if (wifi_scan_networks(scanHandler, this) != RTW_SUCCESS)
|
||||
return WIFI_SCAN_FAILED;
|
||||
|
||||
_scanning = true;
|
||||
|
||||
if (!async) {
|
||||
LT_I("Waiting for results");
|
||||
xSemaphoreTake(_scanSem, 1); // reset the semaphore quickly
|
||||
xSemaphoreTake(_scanSem, pdMS_TO_TICKS(maxMsPerChannel * 20));
|
||||
return _netCount;
|
||||
}
|
||||
return WIFI_SCAN_RUNNING;
|
||||
}
|
||||
|
||||
bool WiFiClass::getNetworkInfo(
|
||||
uint8_t networkItem, String &ssid, WiFiAuthMode &encType, int32_t &rssi, uint8_t *&bssid, int32_t &channel
|
||||
) {
|
||||
ssid = SSID(networkItem);
|
||||
encType = encryptionType(networkItem);
|
||||
rssi = RSSI(networkItem);
|
||||
bssid = BSSID(networkItem);
|
||||
channel = this->channel(networkItem);
|
||||
}
|
||||
|
||||
int16_t WiFiClass::scanComplete() {
|
||||
if (_scanning)
|
||||
return WIFI_SCAN_RUNNING;
|
||||
return _netCount;
|
||||
}
|
||||
|
||||
void WiFiClass::scanDelete() {
|
||||
for (uint8_t i = 0; i < _netCount; i++) {
|
||||
free(_netSsid[i]);
|
||||
}
|
||||
free(_netSsid);
|
||||
free(_netEncr);
|
||||
free(_netRssi);
|
||||
free(_netBssid);
|
||||
free(_netChannel);
|
||||
_netCount = 0;
|
||||
_netSsid = NULL;
|
||||
_netEncr = NULL;
|
||||
_netRssi = NULL;
|
||||
_netBssid = NULL;
|
||||
_netChannel = NULL;
|
||||
}
|
||||
|
||||
String WiFiClass::SSID(uint8_t networkItem) {
|
||||
if (networkItem >= _netCount)
|
||||
return "";
|
||||
return _netSsid[networkItem];
|
||||
}
|
||||
|
||||
WiFiAuthMode WiFiClass::encryptionType(uint8_t networkItem) {
|
||||
if (networkItem >= _netCount)
|
||||
return WIFI_AUTH_INVALID;
|
||||
return _netEncr[networkItem];
|
||||
}
|
||||
|
||||
int32_t WiFiClass::RSSI(uint8_t networkItem) {
|
||||
if (networkItem >= _netCount)
|
||||
return 0;
|
||||
return _netRssi[networkItem];
|
||||
}
|
||||
|
||||
uint8_t *WiFiClass::BSSID(uint8_t networkItem) {
|
||||
if (networkItem >= _netCount)
|
||||
return NULL;
|
||||
return _netBssid[networkItem].octet;
|
||||
}
|
||||
|
||||
String WiFiClass::BSSIDstr(uint8_t networkItem) {
|
||||
return macToString(BSSID(networkItem));
|
||||
}
|
||||
|
||||
int32_t WiFiClass::channel(uint8_t networkItem) {
|
||||
if (networkItem >= _netCount)
|
||||
return 0;
|
||||
return _netChannel[networkItem];
|
||||
}
|
||||
8
boards/_base/beken-7231-tuya.json
Normal file
8
boards/_base/beken-7231-tuya.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"build": {
|
||||
"bkcrypt_coeffs": "510fb093a3cbeadc5993a17ec7adeb03"
|
||||
},
|
||||
"flash": {
|
||||
"tuya": "0x1ED000+0x13000"
|
||||
}
|
||||
}
|
||||
10
boards/_base/beken-7231.json
Normal file
10
boards/_base/beken-7231.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"build": {
|
||||
"ldscript": "bk7231_bsp.ld",
|
||||
"bkoffset_app": "0x10000",
|
||||
"bkrbl_size_app": "0x108700"
|
||||
},
|
||||
"upload": {
|
||||
"maximum_size": 1083136
|
||||
}
|
||||
}
|
||||
33
boards/_base/beken-7231n.json
Normal file
33
boards/_base/beken-7231n.json
Normal file
@@ -0,0 +1,33 @@
|
||||
{
|
||||
"build": {
|
||||
"family": "BK7231N",
|
||||
"ldscript": "bk7231n_bsp.ld",
|
||||
"bkboot_version": "1.0.1-bk7231n",
|
||||
"bkoffset_app": "0x10000",
|
||||
"bkrbl_size_app": "0x108700"
|
||||
},
|
||||
"flash": {
|
||||
"bootloader": "0x000000+0x11000",
|
||||
"app": "0x011000+0x119000",
|
||||
"download": "0x12A000+0xA6000",
|
||||
"calibration": "0x1D0000+0x1000",
|
||||
"net": "0x1D1000+0x1000",
|
||||
"tlv": "0x1D2000+0x1000",
|
||||
"kvs": "0x1D3000+0x8000",
|
||||
"userdata": "0x1DB000+0x25000"
|
||||
},
|
||||
"upload": {
|
||||
"maximum_size": 1083136,
|
||||
"speed": 460800
|
||||
},
|
||||
"connectivity": [
|
||||
"ble"
|
||||
],
|
||||
"doc": {
|
||||
"params": {
|
||||
"extra": {
|
||||
"Bluetooth": "BLE v5.1"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
19
boards/_base/beken-7231q.json
Normal file
19
boards/_base/beken-7231q.json
Normal file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"build": {
|
||||
"family": "BK7231Q",
|
||||
"bkboot_version": "bk7231q"
|
||||
},
|
||||
"flash": {
|
||||
"bootloader": "0x000000+0x11000",
|
||||
"app": "0x011000+0x121000",
|
||||
"download": "0x132000+0xA6000",
|
||||
"kvs": "0x1D8000+0x8000",
|
||||
"calibration": "0x1E0000+0x1000",
|
||||
"tlv": "0x1E1000+0x1000",
|
||||
"net": "0x1E2000+0x1000",
|
||||
"userdata": "0x1E3000+0x1D000"
|
||||
},
|
||||
"upload": {
|
||||
"speed": 460800
|
||||
}
|
||||
}
|
||||
29
boards/_base/beken-7231t.json
Normal file
29
boards/_base/beken-7231t.json
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"build": {
|
||||
"family": "BK7231T",
|
||||
"bkboot_version": "1.0.5-bk7231s"
|
||||
},
|
||||
"flash": {
|
||||
"bootloader": "0x000000+0x11000",
|
||||
"app": "0x011000+0x121000",
|
||||
"download": "0x132000+0xA6000",
|
||||
"kvs": "0x1D8000+0x8000",
|
||||
"calibration": "0x1E0000+0x1000",
|
||||
"tlv": "0x1E1000+0x1000",
|
||||
"net": "0x1E2000+0x1000",
|
||||
"userdata": "0x1E3000+0x1D000"
|
||||
},
|
||||
"upload": {
|
||||
"speed": 921600
|
||||
},
|
||||
"connectivity": [
|
||||
"ble"
|
||||
],
|
||||
"doc": {
|
||||
"params": {
|
||||
"extra": {
|
||||
"Bluetooth": "BLE v4.2"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
40
boards/_base/beken-7252.json
Normal file
40
boards/_base/beken-7252.json
Normal file
@@ -0,0 +1,40 @@
|
||||
{
|
||||
"build": {
|
||||
"family": "BK7251",
|
||||
"f_cpu": "180000000L",
|
||||
"ldscript": "bk7231_bsp.ld",
|
||||
"bkboot_version": "0.1.3-bk7252",
|
||||
"bkoffset_app": "0x10000",
|
||||
"bkrbl_size_app": "0x1A0000"
|
||||
},
|
||||
"flash": {
|
||||
"bootloader": "0x000000+0x11000",
|
||||
"app": "0x011000+0x1BA000",
|
||||
"filesystem": "0x1CB000+0x119000",
|
||||
"kvs": "0x2E4000+0x8000",
|
||||
"download": "0x2EC000+0x112000",
|
||||
"calibration": "0x3FE000+0x1000",
|
||||
"tlv": "0x3FF000+0x1000"
|
||||
},
|
||||
"debug": {
|
||||
"gdb_init": [
|
||||
"mem 0x200000 0x400000 ro"
|
||||
]
|
||||
},
|
||||
"upload": {
|
||||
"maximum_ram_size": 524288,
|
||||
"flash_size": 4194304,
|
||||
"maximum_size": 1703936,
|
||||
"speed": 921600
|
||||
},
|
||||
"connectivity": [
|
||||
"ble"
|
||||
],
|
||||
"doc": {
|
||||
"params": {
|
||||
"extra": {
|
||||
"Bluetooth": "BLE v5.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
50
boards/_base/beken-72xx.json
Normal file
50
boards/_base/beken-72xx.json
Normal file
@@ -0,0 +1,50 @@
|
||||
{
|
||||
"build": {
|
||||
"f_cpu": "120000000L",
|
||||
"prefix": "arm-none-eabi-",
|
||||
"bkota": {
|
||||
"encryption": "aes256",
|
||||
"compression": "gzip",
|
||||
"key": "0123456789ABCDEF0123456789ABCDEF",
|
||||
"iv": "0123456789ABCDEF"
|
||||
}
|
||||
},
|
||||
"connectivity": [
|
||||
"wifi"
|
||||
],
|
||||
"debug": {
|
||||
"protocol": "openocd",
|
||||
"protocols": [
|
||||
"openocd"
|
||||
],
|
||||
"openocd_config": "bk72xx.cfg",
|
||||
"gdb_init": [
|
||||
"mem 0x000000 0x200000 ro"
|
||||
]
|
||||
},
|
||||
"upload": {
|
||||
"maximum_ram_size": 262144,
|
||||
"flash_size": 2097152,
|
||||
"require_upload_port": true,
|
||||
"protocol": "uart",
|
||||
"protocols": [
|
||||
"uart"
|
||||
]
|
||||
},
|
||||
"doc": {
|
||||
"params": {
|
||||
"manufacturer": "Beken",
|
||||
"series": "BK72XX",
|
||||
"voltage": "3.0V - 3.6V",
|
||||
"extra": {
|
||||
"Wi-Fi": "802.11 b/g/n"
|
||||
}
|
||||
},
|
||||
"links": {
|
||||
"Info & flashing guide": "../../docs/platform/beken-72xx/README.md"
|
||||
},
|
||||
"extra": [
|
||||
"Bootloader and app partitions contain CRC16 sums every 32 bytes. That results in the actual flash offsets/sizes not aligned to sector boundaries. To simplify calculations, the values shown in the table (extracted from bootloader's partition table) were aligned to 4096 bytes."
|
||||
]
|
||||
}
|
||||
}
|
||||
7
boards/_base/generic.json
Normal file
7
boards/_base/generic.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"pcb": {
|
||||
"symbol": "GENERIC",
|
||||
"templates": [],
|
||||
"vars": {}
|
||||
}
|
||||
}
|
||||
139
boards/_base/ic/bk7231-qfn32.json
Normal file
139
boards/_base/ic/bk7231-qfn32.json
Normal file
@@ -0,0 +1,139 @@
|
||||
{
|
||||
"pcb": {
|
||||
"ic": {
|
||||
"10": {
|
||||
"C_NAME": "GPIO28",
|
||||
"GPIO": "P28",
|
||||
"IRQ": null,
|
||||
"USB": "DN"
|
||||
},
|
||||
"11": {
|
||||
"C_NAME": "GPIO14",
|
||||
"GPIO": "P14",
|
||||
"IRQ": null,
|
||||
"SD": "CLK",
|
||||
"SPI": "SCK"
|
||||
},
|
||||
"12": {
|
||||
"C_NAME": "GPIO16",
|
||||
"GPIO": "P16",
|
||||
"IRQ": null,
|
||||
"SD": "D0",
|
||||
"SPI": "MOSI"
|
||||
},
|
||||
"13": {
|
||||
"C_NAME": "GPIO15",
|
||||
"GPIO": "P15",
|
||||
"IRQ": null,
|
||||
"SD": "CMD",
|
||||
"SPI": "CS"
|
||||
},
|
||||
"14": {
|
||||
"C_NAME": "GPIO17",
|
||||
"GPIO": "P17",
|
||||
"IRQ": null,
|
||||
"SD": "D1",
|
||||
"SPI": "MISO"
|
||||
},
|
||||
"15": {
|
||||
"C_NAME": "GPIO26",
|
||||
"GPIO": "P26",
|
||||
"IRQ": null,
|
||||
"PWM": 5,
|
||||
"IRDA": null
|
||||
},
|
||||
"16": {
|
||||
"C_NAME": "GPIO24",
|
||||
"GPIO": "P24",
|
||||
"IRQ": null,
|
||||
"PWM": 4
|
||||
},
|
||||
"17": {
|
||||
"C_NAME": "GPIO23",
|
||||
"GPIO": "P23",
|
||||
"IRQ": null,
|
||||
"ADC": 3,
|
||||
"JTAG": "TDO",
|
||||
"FLASH": "FSO"
|
||||
},
|
||||
"18": {
|
||||
"C_NAME": "GPIO22",
|
||||
"GPIO": "P22",
|
||||
"IRQ": null,
|
||||
"JTAG": "TDI",
|
||||
"FLASH": "FSI"
|
||||
},
|
||||
"19": {
|
||||
"C_NAME": "GPIO21",
|
||||
"GPIO": "P21",
|
||||
"IRQ": null,
|
||||
"I2C": "1_SDA",
|
||||
"JTAG": "TMS",
|
||||
"I2S": "MCLK",
|
||||
"FLASH": "^FCS"
|
||||
},
|
||||
"20": {
|
||||
"C_NAME": "GPIO20",
|
||||
"GPIO": "P20",
|
||||
"IRQ": null,
|
||||
"I2C": "1_SCL",
|
||||
"JTAG": "TCK",
|
||||
"FLASH": "FSCK"
|
||||
},
|
||||
"21": {
|
||||
"IO": "I",
|
||||
"CTRL": "CEN"
|
||||
},
|
||||
"22": {
|
||||
"C_NAME": "GPIO6",
|
||||
"GPIO": "P6",
|
||||
"IRQ": null,
|
||||
"PWM": 0
|
||||
},
|
||||
"23": {
|
||||
"C_NAME": "GPIO7",
|
||||
"GPIO": "P7",
|
||||
"IRQ": null,
|
||||
"PWM": 1
|
||||
},
|
||||
"24": {
|
||||
"C_NAME": "GPIO8",
|
||||
"GPIO": "P8",
|
||||
"IRQ": null,
|
||||
"PWM": 2
|
||||
},
|
||||
"25": {
|
||||
"C_NAME": "GPIO9",
|
||||
"GPIO": "P9",
|
||||
"IRQ": null,
|
||||
"PWM": 3
|
||||
},
|
||||
"26": {
|
||||
"C_NAME": "GPIO10",
|
||||
"GPIO": "P10",
|
||||
"IRQ": null,
|
||||
"UART": "1_RX"
|
||||
},
|
||||
"27": {
|
||||
"C_NAME": "GPIO11",
|
||||
"GPIO": "P11",
|
||||
"IRQ": null,
|
||||
"UART": "1_TX"
|
||||
},
|
||||
"28": {
|
||||
"C_NAME": "GPIO1",
|
||||
"GPIO": "P1",
|
||||
"IRQ": null,
|
||||
"UART": "2_RX",
|
||||
"I2C": "2_SDA"
|
||||
},
|
||||
"29": {
|
||||
"C_NAME": "GPIO0",
|
||||
"GPIO": "P0",
|
||||
"IRQ": null,
|
||||
"UART": "2_TX",
|
||||
"I2C": "2_SCL"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
186
boards/_base/ic/bk7231-qfn40.json
Normal file
186
boards/_base/ic/bk7231-qfn40.json
Normal file
@@ -0,0 +1,186 @@
|
||||
{
|
||||
"pcb": {
|
||||
"ic": {
|
||||
"10": {
|
||||
"C_NAME": "GPIO25",
|
||||
"GPIO": "P25",
|
||||
"IRQ": null,
|
||||
"USB": "DP"
|
||||
},
|
||||
"11": {
|
||||
"C_NAME": "GPIO33",
|
||||
"GPIO": "P33",
|
||||
"IRQ": null,
|
||||
"DVP": "PD1"
|
||||
},
|
||||
"12": {
|
||||
"C_NAME": "GPIO32",
|
||||
"GPIO": "P32",
|
||||
"IRQ": null,
|
||||
"DVP": "PD0"
|
||||
},
|
||||
"13": {
|
||||
"C_NAME": "GPIO29",
|
||||
"GPIO": "P29",
|
||||
"IRQ": null,
|
||||
"DVP": "PCLK"
|
||||
},
|
||||
"14": {
|
||||
"C_NAME": "GPIO27",
|
||||
"GPIO": "P27",
|
||||
"IRQ": null,
|
||||
"DVP": "MCLK"
|
||||
},
|
||||
"15": {
|
||||
"C_NAME": "GPIO30",
|
||||
"GPIO": "P30",
|
||||
"IRQ": null,
|
||||
"DVP": "HSYNC"
|
||||
},
|
||||
"16": {
|
||||
"C_NAME": "GPIO31",
|
||||
"GPIO": "P31",
|
||||
"IRQ": null,
|
||||
"DVP": "VSYNC"
|
||||
},
|
||||
"17": {
|
||||
"C_NAME": "GPIO34",
|
||||
"GPIO": "P34",
|
||||
"IRQ": null,
|
||||
"DVP": "PD2"
|
||||
},
|
||||
"18": {
|
||||
"C_NAME": "GPIO35",
|
||||
"GPIO": "P35",
|
||||
"IRQ": null,
|
||||
"DVP": "PD3"
|
||||
},
|
||||
"19": {
|
||||
"C_NAME": "GPIO36",
|
||||
"GPIO": "P36",
|
||||
"IRQ": null,
|
||||
"DVP": "PD4"
|
||||
},
|
||||
"20": {
|
||||
"C_NAME": "GPIO37",
|
||||
"GPIO": "P37",
|
||||
"IRQ": null,
|
||||
"DVP": "PD5"
|
||||
},
|
||||
"21": {
|
||||
"C_NAME": "GPIO38",
|
||||
"GPIO": "P38",
|
||||
"IRQ": null,
|
||||
"DVP": "PD6"
|
||||
},
|
||||
"22": {
|
||||
"C_NAME": "GPIO39",
|
||||
"GPIO": "P39",
|
||||
"IRQ": null,
|
||||
"DVP": "PD7"
|
||||
},
|
||||
"23": {
|
||||
"C_NAME": "GPIO14",
|
||||
"GPIO": "P14",
|
||||
"IRQ": null,
|
||||
"SD": "CLK",
|
||||
"SPI": "SCK"
|
||||
},
|
||||
"24": {
|
||||
"C_NAME": "GPIO16",
|
||||
"GPIO": "P16",
|
||||
"IRQ": null,
|
||||
"SD": "D0",
|
||||
"SPI": "MOSI"
|
||||
},
|
||||
"25": {
|
||||
"C_NAME": "GPIO15",
|
||||
"GPIO": "P15",
|
||||
"IRQ": null,
|
||||
"SD": "CMD",
|
||||
"SPI": "CS"
|
||||
},
|
||||
"26": {
|
||||
"C_NAME": "GPIO17",
|
||||
"GPIO": "P17",
|
||||
"IRQ": null,
|
||||
"SD": "D1",
|
||||
"SPI": "MISO"
|
||||
},
|
||||
"27": {
|
||||
"C_NAME": "GPIO23",
|
||||
"GPIO": "P23",
|
||||
"IRQ": null,
|
||||
"ADC": 3,
|
||||
"JTAG": "TDO",
|
||||
"FLASH": "FSO"
|
||||
},
|
||||
"28": {
|
||||
"C_NAME": "GPIO22",
|
||||
"GPIO": "P22",
|
||||
"IRQ": null,
|
||||
"JTAG": "TDI",
|
||||
"FLASH": "FSI"
|
||||
},
|
||||
"29": {
|
||||
"C_NAME": "GPIO21",
|
||||
"GPIO": "P21",
|
||||
"IRQ": null,
|
||||
"I2C": "1_SDA",
|
||||
"JTAG": "TMS",
|
||||
"I2S": "MCLK",
|
||||
"FLASH": "^FCS"
|
||||
},
|
||||
"30": {
|
||||
"C_NAME": "GPIO20",
|
||||
"GPIO": "P20",
|
||||
"IRQ": null,
|
||||
"I2C": "1_SCL",
|
||||
"JTAG": "TCK",
|
||||
"FLASH": "FSCK"
|
||||
},
|
||||
"31": {
|
||||
"IO": "I",
|
||||
"CTRL": "CEN"
|
||||
},
|
||||
"32": {
|
||||
"C_NAME": "GPIO8",
|
||||
"GPIO": "P8",
|
||||
"IRQ": null,
|
||||
"PWM": 2
|
||||
},
|
||||
"33": {
|
||||
"C_NAME": "GPIO9",
|
||||
"GPIO": "P9",
|
||||
"IRQ": null,
|
||||
"PWM": 3
|
||||
},
|
||||
"34": {
|
||||
"C_NAME": "GPIO10",
|
||||
"GPIO": "P10",
|
||||
"IRQ": null,
|
||||
"UART": "1_RX"
|
||||
},
|
||||
"35": {
|
||||
"C_NAME": "GPIO11",
|
||||
"GPIO": "P11",
|
||||
"IRQ": null,
|
||||
"UART": "1_TX"
|
||||
},
|
||||
"36": {
|
||||
"C_NAME": "GPIO1",
|
||||
"GPIO": "P1",
|
||||
"IRQ": null,
|
||||
"UART": "2_RX",
|
||||
"I2C": "2_SDA"
|
||||
},
|
||||
"37": {
|
||||
"C_NAME": "GPIO0",
|
||||
"GPIO": "P0",
|
||||
"IRQ": null,
|
||||
"UART": "2_TX",
|
||||
"I2C": "2_SCL"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
170
boards/_base/ic/bk7231q-qfn40.json
Normal file
170
boards/_base/ic/bk7231q-qfn40.json
Normal file
@@ -0,0 +1,170 @@
|
||||
{
|
||||
"pcb": {
|
||||
"ic": {
|
||||
"11": {
|
||||
"C_NAME": "GPIO30",
|
||||
"GPIO": "P30",
|
||||
"IRQ": null,
|
||||
"USB": "DN"
|
||||
},
|
||||
"12": {
|
||||
"C_NAME": "GPIO29",
|
||||
"GPIO": "P29",
|
||||
"IRQ": null,
|
||||
"USB": "DP"
|
||||
},
|
||||
"14": {
|
||||
"C_NAME": "GPIO6",
|
||||
"GPIO": "P6",
|
||||
"IRQ": null,
|
||||
"PWM": 0
|
||||
},
|
||||
"15": {
|
||||
"C_NAME": "GPIO7",
|
||||
"GPIO": "P7",
|
||||
"IRQ": null,
|
||||
"PWM": 1
|
||||
},
|
||||
"16": {
|
||||
"C_NAME": "GPIO8",
|
||||
"GPIO": "P8",
|
||||
"IRQ": null,
|
||||
"PWM": 2
|
||||
},
|
||||
"17": {
|
||||
"C_NAME": "GPIO17",
|
||||
"GPIO": "P17",
|
||||
"IRQ": null,
|
||||
"SD": "D1",
|
||||
"SPI": "MISO"
|
||||
},
|
||||
"18": {
|
||||
"C_NAME": "GPIO16",
|
||||
"GPIO": "P16",
|
||||
"IRQ": null,
|
||||
"SD": "D0",
|
||||
"SPI": "MOSI"
|
||||
},
|
||||
"19": {
|
||||
"C_NAME": "GPIO14",
|
||||
"GPIO": "P14",
|
||||
"IRQ": null,
|
||||
"SD": "CLK",
|
||||
"SPI": "SCK"
|
||||
},
|
||||
"20": {
|
||||
"C_NAME": "GPIO15",
|
||||
"GPIO": "P15",
|
||||
"IRQ": null,
|
||||
"SD": "CMD",
|
||||
"SPI": "CS"
|
||||
},
|
||||
"21": {
|
||||
"C_NAME": "GPIO19",
|
||||
"GPIO": "P19",
|
||||
"IRQ": null,
|
||||
"SD": "D3",
|
||||
"PWM": 5
|
||||
},
|
||||
"22": {
|
||||
"C_NAME": "GPIO18",
|
||||
"GPIO": "P18",
|
||||
"IRQ": null,
|
||||
"SD": "D2",
|
||||
"PWM": 4
|
||||
},
|
||||
"23": {
|
||||
"IO": "I",
|
||||
"CTRL": "TEST"
|
||||
},
|
||||
"24": {
|
||||
"C_NAME": "GPIO9",
|
||||
"GPIO": "P9",
|
||||
"IRQ": null,
|
||||
"PWM": 3
|
||||
},
|
||||
"25": {
|
||||
"C_NAME": "GPIO10",
|
||||
"GPIO": "P10",
|
||||
"IRQ": null,
|
||||
"UART": "1_RX"
|
||||
},
|
||||
"26": {
|
||||
"C_NAME": "GPIO11",
|
||||
"GPIO": "P11",
|
||||
"IRQ": null,
|
||||
"UART": "1_TX"
|
||||
},
|
||||
"27": {
|
||||
"C_NAME": "GPIO1",
|
||||
"GPIO": "P1",
|
||||
"IRQ": null,
|
||||
"UART": "2_RX",
|
||||
"I2C": "2_SDA"
|
||||
},
|
||||
"28": {
|
||||
"C_NAME": "GPIO0",
|
||||
"GPIO": "P0",
|
||||
"IRQ": null,
|
||||
"UART": "2_TX",
|
||||
"I2C": "2_SCL"
|
||||
},
|
||||
"29": {
|
||||
"C_NAME": "GPIO20",
|
||||
"GPIO": "P20",
|
||||
"IRQ": null,
|
||||
"I2C": "1_SCL",
|
||||
"JTAG": "TCK",
|
||||
"FLASH": "FSCK"
|
||||
},
|
||||
"30": {
|
||||
"C_NAME": "GPIO21",
|
||||
"GPIO": "P21",
|
||||
"IRQ": null,
|
||||
"I2C": "1_SDA",
|
||||
"JTAG": "TMS",
|
||||
"FLASH": "^FCS"
|
||||
},
|
||||
"31": {
|
||||
"C_NAME": "GPIO22",
|
||||
"GPIO": "P22",
|
||||
"IRQ": null,
|
||||
"JTAG": "TDI",
|
||||
"FLASH": "FSI"
|
||||
},
|
||||
"32": {
|
||||
"C_NAME": "GPIO23",
|
||||
"GPIO": "P23",
|
||||
"IRQ": null,
|
||||
"ADC": 3,
|
||||
"JTAG": "TDO",
|
||||
"FLASH": "FSO"
|
||||
},
|
||||
"33": {
|
||||
"C_NAME": "GPIO25",
|
||||
"GPIO": "P25",
|
||||
"IRQ": null
|
||||
},
|
||||
"34": {
|
||||
"C_NAME": "GPIO28",
|
||||
"GPIO": "P28",
|
||||
"IRQ": null
|
||||
},
|
||||
"35": {
|
||||
"C_NAME": "GPIO4",
|
||||
"GPIO": "P4",
|
||||
"IRQ": null,
|
||||
"ADC": 1,
|
||||
"I2S": "DIN"
|
||||
},
|
||||
"36": {
|
||||
"IO": "I",
|
||||
"CTRL": "CODE"
|
||||
},
|
||||
"37": {
|
||||
"IO": "I",
|
||||
"CTRL": "CEN"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
259
boards/_base/ic/bk7252-qfn68.json
Normal file
259
boards/_base/ic/bk7252-qfn68.json
Normal file
@@ -0,0 +1,259 @@
|
||||
{
|
||||
"pcb": {
|
||||
"ic": {
|
||||
"13": {
|
||||
"C_NAME": "GPIO28",
|
||||
"GPIO": "P28",
|
||||
"IRQ": null,
|
||||
"USB": "DN"
|
||||
},
|
||||
"14": {
|
||||
"C_NAME": "GPIO25",
|
||||
"GPIO": "P25",
|
||||
"IRQ": null,
|
||||
"USB": "DP"
|
||||
},
|
||||
"16": {
|
||||
"C_NAME": "GPIO12",
|
||||
"GPIO": "P12",
|
||||
"IRQ": null,
|
||||
"ADC": 6,
|
||||
"UART": "1_CTS"
|
||||
},
|
||||
"17": {
|
||||
"C_NAME": "GPIO13",
|
||||
"GPIO": "P13",
|
||||
"IRQ": null,
|
||||
"ADC": 7,
|
||||
"UART": "1_RTS"
|
||||
},
|
||||
"18": {
|
||||
"C_NAME": "GPIO33",
|
||||
"GPIO": "P33",
|
||||
"IRQ": null,
|
||||
"DVP": "PD1"
|
||||
},
|
||||
"19": {
|
||||
"C_NAME": "GPIO32",
|
||||
"GPIO": "P32",
|
||||
"IRQ": null,
|
||||
"DVP": "PD0"
|
||||
},
|
||||
"20": {
|
||||
"C_NAME": "GPIO29",
|
||||
"GPIO": "P29",
|
||||
"IRQ": null,
|
||||
"DVP": "PCLK"
|
||||
},
|
||||
"21": {
|
||||
"C_NAME": "GPIO27",
|
||||
"GPIO": "P27",
|
||||
"IRQ": null,
|
||||
"DVP": "MCLK"
|
||||
},
|
||||
"22": {
|
||||
"C_NAME": "GPIO30",
|
||||
"GPIO": "P30",
|
||||
"IRQ": null,
|
||||
"DVP": "HSYNC"
|
||||
},
|
||||
"23": {
|
||||
"C_NAME": "GPIO31",
|
||||
"GPIO": "P31",
|
||||
"IRQ": null,
|
||||
"DVP": "VSYNC"
|
||||
},
|
||||
"24": {
|
||||
"C_NAME": "GPIO34",
|
||||
"GPIO": "P34",
|
||||
"IRQ": null,
|
||||
"DVP": "PD2"
|
||||
},
|
||||
"25": {
|
||||
"C_NAME": "GPIO35",
|
||||
"GPIO": "P35",
|
||||
"IRQ": null,
|
||||
"DVP": "PD3"
|
||||
},
|
||||
"26": {
|
||||
"C_NAME": "GPIO36",
|
||||
"GPIO": "P36",
|
||||
"IRQ": null,
|
||||
"DVP": "PD4"
|
||||
},
|
||||
"27": {
|
||||
"C_NAME": "GPIO37",
|
||||
"GPIO": "P37",
|
||||
"IRQ": null,
|
||||
"DVP": "PD5"
|
||||
},
|
||||
"28": {
|
||||
"C_NAME": "GPIO38",
|
||||
"GPIO": "P38",
|
||||
"IRQ": null,
|
||||
"DVP": "PD6"
|
||||
},
|
||||
"29": {
|
||||
"C_NAME": "GPIO39",
|
||||
"GPIO": "P39",
|
||||
"IRQ": null,
|
||||
"DVP": "PD7"
|
||||
},
|
||||
"30": {
|
||||
"C_NAME": "GPIO19",
|
||||
"GPIO": "P19",
|
||||
"IRQ": null,
|
||||
"SD": "D3"
|
||||
},
|
||||
"31": {
|
||||
"C_NAME": "GPIO17",
|
||||
"GPIO": "P17",
|
||||
"IRQ": null,
|
||||
"SD": "D1",
|
||||
"SPI": "MISO"
|
||||
},
|
||||
"32": {
|
||||
"C_NAME": "GPIO14",
|
||||
"GPIO": "P14",
|
||||
"IRQ": null,
|
||||
"SD": "CLK",
|
||||
"SPI": "SCK"
|
||||
},
|
||||
"33": {
|
||||
"C_NAME": "GPIO16",
|
||||
"GPIO": "P16",
|
||||
"IRQ": null,
|
||||
"SD": "D0",
|
||||
"SPI": "MOSI"
|
||||
},
|
||||
"34": {
|
||||
"C_NAME": "GPIO15",
|
||||
"GPIO": "P15",
|
||||
"IRQ": null,
|
||||
"SD": "CMD",
|
||||
"SPI": "CS"
|
||||
},
|
||||
"35": {
|
||||
"C_NAME": "GPIO18",
|
||||
"GPIO": "P18",
|
||||
"IRQ": null,
|
||||
"SD": "D2"
|
||||
},
|
||||
"36": {
|
||||
"C_NAME": "GPIO24",
|
||||
"GPIO": "P24",
|
||||
"IRQ": null,
|
||||
"PWM": 4
|
||||
},
|
||||
"37": {
|
||||
"C_NAME": "GPIO26",
|
||||
"GPIO": "P26",
|
||||
"IRQ": null,
|
||||
"PWM": 5,
|
||||
"IRDA": null
|
||||
},
|
||||
"38": {
|
||||
"C_NAME": "GPIO23",
|
||||
"GPIO": "P23",
|
||||
"IRQ": null,
|
||||
"ADC": 3,
|
||||
"JTAG": "TDO",
|
||||
"FLASH": "FSO"
|
||||
},
|
||||
"39": {
|
||||
"C_NAME": "GPIO22",
|
||||
"GPIO": "P22",
|
||||
"IRQ": null,
|
||||
"JTAG": "TDI",
|
||||
"FLASH": "FSI"
|
||||
},
|
||||
"40": {
|
||||
"C_NAME": "GPIO21",
|
||||
"GPIO": "P21",
|
||||
"IRQ": null,
|
||||
"I2C": "1_SDA",
|
||||
"JTAG": "TMS",
|
||||
"I2S": "MCLK",
|
||||
"FLASH": "^FCS"
|
||||
},
|
||||
"41": {
|
||||
"C_NAME": "GPIO20",
|
||||
"GPIO": "P20",
|
||||
"IRQ": null,
|
||||
"I2C": "1_SCL",
|
||||
"JTAG": "TCK",
|
||||
"FLASH": "FSCK"
|
||||
},
|
||||
"43": {
|
||||
"IO": "I",
|
||||
"CTRL": "CEN"
|
||||
},
|
||||
"45": {
|
||||
"C_NAME": "GPIO5",
|
||||
"GPIO": "P5",
|
||||
"IRQ": null,
|
||||
"ADC": 2,
|
||||
"I2S": "DOUT"
|
||||
},
|
||||
"46": {
|
||||
"C_NAME": "GPIO3",
|
||||
"GPIO": "P3",
|
||||
"IRQ": null,
|
||||
"ADC": 5,
|
||||
"I2S": "WS"
|
||||
},
|
||||
"47": {
|
||||
"C_NAME": "GPIO4",
|
||||
"GPIO": "P4",
|
||||
"IRQ": null,
|
||||
"ADC": 1,
|
||||
"I2S": "DIN"
|
||||
},
|
||||
"48": {
|
||||
"C_NAME": "GPIO2",
|
||||
"GPIO": "P2",
|
||||
"IRQ": null,
|
||||
"ADC": 4,
|
||||
"I2S": "SCK"
|
||||
},
|
||||
"49": {
|
||||
"C_NAME": "GPIO6",
|
||||
"GPIO": "P6",
|
||||
"IRQ": null,
|
||||
"PWM": 0
|
||||
},
|
||||
"50": {
|
||||
"C_NAME": "GPIO7",
|
||||
"GPIO": "P7",
|
||||
"IRQ": null,
|
||||
"PWM": 1
|
||||
},
|
||||
"62": {
|
||||
"C_NAME": "GPIO10",
|
||||
"GPIO": "P10",
|
||||
"IRQ": null,
|
||||
"UART": "1_RX"
|
||||
},
|
||||
"63": {
|
||||
"C_NAME": "GPIO11",
|
||||
"GPIO": "P11",
|
||||
"IRQ": null,
|
||||
"UART": "1_TX"
|
||||
},
|
||||
"64": {
|
||||
"C_NAME": "GPIO1",
|
||||
"GPIO": "P1",
|
||||
"IRQ": null,
|
||||
"UART": "2_RX",
|
||||
"I2C": "2_SDA"
|
||||
},
|
||||
"65": {
|
||||
"C_NAME": "GPIO0",
|
||||
"GPIO": "P0",
|
||||
"IRQ": null,
|
||||
"UART": "2_TX",
|
||||
"I2C": "2_SCL"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
221
boards/_base/ic/ln882hk.json
Normal file
221
boards/_base/ic/ln882hk.json
Normal file
@@ -0,0 +1,221 @@
|
||||
{
|
||||
"pcb": {
|
||||
"ic": {
|
||||
"7": {
|
||||
"IO": "I",
|
||||
"CTRL": "CEN"
|
||||
},
|
||||
"8": {
|
||||
"C_NAME": "PA_0",
|
||||
"GPIO": "PA00",
|
||||
"IRQ": null,
|
||||
"ADC": 2,
|
||||
"I2C": [
|
||||
"0_SCL",
|
||||
"0_SDA"
|
||||
]
|
||||
},
|
||||
"9": {
|
||||
"C_NAME": "PA_1",
|
||||
"GPIO": "PA01",
|
||||
"IRQ": null,
|
||||
"ADC": 3,
|
||||
"SWD": "DIO",
|
||||
"I2C": [
|
||||
"0_SCL",
|
||||
"0_SDA"
|
||||
]
|
||||
},
|
||||
"10": {
|
||||
"C_NAME": "PA_2",
|
||||
"GPIO": "PA02",
|
||||
"IRQ": null,
|
||||
"UART": "0_TX",
|
||||
"I2C": [
|
||||
"0_SCL",
|
||||
"0_SDA"
|
||||
]
|
||||
},
|
||||
"11": {
|
||||
"C_NAME": "PA_3",
|
||||
"GPIO": "PA03",
|
||||
"IRQ": null,
|
||||
"UART": "0_RX",
|
||||
"I2C": [
|
||||
"0_SCL",
|
||||
"0_SDA"
|
||||
]
|
||||
},
|
||||
"12": {
|
||||
"C_NAME": "PA_4",
|
||||
"GPIO": "PA04",
|
||||
"IRQ": null,
|
||||
"ADC": 4,
|
||||
"SWD": "CLK",
|
||||
"I2C": [
|
||||
"0_SCL",
|
||||
"0_SDA"
|
||||
]
|
||||
},
|
||||
"13": {
|
||||
"C_NAME": "PA_5",
|
||||
"GPIO": "PA05",
|
||||
"IRQ": null,
|
||||
"I2C": [
|
||||
"0_SCL",
|
||||
"0_SDA"
|
||||
]
|
||||
},
|
||||
"14": {
|
||||
"C_NAME": "PA_6",
|
||||
"GPIO": "PA06",
|
||||
"IRQ": null,
|
||||
"SD": "D2",
|
||||
"I2C": [
|
||||
"0_SCL",
|
||||
"0_SDA"
|
||||
]
|
||||
},
|
||||
"15": {
|
||||
"C_NAME": "PA_7",
|
||||
"GPIO": "PA07",
|
||||
"IRQ": null,
|
||||
"SD": "D3",
|
||||
"I2S": "0_RX",
|
||||
"I2C": [
|
||||
"0_SCL",
|
||||
"0_SDA"
|
||||
]
|
||||
},
|
||||
"16": {
|
||||
"C_NAME": "PA_8",
|
||||
"GPIO": "PA08",
|
||||
"IRQ": null,
|
||||
"CTRL": "BOOT0",
|
||||
"SD": "CMD",
|
||||
"I2S": "0_WS",
|
||||
"I2C": [
|
||||
"0_SCL",
|
||||
"0_SDA"
|
||||
]
|
||||
},
|
||||
"17": {
|
||||
"C_NAME": "PA_9",
|
||||
"GPIO": "PA09",
|
||||
"IRQ": null,
|
||||
"CTRL": "BOOT1",
|
||||
"SD": "CLK",
|
||||
"I2S": "0_SCLK",
|
||||
"I2C": [
|
||||
"0_SCL",
|
||||
"0_SDA"
|
||||
]
|
||||
},
|
||||
"21": {
|
||||
"C_NAME": "PA_10",
|
||||
"GPIO": "PA10",
|
||||
"IRQ": null,
|
||||
"SD": "D0",
|
||||
"I2S": "0_TX",
|
||||
"I2C": [
|
||||
"0_SCL",
|
||||
"0_SDA"
|
||||
]
|
||||
},
|
||||
"22": {
|
||||
"C_NAME": "PA_11",
|
||||
"GPIO": "PA11",
|
||||
"IRQ": null,
|
||||
"SD": "D1",
|
||||
"I2C": [
|
||||
"0_SCL",
|
||||
"0_SDA"
|
||||
]
|
||||
},
|
||||
"23": {
|
||||
"C_NAME": "PA_12",
|
||||
"GPIO": "PA12",
|
||||
"IRQ": null,
|
||||
"I2C": [
|
||||
"0_SCL",
|
||||
"0_SDA"
|
||||
]
|
||||
},
|
||||
"24": {
|
||||
"C_NAME": "PB_3",
|
||||
"GPIO": "PB03",
|
||||
"GPIONUM": 19,
|
||||
"IRQ": null,
|
||||
"ADC": 5,
|
||||
"I2C": [
|
||||
"0_SCL",
|
||||
"0_SDA"
|
||||
]
|
||||
},
|
||||
"25": {
|
||||
"C_NAME": "PB_4",
|
||||
"GPIO": "PB04",
|
||||
"GPIONUM": 20,
|
||||
"IRQ": null,
|
||||
"ADC": 6,
|
||||
"I2C": [
|
||||
"0_SCL",
|
||||
"0_SDA"
|
||||
]
|
||||
},
|
||||
"26": {
|
||||
"C_NAME": "PB_5",
|
||||
"GPIO": "PB05",
|
||||
"GPIONUM": 21,
|
||||
"IRQ": null,
|
||||
"ADC": 7,
|
||||
"I2C": [
|
||||
"0_SCL",
|
||||
"0_SDA"
|
||||
]
|
||||
},
|
||||
"27": {
|
||||
"C_NAME": "PB_6",
|
||||
"GPIO": "PB06",
|
||||
"GPIONUM": 22,
|
||||
"IRQ": null,
|
||||
"I2C": [
|
||||
"0_SCL",
|
||||
"0_SDA"
|
||||
]
|
||||
},
|
||||
"28": {
|
||||
"C_NAME": "PB_7",
|
||||
"GPIO": "PB07",
|
||||
"GPIONUM": 23,
|
||||
"IRQ": null,
|
||||
"I2C": [
|
||||
"0_SCL",
|
||||
"0_SDA"
|
||||
]
|
||||
},
|
||||
"29": {
|
||||
"C_NAME": "PB_8",
|
||||
"GPIO": "PB08",
|
||||
"GPIONUM": 24,
|
||||
"IRQ": null,
|
||||
"UART": "1_RX",
|
||||
"I2C": [
|
||||
"0_SCL",
|
||||
"0_SDA"
|
||||
]
|
||||
},
|
||||
"30": {
|
||||
"C_NAME": "PB_9",
|
||||
"GPIO": "PB09",
|
||||
"GPIONUM": 25,
|
||||
"IRQ": null,
|
||||
"UART": "1_TX",
|
||||
"I2C": [
|
||||
"0_SCL",
|
||||
"0_SDA"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
167
boards/_base/ic/rtl8710bn.json
Normal file
167
boards/_base/ic/rtl8710bn.json
Normal file
@@ -0,0 +1,167 @@
|
||||
{
|
||||
"pcb": {
|
||||
"ic": {
|
||||
"1": {
|
||||
"C_NAME": "PA_30",
|
||||
"GPIO": "PA30",
|
||||
"IRQ": null,
|
||||
"UART": "2_TX",
|
||||
"I2C": "0_SDA",
|
||||
"PWM": 4,
|
||||
"RTC": "OUT"
|
||||
},
|
||||
"2": {
|
||||
"C_NAME": "PA_29",
|
||||
"GPIO": "PA29",
|
||||
"IRQ": null,
|
||||
"UART": "2_RX",
|
||||
"I2C": "0_SCL",
|
||||
"PWM": 4
|
||||
},
|
||||
"12": {
|
||||
"IO": "I",
|
||||
"CTRL": "CEN"
|
||||
},
|
||||
"13": {
|
||||
"C_NAME": "PA_14",
|
||||
"GPIO": "PA14",
|
||||
"IRQ": null,
|
||||
"PWM": 0,
|
||||
"SWD": "CLK"
|
||||
},
|
||||
"14": {
|
||||
"C_NAME": "PA_15",
|
||||
"GPIO": "PA15",
|
||||
"IRQ": null,
|
||||
"PWM": 1,
|
||||
"SWD": "DIO"
|
||||
},
|
||||
"16": {
|
||||
"C_NAME": "PA_0",
|
||||
"GPIO": "PA00",
|
||||
"IRQ": null,
|
||||
"PWM": 2
|
||||
},
|
||||
"17": {
|
||||
"C_NAME": "PA_12",
|
||||
"GPIO": "PA12",
|
||||
"IRQ": null,
|
||||
"PWM": 3
|
||||
},
|
||||
"18": {
|
||||
"C_NAME": "PA_6",
|
||||
"GPIO": "PA06",
|
||||
"IRQ": null,
|
||||
"SPI": "FCS",
|
||||
"SD": "D2"
|
||||
},
|
||||
"19": {
|
||||
"C_NAME": "PA_7",
|
||||
"GPIO": "PA07",
|
||||
"IRQ": null,
|
||||
"SPI": "FD1",
|
||||
"SD": "D3"
|
||||
},
|
||||
"20": {
|
||||
"C_NAME": "PA_8",
|
||||
"GPIO": "PA08",
|
||||
"IRQ": null,
|
||||
"SPI": "FD2",
|
||||
"SD": "CMD"
|
||||
},
|
||||
"21": {
|
||||
"C_NAME": "PA_9",
|
||||
"GPIO": "PA09",
|
||||
"IRQ": null,
|
||||
"SPI": "FD0",
|
||||
"SD": "CLK"
|
||||
},
|
||||
"22": {
|
||||
"C_NAME": "PA_10",
|
||||
"GPIO": "PA10",
|
||||
"IRQ": null,
|
||||
"SPI": "FSCK",
|
||||
"SD": "D0"
|
||||
},
|
||||
"23": {
|
||||
"C_NAME": "PA_11",
|
||||
"GPIO": "PA11",
|
||||
"IRQ": null,
|
||||
"SPI": "FD3",
|
||||
"SD": "D1"
|
||||
},
|
||||
"27": {
|
||||
"C_NAME": "AD_2",
|
||||
"GPIONUM": 41,
|
||||
"IO": "I",
|
||||
"ADC": 2
|
||||
},
|
||||
"28": {
|
||||
"C_NAME": "PA_5",
|
||||
"GPIO": "PA05",
|
||||
"IRQ": null,
|
||||
"PWM": 4,
|
||||
"WAKE": 1
|
||||
},
|
||||
"29": {
|
||||
"C_NAME": "PA_18",
|
||||
"GPIO": "PA18",
|
||||
"IRQ": null,
|
||||
"UART": "0_RX",
|
||||
"SPI": [
|
||||
"0_SCK",
|
||||
"1_SCK"
|
||||
],
|
||||
"I2C": "1_SCL",
|
||||
"SD": "D2",
|
||||
"TMR": "4_TRIG",
|
||||
"I2S": "0_MCK",
|
||||
"WAKE": 0
|
||||
},
|
||||
"30": {
|
||||
"C_NAME": "PA_19",
|
||||
"GPIO": "PA19",
|
||||
"IRQ": null,
|
||||
"ADC": 1,
|
||||
"UART": "0_CTS",
|
||||
"SPI": [
|
||||
"0_CS",
|
||||
"1_CS"
|
||||
],
|
||||
"I2C": "0_SDA",
|
||||
"SD": "D3",
|
||||
"TMR": "5_TRIG",
|
||||
"I2S": "0_TX"
|
||||
},
|
||||
"31": {
|
||||
"C_NAME": "PA_22",
|
||||
"GPIO": "PA22",
|
||||
"IRQ": null,
|
||||
"UART": "0_RTS",
|
||||
"SPI": [
|
||||
"0_MISO",
|
||||
"1_MISO"
|
||||
],
|
||||
"I2C": "0_SCL",
|
||||
"SD": "D0",
|
||||
"PWM": 5,
|
||||
"I2S": "0_WS",
|
||||
"WAKE": 2
|
||||
},
|
||||
"32": {
|
||||
"C_NAME": "PA_23",
|
||||
"GPIO": "PA23",
|
||||
"IRQ": null,
|
||||
"UART": "0_TX",
|
||||
"SPI": [
|
||||
"0_MOSI",
|
||||
"1_MOSI"
|
||||
],
|
||||
"I2C": "1_SDA",
|
||||
"SD": "D1",
|
||||
"PWM": 0,
|
||||
"WAKE": 3
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
186
boards/_base/ic/rtl8720cf.json
Normal file
186
boards/_base/ic/rtl8720cf.json
Normal file
@@ -0,0 +1,186 @@
|
||||
{
|
||||
"pcb": {
|
||||
"ic": {
|
||||
"1": {
|
||||
"C_NAME": "PIN_A20",
|
||||
"GPIO": "PA20",
|
||||
"IRQ": null,
|
||||
"SD": "D1",
|
||||
"SPI":
|
||||
"0_MISO"
|
||||
,
|
||||
"UART": "2_RTS",
|
||||
"I2C": "0_SDA",
|
||||
"PWM": 0
|
||||
},
|
||||
"3": {
|
||||
"C_NAME": "PIN_A23",
|
||||
"GPIO": "PA23",
|
||||
"IRQ": null,
|
||||
"PWM": 7
|
||||
},
|
||||
"14": {
|
||||
"IO": "I",
|
||||
"CTRL": "CEN"
|
||||
},
|
||||
"15": {
|
||||
"C_NAME": "PIN_A0",
|
||||
"GPIO": "PA00",
|
||||
"IRQ": null,
|
||||
"JTAG": "TCK",
|
||||
"UART": "1_RX",
|
||||
"PWM": 0,
|
||||
"SWD": "CLK"
|
||||
},
|
||||
"16": {
|
||||
"C_NAME": "PIN_A1",
|
||||
"GPIO": "PA01",
|
||||
"IRQ": null,
|
||||
"JTAG": "TMS",
|
||||
"UART": "1_TX",
|
||||
"PWM": 1,
|
||||
"SWD": "DIO"
|
||||
},
|
||||
"18": {
|
||||
"C_NAME": "PIN_A2",
|
||||
"GPIO": "PA02",
|
||||
"IRQ": null,
|
||||
"JTAG": "TDO",
|
||||
"UART": "1_RX",
|
||||
"SPI": "0_CS",
|
||||
"I2C": "0_SCL",
|
||||
"PWM": 2
|
||||
},
|
||||
"19": {
|
||||
"C_NAME": "PIN_A3",
|
||||
"GPIO": "PA03",
|
||||
"IRQ": null,
|
||||
"JTAG": "TDI",
|
||||
"UART": "1_TX",
|
||||
"SPI": "0_SCK",
|
||||
"I2C": "0_SDA",
|
||||
"PWM": 3
|
||||
},
|
||||
"20": {
|
||||
"C_NAME": "PIN_A4",
|
||||
"GPIO": "PA04",
|
||||
"IRQ": null,
|
||||
"JTAG": "tRST",
|
||||
"UART": "1_CTS",
|
||||
"SPI": "0_MOSI",
|
||||
"PWM": 4
|
||||
},
|
||||
"21": {
|
||||
"C_NAME": "PIN_A7",
|
||||
"GPIO": "PA07",
|
||||
"IRQ": null,
|
||||
"FLASH": "^FCS",
|
||||
"SPI": "0_CS"
|
||||
},
|
||||
"22": {
|
||||
"C_NAME": "PIN_A8",
|
||||
"GPIO": "PA08",
|
||||
"IRQ": null,
|
||||
"FLASH": "FSCK",
|
||||
"SPI": "0_SCK"
|
||||
},
|
||||
"23": {
|
||||
"C_NAME": "PIN_A9",
|
||||
"GPIO": "PA09",
|
||||
"IRQ": null,
|
||||
"FLASH": "FD2",
|
||||
"SPI": "0_MOSI",
|
||||
"UART": "0_RTS"
|
||||
},
|
||||
"24": {
|
||||
"C_NAME": "PIN_A10",
|
||||
"GPIO": "PA10",
|
||||
"IRQ": null,
|
||||
"FLASH": "FD1",
|
||||
"SPI": "0_MISO",
|
||||
"UART": "0_CTS"
|
||||
},
|
||||
"25": {
|
||||
"C_NAME": "PIN_A11",
|
||||
"GPIO": "PA11",
|
||||
"IRQ": null,
|
||||
"FLASH": "FD0",
|
||||
"UART": "0_TX",
|
||||
"I2C": "0_SCL",
|
||||
"PWM": 0
|
||||
},
|
||||
"26": {
|
||||
"C_NAME": "PIN_A12",
|
||||
"GPIO": "PA12",
|
||||
"IRQ": null,
|
||||
"FLASH": "FD3",
|
||||
"UART": "0_RX",
|
||||
"I2C": "0_SDA",
|
||||
"PWM": 1
|
||||
},
|
||||
"30": {
|
||||
"IO": "I",
|
||||
"C_NAME": "VBAT_IN"
|
||||
},
|
||||
"33": {
|
||||
"C_NAME": "PIN_A13",
|
||||
"GPIO": "PA13",
|
||||
"IRQ": null,
|
||||
"UART": "0_RX",
|
||||
"PWM": 7
|
||||
},
|
||||
"34": {
|
||||
"C_NAME": "PIN_A14",
|
||||
"GPIO": "PA14",
|
||||
"IRQ": null,
|
||||
"SD": "INT",
|
||||
"UART": "0_TX",
|
||||
"PWM": 2
|
||||
},
|
||||
"36": {
|
||||
"C_NAME": "PIN_A15",
|
||||
"GPIO": "PA15",
|
||||
"IRQ": null,
|
||||
"SD": "D2",
|
||||
"SPI": "0_CS",
|
||||
"UART": "2_RX",
|
||||
"I2C": "0_SCL",
|
||||
"PWM": 3
|
||||
},
|
||||
"37": {
|
||||
"C_NAME": "PIN_A16",
|
||||
"GPIO": "PA16",
|
||||
"IRQ": null,
|
||||
"SD": "D3",
|
||||
"SPI": "0_SCK",
|
||||
"UART": "2_TX",
|
||||
"I2C": "0_SDA",
|
||||
"PWM": 4
|
||||
},
|
||||
"38": {
|
||||
"C_NAME": "PIN_A17",
|
||||
"GPIO": "PA17",
|
||||
"IRQ": null,
|
||||
"SD": "CMD",
|
||||
"PWM": 5
|
||||
},
|
||||
"39": {
|
||||
"C_NAME": "PIN_A18",
|
||||
"GPIO": "PA18",
|
||||
"IRQ": null,
|
||||
"SD": "CLK",
|
||||
"PWM": 6
|
||||
},
|
||||
"40": {
|
||||
"C_NAME": "PIN_A19",
|
||||
"GPIO": "PA19",
|
||||
"IRQ": null,
|
||||
"SD": "D0",
|
||||
"SPI": "0_MOSI",
|
||||
"UART": "2_CTS",
|
||||
"I2C": "0_SCL",
|
||||
"PWM": 7
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
31
boards/_base/lightning-ln882hki.json
Normal file
31
boards/_base/lightning-ln882hki.json
Normal file
@@ -0,0 +1,31 @@
|
||||
{
|
||||
"build": {
|
||||
"family": "LN882H",
|
||||
"ldscript": "ln882hki_bsp.ld",
|
||||
"bootfile": "boot_ln882h.bin"
|
||||
},
|
||||
"flash": {
|
||||
"boot": "0x000000+0x06000",
|
||||
"part_tab": "0x006000+0x01000",
|
||||
"app": "0x007000+0x12C000",
|
||||
"ota": "0x133000+0xAA000",
|
||||
"nvds": "0x1DD000+0x03000",
|
||||
"kv": "0x1E0000+0x04000",
|
||||
"kvs": "0x1E4000+0x08000",
|
||||
"user": "0x1EC000+0x14000"
|
||||
},
|
||||
"upload": {
|
||||
"flash_size": 2097152,
|
||||
"maximum_size": 1228800
|
||||
},
|
||||
"connectivity": [
|
||||
"ble"
|
||||
],
|
||||
"doc": {
|
||||
"params": {
|
||||
"extra": {
|
||||
"Bluetooth": "BLE v5.1"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
43
boards/_base/lightning-ln882x.json
Normal file
43
boards/_base/lightning-ln882x.json
Normal file
@@ -0,0 +1,43 @@
|
||||
{
|
||||
"build": {
|
||||
"f_cpu": "160000000L",
|
||||
"prefix": "arm-none-eabi-"
|
||||
},
|
||||
"flash": {},
|
||||
"connectivity": [
|
||||
"wifi"
|
||||
],
|
||||
"debug": {
|
||||
"protocol": "openocd",
|
||||
"protocols": [
|
||||
"openocd"
|
||||
],
|
||||
"openocd_config": "ln882x.cfg",
|
||||
"gdb_init": [
|
||||
"mem 0x00000000 0x10000000 ro"
|
||||
]
|
||||
},
|
||||
"upload": {
|
||||
"maximum_ram_size": 302080,
|
||||
"require_upload_port": true,
|
||||
"speed": 115200,
|
||||
"protocol": "uart",
|
||||
"protocols": [
|
||||
"uart"
|
||||
]
|
||||
},
|
||||
"doc": {
|
||||
"params": {
|
||||
"manufacturer": "Lightning",
|
||||
"series": "LN882X",
|
||||
"voltage": "3.0V - 3.6V",
|
||||
"extra": {
|
||||
"Wi-Fi": "802.11 b/g/n"
|
||||
}
|
||||
},
|
||||
"links": {
|
||||
"Info & flashing guide": "../../docs/platform/lightning-ln882x/README.md",
|
||||
"Debugging": "../../docs/platform/lightning-ln882x/debugging.md"
|
||||
}
|
||||
}
|
||||
}
|
||||
90
boards/_base/pcb/afw121t.json
Normal file
90
boards/_base/pcb/afw121t.json
Normal file
@@ -0,0 +1,90 @@
|
||||
{
|
||||
"pcb": {
|
||||
"templates": [
|
||||
"99iot-21p",
|
||||
"pcb-blue-light",
|
||||
"rf-type1"
|
||||
],
|
||||
"scale": 16,
|
||||
"vars": {
|
||||
"TRACE_COLOR": "#FAFD9D"
|
||||
},
|
||||
"pinout_hidden": "I2S,TRIG,WAKE,CTS,RTS,SD",
|
||||
"pinout": {
|
||||
"1": {
|
||||
"GND": null
|
||||
},
|
||||
"2": {
|
||||
"CTRL": "RF_O"
|
||||
},
|
||||
"3": {
|
||||
"GND": null
|
||||
},
|
||||
"4": {
|
||||
"NC": null
|
||||
},
|
||||
"5": {
|
||||
"CTRL": "CEN"
|
||||
},
|
||||
"6": {
|
||||
"IC": 13,
|
||||
"ARD": "D0"
|
||||
},
|
||||
"7": {
|
||||
"IC": 14,
|
||||
"ARD": "D1"
|
||||
},
|
||||
"8": {
|
||||
"IC": 16,
|
||||
"ARD": "D2"
|
||||
},
|
||||
"9": {
|
||||
"IC": 17,
|
||||
"ARD": "D3"
|
||||
},
|
||||
"10": {
|
||||
"GND": null
|
||||
},
|
||||
"11": {
|
||||
"PWR": 3.3
|
||||
},
|
||||
"12": {
|
||||
"GND": null
|
||||
},
|
||||
"13": {
|
||||
"NC": null
|
||||
},
|
||||
"14": {
|
||||
"IC": 28,
|
||||
"ARD": "D5"
|
||||
},
|
||||
"15": {
|
||||
"IC": 29,
|
||||
"ARD": "D6"
|
||||
},
|
||||
"16": {
|
||||
"IC": 30,
|
||||
"ARD": "D7"
|
||||
},
|
||||
"17": {
|
||||
"IC": 31,
|
||||
"ARD": "D8"
|
||||
},
|
||||
"18": {
|
||||
"IC": 32,
|
||||
"ARD": "D9"
|
||||
},
|
||||
"19": {
|
||||
"IC": 1,
|
||||
"ARD": "D10"
|
||||
},
|
||||
"20": {
|
||||
"IC": 2,
|
||||
"ARD": "D4"
|
||||
},
|
||||
"21": {
|
||||
"GND": null
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
78
boards/_base/pcb/bw12.json
Normal file
78
boards/_base/pcb/bw12.json
Normal file
@@ -0,0 +1,78 @@
|
||||
{
|
||||
"pcb": {
|
||||
"templates": [
|
||||
"esp12s",
|
||||
"pcb-black",
|
||||
"rf-type1"
|
||||
],
|
||||
"vars": {
|
||||
"TRACE_COLOR": "#FAFD9D"
|
||||
},
|
||||
"pinout_hidden": "I2S,TRIG,WAKE,CTS,RTS,SD",
|
||||
"pinout": {
|
||||
"1": {
|
||||
"IC": 14,
|
||||
"ARD": "D8"
|
||||
},
|
||||
"2": {
|
||||
"NC": null
|
||||
},
|
||||
"3": {
|
||||
"IC": 12
|
||||
},
|
||||
"4": {
|
||||
"IC": 28,
|
||||
"ARD": "D0"
|
||||
},
|
||||
"5": {
|
||||
"IC": 2,
|
||||
"ARD": "D1"
|
||||
},
|
||||
"6": {
|
||||
"IC": 16,
|
||||
"ARD": "D2"
|
||||
},
|
||||
"7": {
|
||||
"IC": 30,
|
||||
"ARD": [
|
||||
"D3",
|
||||
"A0"
|
||||
]
|
||||
},
|
||||
"8": {
|
||||
"PWR": 3.3
|
||||
},
|
||||
"9": {
|
||||
"GND": null
|
||||
},
|
||||
"10": {
|
||||
"IC": 31,
|
||||
"ARD": "D4"
|
||||
},
|
||||
"11": {
|
||||
"IC": 1,
|
||||
"ARD": "D5"
|
||||
},
|
||||
"12": {
|
||||
"IC": 13,
|
||||
"ARD": "D6"
|
||||
},
|
||||
"13": {
|
||||
"IC": 17,
|
||||
"ARD": "D7"
|
||||
},
|
||||
"14": {
|
||||
"IC": 14,
|
||||
"ARD": "D8"
|
||||
},
|
||||
"15": {
|
||||
"IC": 29,
|
||||
"ARD": "D9"
|
||||
},
|
||||
"16": {
|
||||
"IC": 32,
|
||||
"ARD": "D10"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
73
boards/_base/pcb/bw15.json
Normal file
73
boards/_base/pcb/bw15.json
Normal file
@@ -0,0 +1,73 @@
|
||||
{
|
||||
"pcb": {
|
||||
"templates": [
|
||||
"esp12s",
|
||||
"pcb-black",
|
||||
"rf-type1"
|
||||
],
|
||||
"pinout_hidden": "I2S,TRIG,WAKE,CTS,RTS,SD",
|
||||
"pinout": {
|
||||
"1": {
|
||||
"IC": 38,
|
||||
"ARD": "D0"
|
||||
},
|
||||
"2": {
|
||||
"IC": 39,
|
||||
"ARD": "D1"
|
||||
},
|
||||
"3": {
|
||||
"IC": 14
|
||||
},
|
||||
"4": {
|
||||
"IC": 18,
|
||||
"ARD": "D2"
|
||||
},
|
||||
"5": {
|
||||
"IC": 36,
|
||||
"ARD": "D3"
|
||||
},
|
||||
"6": {
|
||||
"IC": 20,
|
||||
"ARD": "D4"
|
||||
},
|
||||
"7": {
|
||||
"IC": 40,
|
||||
"ARD": "D5"
|
||||
},
|
||||
"8": {
|
||||
"PWR": 3.3
|
||||
},
|
||||
"9": {
|
||||
"GND": null
|
||||
},
|
||||
"10": {
|
||||
"IC": 1,
|
||||
"ARD": "D6"
|
||||
},
|
||||
"11": {
|
||||
"IC": 37,
|
||||
"ARD": "D7"
|
||||
},
|
||||
"12": {
|
||||
"IC": 15,
|
||||
"ARD": "D8"
|
||||
},
|
||||
"13": {
|
||||
"IC": 19,
|
||||
"ARD": "D9"
|
||||
},
|
||||
"14": {
|
||||
"IC": 16,
|
||||
"ARD": "D10"
|
||||
},
|
||||
"15": {
|
||||
"IC": 33,
|
||||
"ARD": "D11"
|
||||
},
|
||||
"16": {
|
||||
"IC": 34,
|
||||
"ARD": "D12"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
69
boards/_base/pcb/cb1s-test.json
Normal file
69
boards/_base/pcb/cb1s-test.json
Normal file
@@ -0,0 +1,69 @@
|
||||
{
|
||||
"pcb": {
|
||||
"scale": 14,
|
||||
"test_pads": {
|
||||
"TSCK": "cb1s.back.sck.anchor",
|
||||
"TCSN": "cb1s.back.csn.anchor",
|
||||
"TSI": "cb1s.back.si.anchor",
|
||||
"TSO": "cb1s.back.so.anchor"
|
||||
},
|
||||
"back": [
|
||||
{
|
||||
"name": "test_pad_1mm",
|
||||
"pos": "2.66,14.4"
|
||||
},
|
||||
{
|
||||
"name": "test_pad_1mm",
|
||||
"pos": "2.66,15.9"
|
||||
},
|
||||
{
|
||||
"name": "test_pad_1mm",
|
||||
"pos": "2.66,17.4"
|
||||
},
|
||||
{
|
||||
"name": "test_pad_1mm",
|
||||
"pos": "2.66,18.9"
|
||||
},
|
||||
{
|
||||
"id": "sck",
|
||||
"name": "label_line_down",
|
||||
"pos": "3.5,14.3",
|
||||
"vars": {
|
||||
"DIR": "right",
|
||||
"W": 1.0,
|
||||
"H": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "csn",
|
||||
"name": "label_line_down",
|
||||
"pos": "3.5,15.8",
|
||||
"vars": {
|
||||
"DIR": "right",
|
||||
"W": 1.0,
|
||||
"H": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "si",
|
||||
"name": "label_line_down",
|
||||
"pos": "3.5,17.3",
|
||||
"vars": {
|
||||
"DIR": "right",
|
||||
"W": 1.0,
|
||||
"H": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "so",
|
||||
"name": "label_line_down",
|
||||
"pos": "3.5,18.8",
|
||||
"vars": {
|
||||
"DIR": "right",
|
||||
"W": 1.0,
|
||||
"H": 0
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
101
boards/_base/pcb/cb1s.json
Normal file
101
boards/_base/pcb/cb1s.json
Normal file
@@ -0,0 +1,101 @@
|
||||
{
|
||||
"pcb": {
|
||||
"templates": [
|
||||
"tuya1",
|
||||
"pcb-blue-light",
|
||||
"tuya-16x24",
|
||||
"rf-type1"
|
||||
],
|
||||
"scale": 15,
|
||||
"pinout_hidden": "I2S,TRIG,WAKE,CTS,RTS,SD",
|
||||
"pinout": {
|
||||
"1": {
|
||||
"PWR": "VCC5"
|
||||
},
|
||||
"2": {
|
||||
"IC": 27,
|
||||
"ARD": "D0"
|
||||
},
|
||||
"3": {
|
||||
"IC": 26,
|
||||
"ARD": "D1"
|
||||
},
|
||||
"4": {
|
||||
"PWR": 3.3
|
||||
},
|
||||
"5": {
|
||||
"GND": null
|
||||
},
|
||||
"6": {
|
||||
"IC": 22,
|
||||
"ARD": "D2"
|
||||
},
|
||||
"7": {
|
||||
"IC": 23,
|
||||
"ARD": "D3"
|
||||
},
|
||||
"8": {
|
||||
"IC": 29,
|
||||
"ARD": "D4"
|
||||
},
|
||||
"9": {
|
||||
"IC": 25,
|
||||
"ARD": "D5"
|
||||
},
|
||||
"10": {
|
||||
"IC": 24,
|
||||
"ARD": "D6"
|
||||
},
|
||||
"11": {
|
||||
"IC": 28,
|
||||
"ARD": "D7"
|
||||
},
|
||||
"12": {
|
||||
"IC": 16,
|
||||
"ARD": "D8"
|
||||
},
|
||||
"13": {
|
||||
"IC": 15,
|
||||
"ARD": "D9"
|
||||
},
|
||||
"14": {
|
||||
"GND": null
|
||||
},
|
||||
"15": {
|
||||
"GND": null
|
||||
},
|
||||
"16": {
|
||||
"IC": 21
|
||||
},
|
||||
"17": {
|
||||
"IC": 17,
|
||||
"ARD": [
|
||||
"D10",
|
||||
"A0"
|
||||
]
|
||||
},
|
||||
"18": {
|
||||
"GND": null
|
||||
},
|
||||
"TSCK": {
|
||||
"IC": 20,
|
||||
"ARD": "D11"
|
||||
},
|
||||
"TCSN": {
|
||||
"IC": 19,
|
||||
"ARD": "D12"
|
||||
},
|
||||
"TSO": {
|
||||
"IC": 17,
|
||||
"ARD": [
|
||||
"D10",
|
||||
"A0"
|
||||
]
|
||||
},
|
||||
"TSI": {
|
||||
"IC": 18,
|
||||
"ARD": "D13"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
105
boards/_base/pcb/cb2l-test.json
Normal file
105
boards/_base/pcb/cb2l-test.json
Normal file
@@ -0,0 +1,105 @@
|
||||
{
|
||||
"pcb": {
|
||||
"test_pads": {
|
||||
"TRST": "cb2l.back.rst.anchor",
|
||||
"TRX1": "cb2l.back.u1_rxd.anchor",
|
||||
"TTX1": "cb2l.back.u1_txd.anchor",
|
||||
"TTX2": "cb2l.back.u2_txd.anchor",
|
||||
"TGND": "cb2l.back.gnd.anchor",
|
||||
"TCSN": "cb2l.back.f_csn.anchor"
|
||||
},
|
||||
"back": [
|
||||
{
|
||||
"name": "test_pad_1mm",
|
||||
"pos": "1.5,7.5"
|
||||
},
|
||||
{
|
||||
"name": "label_line_down",
|
||||
"pos": "0.4,4.7",
|
||||
"vars": {
|
||||
"DIR": "right",
|
||||
"W": 0.2,
|
||||
"H": 2.7
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "u1_rxd.anchor",
|
||||
"type": "rect",
|
||||
"pos": "0.9,5.0",
|
||||
"size": "0,0",
|
||||
"label_dir": "left",
|
||||
"label_size": 2
|
||||
},
|
||||
{
|
||||
"name": "test_pad_1mm",
|
||||
"pos": "2.2,5.9"
|
||||
},
|
||||
{
|
||||
"id": "u2_txd",
|
||||
"name": "label_line_up",
|
||||
"pos": "2.2,5.1",
|
||||
"vars": {
|
||||
"DIR": "left",
|
||||
"W": 1.5,
|
||||
"H": 2
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "test_pad_1mm",
|
||||
"pos": "4.0,5.9"
|
||||
},
|
||||
{
|
||||
"id": "u1_txd",
|
||||
"name": "label_line_up",
|
||||
"pos": "4.0,5.1",
|
||||
"vars": {
|
||||
"DIR": "left",
|
||||
"W": 3.3,
|
||||
"H": 4
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "test_pad_1mm",
|
||||
"pos": "9.2,5.9"
|
||||
},
|
||||
{
|
||||
"id": "gnd",
|
||||
"name": "label_line_up",
|
||||
"pos": "9.2,5.1",
|
||||
"vars": {
|
||||
"DIR": "left",
|
||||
"W": 8.5,
|
||||
"H": 6
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "test_pad_1mm",
|
||||
"pos": "2.2,10.7"
|
||||
},
|
||||
{
|
||||
"id": "rst",
|
||||
"name": "label_line_up",
|
||||
"pos": "2.2,9.9",
|
||||
"vars": {
|
||||
"DIR": "left",
|
||||
"W": 1.5,
|
||||
"H": 1.0
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "test_pad_1mm",
|
||||
"pos": "2.2,12.0"
|
||||
},
|
||||
{
|
||||
"id": "f_csn",
|
||||
"name": "label_line_down",
|
||||
"pos": "2.2,12.8",
|
||||
"vars": {
|
||||
"DIR": "left",
|
||||
"W": 1.5,
|
||||
"H": 1.0
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
60
boards/_base/pcb/cb2l.json
Normal file
60
boards/_base/pcb/cb2l.json
Normal file
@@ -0,0 +1,60 @@
|
||||
{
|
||||
"pcb": {
|
||||
"templates": [
|
||||
"tuya2l",
|
||||
"pcb-white",
|
||||
"rf-type1"
|
||||
],
|
||||
"pinout_hidden": "I2S,I2C,JTAG,FLASH",
|
||||
"pinout": {
|
||||
"1": {
|
||||
"IC": 24,
|
||||
"ARD": "D0"
|
||||
},
|
||||
"2": {
|
||||
"IC": 23,
|
||||
"ARD": "D1"
|
||||
},
|
||||
"3": {
|
||||
"IC": 22,
|
||||
"ARD": "D2"
|
||||
},
|
||||
"4": {
|
||||
"IC": 15,
|
||||
"ARD": "D3"
|
||||
},
|
||||
"5": {
|
||||
"IC": 16,
|
||||
"ARD": "D4"
|
||||
},
|
||||
"6": {
|
||||
"GND": null
|
||||
},
|
||||
"7": {
|
||||
"PWR": 3.3
|
||||
},
|
||||
"TGND": {
|
||||
"GND": null
|
||||
},
|
||||
"TRST": {
|
||||
"CTRL": "CEN"
|
||||
},
|
||||
"TRX1": {
|
||||
"IC": 26,
|
||||
"ARD": "D5"
|
||||
},
|
||||
"TTX2": {
|
||||
"IC": 29,
|
||||
"ARD": "D6"
|
||||
},
|
||||
"TTX1": {
|
||||
"IC": 27,
|
||||
"ARD": "D7"
|
||||
},
|
||||
"TCSN": {
|
||||
"IC": 19,
|
||||
"ARD": "D8"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
59
boards/_base/pcb/cb2s-test.json
Normal file
59
boards/_base/pcb/cb2s-test.json
Normal file
@@ -0,0 +1,59 @@
|
||||
{
|
||||
"pcb": {
|
||||
"test_pads": {
|
||||
"TTX2": "cb2s.back.u2_txd.anchor",
|
||||
"TRX2": "cb2s.back.u2_rxd.anchor",
|
||||
"TCSN": "cb2s.back.csn.anchor"
|
||||
},
|
||||
"back": [
|
||||
{
|
||||
"type": "rect",
|
||||
"pos": "6.0,8.9",
|
||||
"size": "2.9,2.9",
|
||||
"preset": "copper1"
|
||||
},
|
||||
{
|
||||
"id": "u2_txd",
|
||||
"name": "label_line_up",
|
||||
"pos": "6.7,6.1",
|
||||
"vars": {
|
||||
"DIR": "left",
|
||||
"W": 2.5,
|
||||
"H": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "test_pad_1mm",
|
||||
"pos": "7.5,6.0"
|
||||
},
|
||||
{
|
||||
"id": "u2_rxd",
|
||||
"name": "label_line_up",
|
||||
"pos": "6.2,8.1",
|
||||
"vars": {
|
||||
"DIR": "left",
|
||||
"W": 2.0,
|
||||
"H": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "test_pad_1mm",
|
||||
"pos": "7.0,8.0"
|
||||
},
|
||||
{
|
||||
"id": "csn",
|
||||
"name": "label_line_up",
|
||||
"pos": "4.2,11.1",
|
||||
"vars": {
|
||||
"DIR": "left",
|
||||
"W": 0,
|
||||
"H": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "test_pad_1mm",
|
||||
"pos": "5.0,11.0"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
68
boards/_base/pcb/cb2s.json
Normal file
68
boards/_base/pcb/cb2s.json
Normal file
@@ -0,0 +1,68 @@
|
||||
{
|
||||
"pcb": {
|
||||
"templates": [
|
||||
"tuya2",
|
||||
"pcb-blue-light",
|
||||
"rf-type1"
|
||||
],
|
||||
"pinout_hidden": "I2S,JTAG,FLASH",
|
||||
"pinout": {
|
||||
"1": {
|
||||
"PWR": 3.3
|
||||
},
|
||||
"2": {
|
||||
"IC": 22,
|
||||
"ARD": "D0"
|
||||
},
|
||||
"3": {
|
||||
"GND": null
|
||||
},
|
||||
"4": {
|
||||
"IC": 23,
|
||||
"ARD": "D1"
|
||||
},
|
||||
"5": {
|
||||
"IC": 26,
|
||||
"ARD": "D4"
|
||||
},
|
||||
"6": {
|
||||
"IC": 24,
|
||||
"ARD": "D2"
|
||||
},
|
||||
"7": {
|
||||
"IC": 27,
|
||||
"ARD": "D5"
|
||||
},
|
||||
"8": {
|
||||
"IC": 17,
|
||||
"ARD": [
|
||||
"D3",
|
||||
"A0"
|
||||
]
|
||||
},
|
||||
"9": {
|
||||
"IC": 16,
|
||||
"ARD": "D6"
|
||||
},
|
||||
"10": {
|
||||
"IC": 21
|
||||
},
|
||||
"11": {
|
||||
"IC": 15,
|
||||
"ARD": "D7"
|
||||
},
|
||||
"TRX2": {
|
||||
"IC": 28,
|
||||
"ARD": "D9"
|
||||
},
|
||||
"TTX2": {
|
||||
"IC": 29,
|
||||
"ARD": "D8"
|
||||
},
|
||||
"TCSN": {
|
||||
"IC": 19,
|
||||
"ARD": "D10"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
79
boards/_base/pcb/cb3l.json
Normal file
79
boards/_base/pcb/cb3l.json
Normal file
@@ -0,0 +1,79 @@
|
||||
{
|
||||
"pcb": {
|
||||
"templates": [
|
||||
"esp12s",
|
||||
"pcb-white",
|
||||
"tuya-16x24",
|
||||
"rf-type1"
|
||||
],
|
||||
"vars": {
|
||||
"PINHOLE": 1
|
||||
},
|
||||
"pinout_hidden": "I2S,SD,SPI,I2C,JTAG,FLASH",
|
||||
"pinout": {
|
||||
"1": {
|
||||
"IC": 21
|
||||
},
|
||||
"2": {
|
||||
"IC": 17,
|
||||
"ARD": [
|
||||
"D0",
|
||||
"A0"
|
||||
]
|
||||
},
|
||||
"3": {
|
||||
"IC": 21
|
||||
},
|
||||
"4": {
|
||||
"IC": 11,
|
||||
"ARD": "D1"
|
||||
},
|
||||
"5": {
|
||||
"IC": 15,
|
||||
"ARD": "D2"
|
||||
},
|
||||
"6": {
|
||||
"IC": 16,
|
||||
"ARD": "D3"
|
||||
},
|
||||
"7": {
|
||||
"IC": 22,
|
||||
"ARD": "D4"
|
||||
},
|
||||
"8": {
|
||||
"PWR": 3.3
|
||||
},
|
||||
"9": {
|
||||
"GND": null
|
||||
},
|
||||
"10": {
|
||||
"IC": 25,
|
||||
"ARD": "D5"
|
||||
},
|
||||
"11": {
|
||||
"IC": 29,
|
||||
"ARD": "D6"
|
||||
},
|
||||
"12": {
|
||||
"IC": 19,
|
||||
"ARD": "D7"
|
||||
},
|
||||
"13": {
|
||||
"IC": 24,
|
||||
"ARD": "D8"
|
||||
},
|
||||
"14": {
|
||||
"IC": 23,
|
||||
"ARD": "D9"
|
||||
},
|
||||
"15": {
|
||||
"IC": 26,
|
||||
"ARD": "D10"
|
||||
},
|
||||
"16": {
|
||||
"IC": 27,
|
||||
"ARD": "D11"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
104
boards/_base/pcb/cb3s.json
Normal file
104
boards/_base/pcb/cb3s.json
Normal file
@@ -0,0 +1,104 @@
|
||||
{
|
||||
"pcb": {
|
||||
"templates": [
|
||||
"esp12e-22",
|
||||
"pcb-blue-light",
|
||||
"tuya-16x24",
|
||||
"rf-type1"
|
||||
],
|
||||
"vars": {
|
||||
"PINHOLE": 0
|
||||
},
|
||||
"pinout_hidden": "I2S,SD,SPI,SCL2",
|
||||
"pinout": {
|
||||
"1": {
|
||||
"IC": 21
|
||||
},
|
||||
"2": {
|
||||
"IC": 17,
|
||||
"ARD": [
|
||||
"D0",
|
||||
"A0"
|
||||
]
|
||||
},
|
||||
"3": {
|
||||
"IC": 21
|
||||
},
|
||||
"4": {
|
||||
"IC": 11,
|
||||
"ARD": "D1"
|
||||
},
|
||||
"5": {
|
||||
"IC": 15,
|
||||
"ARD": "D2"
|
||||
},
|
||||
"6": {
|
||||
"IC": 16,
|
||||
"ARD": "D3"
|
||||
},
|
||||
"7": {
|
||||
"IC": 22,
|
||||
"ARD": "D4"
|
||||
},
|
||||
"8": {
|
||||
"PWR": 3.3
|
||||
},
|
||||
"9": {
|
||||
"GND": null
|
||||
},
|
||||
"10": {
|
||||
"IC": 25,
|
||||
"ARD": "D5"
|
||||
},
|
||||
"11": {
|
||||
"IC": 29,
|
||||
"ARD": "D6"
|
||||
},
|
||||
"12": {
|
||||
"IC": 19,
|
||||
"ARD": "D7"
|
||||
},
|
||||
"13": {
|
||||
"IC": 24,
|
||||
"ARD": "D8"
|
||||
},
|
||||
"14": {
|
||||
"IC": 23,
|
||||
"ARD": "D9"
|
||||
},
|
||||
"15": {
|
||||
"IC": 26,
|
||||
"ARD": "D10"
|
||||
},
|
||||
"16": {
|
||||
"IC": 27,
|
||||
"ARD": "D11"
|
||||
},
|
||||
"17": {
|
||||
"IC": 17,
|
||||
"ARD": [
|
||||
"D0",
|
||||
"A0"
|
||||
]
|
||||
},
|
||||
"18": {
|
||||
"IC": 18,
|
||||
"ARD": "D12"
|
||||
},
|
||||
"19": {
|
||||
"IC": 19,
|
||||
"ARD": "D7"
|
||||
},
|
||||
"20": {
|
||||
"IC": 20,
|
||||
"ARD": "D13"
|
||||
},
|
||||
"21": {
|
||||
"NC": null
|
||||
},
|
||||
"22": {
|
||||
"NC": null
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
102
boards/_base/pcb/cb3se.json
Normal file
102
boards/_base/pcb/cb3se.json
Normal file
@@ -0,0 +1,102 @@
|
||||
{
|
||||
"pcb": {
|
||||
"templates": [
|
||||
"esp12e-22",
|
||||
"pcb-blue-light",
|
||||
"tuya-16x24",
|
||||
"rf-type1"
|
||||
],
|
||||
"vars": {
|
||||
"PINHOLE": 0
|
||||
},
|
||||
"pinout_hidden": "I2S,SD,JTAG,FLASH,SCL1",
|
||||
"pinout": {
|
||||
"1": {
|
||||
"IC": 21
|
||||
},
|
||||
"2": {
|
||||
"IC": 17,
|
||||
"ARD": [
|
||||
"D0",
|
||||
"A0"
|
||||
]
|
||||
},
|
||||
"3": {
|
||||
"IC": 21
|
||||
},
|
||||
"4": {
|
||||
"IC": 11,
|
||||
"ARD": "D1"
|
||||
},
|
||||
"5": {
|
||||
"IC": 15,
|
||||
"ARD": "D2"
|
||||
},
|
||||
"6": {
|
||||
"IC": 16,
|
||||
"ARD": "D3"
|
||||
},
|
||||
"7": {
|
||||
"IC": 22,
|
||||
"ARD": "D4"
|
||||
},
|
||||
"8": {
|
||||
"PWR": 3.3
|
||||
},
|
||||
"9": {
|
||||
"GND": null
|
||||
},
|
||||
"10": {
|
||||
"IC": 25,
|
||||
"ARD": "D5"
|
||||
},
|
||||
"11": {
|
||||
"IC": 29,
|
||||
"ARD": "D6"
|
||||
},
|
||||
"12": {
|
||||
"IC": 28,
|
||||
"ARD": "D7"
|
||||
},
|
||||
"13": {
|
||||
"IC": 24,
|
||||
"ARD": "D8"
|
||||
},
|
||||
"14": {
|
||||
"IC": 23,
|
||||
"ARD": "D9"
|
||||
},
|
||||
"15": {
|
||||
"IC": 26,
|
||||
"ARD": "D10"
|
||||
},
|
||||
"16": {
|
||||
"IC": 27,
|
||||
"ARD": "D11"
|
||||
},
|
||||
"17": {
|
||||
"IC": 13,
|
||||
"ARD": "D12"
|
||||
},
|
||||
"18": {
|
||||
"IC": 18,
|
||||
"ARD": "D13"
|
||||
},
|
||||
"19": {
|
||||
"GND": null
|
||||
},
|
||||
"20": {
|
||||
"IC": 20,
|
||||
"ARD": "D14"
|
||||
},
|
||||
"21": {
|
||||
"IC": 14,
|
||||
"ARD": "D15"
|
||||
},
|
||||
"22": {
|
||||
"IC": 12,
|
||||
"ARD": "D16"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
104
boards/_base/pcb/cblc5-test.json
Normal file
104
boards/_base/pcb/cblc5-test.json
Normal file
@@ -0,0 +1,104 @@
|
||||
{
|
||||
"pcb": {
|
||||
"test_pads": {
|
||||
"TRST": "cblc5.back.rst.anchor",
|
||||
"TRX1": "cblc5.back.r1.anchor",
|
||||
"TTX1": "cblc5.back.t1.anchor",
|
||||
"TRX2": "cblc5.back.r2.anchor",
|
||||
"TTX2": "cblc5.back.t2.anchor",
|
||||
"TCSN": "cblc5.back.csn.anchor"
|
||||
},
|
||||
"back": [
|
||||
{
|
||||
"name": "test_pad_1mm",
|
||||
"pos": "1.1,1.1"
|
||||
},
|
||||
{
|
||||
"id": "t1",
|
||||
"name": "label_line_up",
|
||||
"pos": "1.1,0.6",
|
||||
"vars": {
|
||||
"DIR": "right",
|
||||
"RASTER": 2,
|
||||
"W": 3.8,
|
||||
"H": 1.4
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "test_pad_1mm",
|
||||
"pos": "0.8,3.3"
|
||||
},
|
||||
{
|
||||
"id": "r1",
|
||||
"name": "label_line_up",
|
||||
"pos": "0.8,2.8",
|
||||
"vars": {
|
||||
"DIR": "right",
|
||||
"RASTER": 2,
|
||||
"W": 4.1,
|
||||
"H": 1.6
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "test_pad_1mm",
|
||||
"pos": "2.4,4.1"
|
||||
},
|
||||
{
|
||||
"id": "r2",
|
||||
"name": "label_line_up",
|
||||
"pos": "2.4,3.6",
|
||||
"vars": {
|
||||
"DIR": "right",
|
||||
"RASTER": 2,
|
||||
"W": 2.5,
|
||||
"H": 0.4
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "test_pad_1mm",
|
||||
"pos": "3.9,4.1"
|
||||
},
|
||||
{
|
||||
"id": "t2",
|
||||
"name": "label_line_down",
|
||||
"pos": "3.9,4.6",
|
||||
"vars": {
|
||||
"DIR": "right",
|
||||
"RASTER": 2,
|
||||
"W": 1,
|
||||
"H": 0.4
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "test_pad_1mm",
|
||||
"pos": "1.2,4.9"
|
||||
},
|
||||
{
|
||||
"name": "test_pad_1mm",
|
||||
"pos": "1.7,7.0"
|
||||
},
|
||||
{
|
||||
"id": "rst",
|
||||
"name": "label_line_down",
|
||||
"pos": "1.2,5.4",
|
||||
"vars": {
|
||||
"DIR": "right",
|
||||
"RASTER": 2,
|
||||
"W": 3.7,
|
||||
"H": 1.6
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "csn",
|
||||
"name": "label_line_down",
|
||||
"pos": "1.7,7.5",
|
||||
"vars": {
|
||||
"DIR": "right",
|
||||
"RASTER": 2,
|
||||
"W": 3.2,
|
||||
"H": 1.5
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
78
boards/_base/pcb/cblc5.json
Normal file
78
boards/_base/pcb/cblc5.json
Normal file
@@ -0,0 +1,78 @@
|
||||
{
|
||||
"pcb": {
|
||||
"templates": [
|
||||
"tuyalc5",
|
||||
"pcb-white"
|
||||
],
|
||||
"pinout_hidden": "I2S,JTAG,FLASH,SDA1",
|
||||
"pinout": {
|
||||
"1": {
|
||||
"CTRL": "ANT"
|
||||
},
|
||||
"2": {
|
||||
"GND": null
|
||||
},
|
||||
"3": {
|
||||
"IC": 16,
|
||||
"ARD": "D0"
|
||||
},
|
||||
"4": {
|
||||
"IC": 15,
|
||||
"ARD": "D2"
|
||||
},
|
||||
"5": {
|
||||
"IC": 22,
|
||||
"ARD": "D1"
|
||||
},
|
||||
"6": {
|
||||
"PWR": 3.3
|
||||
},
|
||||
"TRST": {
|
||||
"IC": 21
|
||||
},
|
||||
"TRX1": {
|
||||
"IC": 26,
|
||||
"ARD": "D4"
|
||||
},
|
||||
"TTX1": {
|
||||
"IC": 27,
|
||||
"ARD": "D3"
|
||||
},
|
||||
"TRX2": {
|
||||
"IC": 28,
|
||||
"ARD": "D5"
|
||||
},
|
||||
"TTX2": {
|
||||
"IC": 29,
|
||||
"ARD": "D6"
|
||||
},
|
||||
"TCSN": {
|
||||
"IC": 19,
|
||||
"ARD": "D7"
|
||||
}
|
||||
},
|
||||
"front": [
|
||||
{
|
||||
"name": "chip",
|
||||
"pos": "2.7,3.8",
|
||||
"vars": {
|
||||
"W": 5,
|
||||
"POS": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "osc",
|
||||
"pos": "2.5,0.5"
|
||||
},
|
||||
{
|
||||
"type": "text",
|
||||
"pos": "0.7,4.2",
|
||||
"text": "${SYMBOL}",
|
||||
"font_size": 1.2,
|
||||
"fill": {
|
||||
"color": "${SILK_COLOR}"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
30
boards/_base/pcb/cbu-test.json
Normal file
30
boards/_base/pcb/cbu-test.json
Normal file
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"pcb": {
|
||||
"test_pads": {
|
||||
"TCSN": "cbu.back.csn.anchor"
|
||||
},
|
||||
"back": [
|
||||
{
|
||||
"type": "rect",
|
||||
"pos": "6.3,11.6",
|
||||
"size": "2.9,2.9",
|
||||
"preset": "copper1"
|
||||
},
|
||||
{
|
||||
"id": "csn",
|
||||
"name": "label_line_up",
|
||||
"pos": "3.7,13.5",
|
||||
"vars": {
|
||||
"DIR": "left",
|
||||
"RASTER": 2,
|
||||
"W": 0,
|
||||
"H": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "test_pad_1mm",
|
||||
"pos": "4.4,13.4"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
100
boards/_base/pcb/cbu.json
Normal file
100
boards/_base/pcb/cbu.json
Normal file
@@ -0,0 +1,100 @@
|
||||
{
|
||||
"pcb": {
|
||||
"templates": [
|
||||
"tuyau",
|
||||
"pcb-white",
|
||||
"rf-type1"
|
||||
],
|
||||
"pinout_hidden": "I2S,USB,SD,FLASH",
|
||||
"pinout": {
|
||||
"1": {
|
||||
"IC": 11,
|
||||
"ARD": "D0"
|
||||
},
|
||||
"2": {
|
||||
"IC": 12,
|
||||
"ARD": "D1"
|
||||
},
|
||||
"3": {
|
||||
"IC": 20,
|
||||
"ARD": "D2"
|
||||
},
|
||||
"4": {
|
||||
"IC": 18,
|
||||
"ARD": "D3"
|
||||
},
|
||||
"5": {
|
||||
"IC": 17,
|
||||
"ARD": [
|
||||
"D4",
|
||||
"A0"
|
||||
]
|
||||
},
|
||||
"6": {
|
||||
"IC": 28,
|
||||
"ARD": "D5"
|
||||
},
|
||||
"7": {
|
||||
"IC": 29,
|
||||
"ARD": "D6"
|
||||
},
|
||||
"8": {
|
||||
"IC": 24,
|
||||
"ARD": "D7"
|
||||
},
|
||||
"9": {
|
||||
"IC": 23,
|
||||
"ARD": "D8"
|
||||
},
|
||||
"10": {
|
||||
"IC": 22,
|
||||
"ARD": "D9"
|
||||
},
|
||||
"11": {
|
||||
"IC": 15,
|
||||
"ARD": "D10"
|
||||
},
|
||||
"12": {
|
||||
"IC": 16,
|
||||
"ARD": "D11"
|
||||
},
|
||||
"13": {
|
||||
"GND": null
|
||||
},
|
||||
"14": {
|
||||
"PWR": 3.3
|
||||
},
|
||||
"15": {
|
||||
"IC": 27,
|
||||
"ARD": "D12"
|
||||
},
|
||||
"16": {
|
||||
"IC": 26,
|
||||
"ARD": "D13"
|
||||
},
|
||||
"17": {
|
||||
"IC": 10,
|
||||
"ARD": "D14"
|
||||
},
|
||||
"18": {
|
||||
"IC": 21
|
||||
},
|
||||
"19": {
|
||||
"IC": 25,
|
||||
"ARD": "D15"
|
||||
},
|
||||
"20": {
|
||||
"IC": 14,
|
||||
"ARD": "D16"
|
||||
},
|
||||
"21": {
|
||||
"IC": 13,
|
||||
"ARD": "D17"
|
||||
},
|
||||
"TCSN": {
|
||||
"IC": 19,
|
||||
"ARD": "D18"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
23
boards/_base/pcb/ln-02-test.json
Normal file
23
boards/_base/pcb/ln-02-test.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"pcb": {
|
||||
"test_pads": {
|
||||
"TBOOT": "ln-02.back.boot.anchor"
|
||||
},
|
||||
"back": [
|
||||
{
|
||||
"id": "boot",
|
||||
"name": "label_line_up",
|
||||
"pos": "12,12.1",
|
||||
"vars": {
|
||||
"DIR": "right",
|
||||
"W": 2.5,
|
||||
"H": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "test_pad_1mm",
|
||||
"pos": "11,12"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
67
boards/_base/pcb/ln-02.json
Normal file
67
boards/_base/pcb/ln-02.json
Normal file
@@ -0,0 +1,67 @@
|
||||
{
|
||||
"pcb": {
|
||||
"templates": [
|
||||
"tuya2",
|
||||
"pcb-black",
|
||||
"rf-type1"
|
||||
],
|
||||
"scale": 10.5,
|
||||
"pinout_hidden": "I2S,TRIG,WAKE,CTS,RTS,SD,SPI,I2C",
|
||||
"pinout": {
|
||||
"1": {
|
||||
"PWR": 3.3
|
||||
},
|
||||
"2": {
|
||||
"IC": 22,
|
||||
"ARD": "D0"
|
||||
},
|
||||
"3": {
|
||||
"GND": null
|
||||
},
|
||||
"4": {
|
||||
"IC": 24,
|
||||
"ARD": [
|
||||
"D1",
|
||||
"A0"
|
||||
]
|
||||
},
|
||||
"5": {
|
||||
"IC": 11,
|
||||
"ARD": "D2"
|
||||
},
|
||||
"6": {
|
||||
"IC": 29,
|
||||
"ARD": "D3"
|
||||
},
|
||||
"7": {
|
||||
"IC": 10,
|
||||
"ARD": "D4"
|
||||
},
|
||||
"8": {
|
||||
"IC": 30,
|
||||
"ARD": "D5"
|
||||
},
|
||||
"9": {
|
||||
"IC": 9,
|
||||
"ARD": [
|
||||
"D6",
|
||||
"A1"
|
||||
]
|
||||
},
|
||||
"10": {
|
||||
"IC": 7
|
||||
},
|
||||
"11": {
|
||||
"IC": 8,
|
||||
"ARD": [
|
||||
"D7",
|
||||
"A2"
|
||||
]
|
||||
},
|
||||
"TBOOT": {
|
||||
"IC": 17,
|
||||
"ARD": "D8"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
96
boards/_base/pcb/lsc-lma35.json
Normal file
96
boards/_base/pcb/lsc-lma35.json
Normal file
@@ -0,0 +1,96 @@
|
||||
{
|
||||
"pcb": {
|
||||
"templates": [
|
||||
"custom-20x24-22",
|
||||
"pcb-blue-light",
|
||||
"rf-type1"
|
||||
],
|
||||
"pinout_hidden": "I2S,JTAG,FLASH,SD,SPI,SDA1",
|
||||
"pinout": {
|
||||
"1": {
|
||||
"PWR": 3.3
|
||||
},
|
||||
"2": {
|
||||
"IC": 15,
|
||||
"ARD": "D0"
|
||||
},
|
||||
"3": {
|
||||
"IC": 11,
|
||||
"ARD": "D1"
|
||||
},
|
||||
"4": {
|
||||
"IC": 12,
|
||||
"ARD": "D2"
|
||||
},
|
||||
"5": {
|
||||
"IC": 16,
|
||||
"ARD": "D3"
|
||||
},
|
||||
"6": {
|
||||
"GND": null
|
||||
},
|
||||
"7": {
|
||||
"IC": 18,
|
||||
"ARD": "D4"
|
||||
},
|
||||
"8": {
|
||||
"IC": 29,
|
||||
"ARD": "D5"
|
||||
},
|
||||
"9": {
|
||||
"IC": 17,
|
||||
"ARD": [
|
||||
"D6",
|
||||
"A0"
|
||||
]
|
||||
},
|
||||
"10": {
|
||||
"CTRL": "?"
|
||||
},
|
||||
"11": {
|
||||
"GND": null
|
||||
},
|
||||
"12": {
|
||||
"IC": 24,
|
||||
"ARD": "D7"
|
||||
},
|
||||
"13": {
|
||||
"IC": 25,
|
||||
"ARD": "D8"
|
||||
},
|
||||
"14": {
|
||||
"GND": null
|
||||
},
|
||||
"15": {
|
||||
"IC": 19,
|
||||
"ARD": "D9"
|
||||
},
|
||||
"16": {
|
||||
"IC": 22,
|
||||
"ARD": "D10"
|
||||
},
|
||||
"17": {
|
||||
"IC": 23,
|
||||
"ARD": "D11"
|
||||
},
|
||||
"18": {
|
||||
"IC": 26,
|
||||
"ARD": "D12"
|
||||
},
|
||||
"19": {
|
||||
"GND": null
|
||||
},
|
||||
"20": {
|
||||
"IC": 27,
|
||||
"ARD": "D13"
|
||||
},
|
||||
"21": {
|
||||
"CTRL": "?"
|
||||
},
|
||||
"22": {
|
||||
"IC": 28,
|
||||
"ARD": "D14"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
56
boards/_base/pcb/t102.json
Normal file
56
boards/_base/pcb/t102.json
Normal file
@@ -0,0 +1,56 @@
|
||||
{
|
||||
"pcb": {
|
||||
"templates": [
|
||||
"tuya2",
|
||||
"pcb-black",
|
||||
"rf-type1"
|
||||
],
|
||||
"scale": 10.5,
|
||||
"pinout_hidden": "I2S,TRIG,WAKE,CTS,RTS,SD",
|
||||
"drawing_hidden": "SPI",
|
||||
"pinout": {
|
||||
"1": {
|
||||
"PWR": 3.3
|
||||
},
|
||||
"2": {
|
||||
"IC": 17,
|
||||
"ARD": "D0"
|
||||
},
|
||||
"3": {
|
||||
"GND": null
|
||||
},
|
||||
"4": {
|
||||
"IC": 16,
|
||||
"ARD": "D1"
|
||||
},
|
||||
"5": {
|
||||
"IC": 29,
|
||||
"ARD": "D5"
|
||||
},
|
||||
"6": {
|
||||
"IC": 28,
|
||||
"ARD": "D2"
|
||||
},
|
||||
"7": {
|
||||
"IC": 32,
|
||||
"ARD": "D6"
|
||||
},
|
||||
"8": {
|
||||
"IC": 1,
|
||||
"ARD": "D3"
|
||||
},
|
||||
"9": {
|
||||
"IC": 13,
|
||||
"ARD": "D7"
|
||||
},
|
||||
"10": {
|
||||
"IC": 2,
|
||||
"ARD": "D4"
|
||||
},
|
||||
"11": {
|
||||
"IC": 14,
|
||||
"ARD": "D8"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
79
boards/_base/pcb/t103.json
Normal file
79
boards/_base/pcb/t103.json
Normal file
@@ -0,0 +1,79 @@
|
||||
{
|
||||
"pcb": {
|
||||
"templates": [
|
||||
"esp12s",
|
||||
"pcb-white",
|
||||
"tuya-16x24",
|
||||
"rf-type1"
|
||||
],
|
||||
"vars": {
|
||||
"PINHOLE": 1
|
||||
},
|
||||
"pinout_hidden": "I2S,TRIG,WAKE,CTS,RTS,SD",
|
||||
"pinout": {
|
||||
"1": {
|
||||
"NC": null
|
||||
},
|
||||
"2": {
|
||||
"IC": 27,
|
||||
"ARD": "A1"
|
||||
},
|
||||
"3": {
|
||||
"IC": 12
|
||||
},
|
||||
"4": {
|
||||
"IC": 30,
|
||||
"ARD": [
|
||||
"D0",
|
||||
"A0"
|
||||
]
|
||||
},
|
||||
"5": {
|
||||
"IC": 13,
|
||||
"ARD": "D1"
|
||||
},
|
||||
"6": {
|
||||
"IC": 14,
|
||||
"ARD": "D2"
|
||||
},
|
||||
"7": {
|
||||
"IC": 16,
|
||||
"ARD": "D3"
|
||||
},
|
||||
"8": {
|
||||
"PWR": 3.3
|
||||
},
|
||||
"9": {
|
||||
"GND": null
|
||||
},
|
||||
"10": {
|
||||
"IC": 31,
|
||||
"ARD": "D4"
|
||||
},
|
||||
"11": {
|
||||
"IC": 2,
|
||||
"ARD": "D5"
|
||||
},
|
||||
"12": {
|
||||
"IC": 1,
|
||||
"ARD": "D6"
|
||||
},
|
||||
"13": {
|
||||
"IC": 28,
|
||||
"ARD": "D7"
|
||||
},
|
||||
"14": {
|
||||
"IC": 17,
|
||||
"ARD": "D8"
|
||||
},
|
||||
"15": {
|
||||
"IC": 29,
|
||||
"ARD": "D9"
|
||||
},
|
||||
"16": {
|
||||
"IC": 32,
|
||||
"ARD": "D10"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
70
boards/_base/pcb/t112.json
Normal file
70
boards/_base/pcb/t112.json
Normal file
@@ -0,0 +1,70 @@
|
||||
{
|
||||
"pcb": {
|
||||
"templates": [
|
||||
"esp01m-14",
|
||||
"pcb-blue-light",
|
||||
"rf-type1"
|
||||
],
|
||||
"scale": 10.5,
|
||||
"pinout_hidden": "I2S,TRIG,WAKE,CTS,RTS,SD",
|
||||
"drawing_hidden": "I2C,SPI",
|
||||
"pinout": {
|
||||
"1": {
|
||||
"PWR": 3.3
|
||||
},
|
||||
"2": {
|
||||
"IC": 2,
|
||||
"ARD": "D0"
|
||||
},
|
||||
"3": {
|
||||
"IC": 30,
|
||||
"ARD": [
|
||||
"D1",
|
||||
"A0"
|
||||
]
|
||||
},
|
||||
"4": {
|
||||
"IC": 14,
|
||||
"ARD": "D2"
|
||||
},
|
||||
"5": {
|
||||
"IC": 13,
|
||||
"ARD": "D3"
|
||||
},
|
||||
"6": {
|
||||
"IC": 16,
|
||||
"ARD": "D4"
|
||||
},
|
||||
"7": {
|
||||
"NC": null
|
||||
},
|
||||
"8": {
|
||||
"IC": 28,
|
||||
"ARD": "D5"
|
||||
},
|
||||
"9": {
|
||||
"IC": 29,
|
||||
"ARD": "D6"
|
||||
},
|
||||
"10": {
|
||||
"IC": 17,
|
||||
"ARD": "D7"
|
||||
},
|
||||
"11": {
|
||||
"IC": 32,
|
||||
"ARD": "D8"
|
||||
},
|
||||
"12": {
|
||||
"IC": 31,
|
||||
"ARD": "D9"
|
||||
},
|
||||
"13": {
|
||||
"IC": 1,
|
||||
"ARD": "D10"
|
||||
},
|
||||
"14": {
|
||||
"GND": null
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
143
boards/_base/pcb/wa2-test.json
Normal file
143
boards/_base/pcb/wa2-test.json
Normal file
@@ -0,0 +1,143 @@
|
||||
{
|
||||
"pcb": {
|
||||
"test_pads": {
|
||||
"TTEST": "wa2.back.test.anchor",
|
||||
"TTX2": "wa2.back.2tx.anchor",
|
||||
"TGND": "wa2.back.gnd.anchor",
|
||||
"TSCK": "wa2.back.sck.anchor",
|
||||
"TCSN": "wa2.back.csn.anchor",
|
||||
"TSI": "wa2.back.si.anchor",
|
||||
"TSO": "wa2.back.so.anchor",
|
||||
"TP4": "wa2.back.p4.anchor",
|
||||
"TVCC": "wa2.back.vbat.anchor"
|
||||
},
|
||||
"back": [
|
||||
{
|
||||
"name": "test_pad_1mm",
|
||||
"pos": "2.6,6.2"
|
||||
},
|
||||
{
|
||||
"id": "sck",
|
||||
"name": "label_line_up",
|
||||
"pos": "2.6,5.4",
|
||||
"vars": {
|
||||
"DIR": "left",
|
||||
"W": 1.3,
|
||||
"H": 2
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "test_pad_1mm",
|
||||
"pos": "4.6,6.2"
|
||||
},
|
||||
{
|
||||
"id": "so",
|
||||
"name": "label_line_up",
|
||||
"pos": "4.6,5.4",
|
||||
"vars": {
|
||||
"DIR": "left",
|
||||
"W": 3.3,
|
||||
"H": 4
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "test_pad_1mm",
|
||||
"pos": "7.0,6.2"
|
||||
},
|
||||
{
|
||||
"id": "p4",
|
||||
"name": "label_line_up",
|
||||
"pos": "7.0,5.4",
|
||||
"vars": {
|
||||
"DIR": "right",
|
||||
"W": 0,
|
||||
"H": 4
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "test_pad_1mm",
|
||||
"pos": "3.0,8.3"
|
||||
},
|
||||
{
|
||||
"id": "csn",
|
||||
"name": "label_line_up",
|
||||
"pos": "2.2,8.4",
|
||||
"vars": {
|
||||
"DIR": "left",
|
||||
"W": 0.9,
|
||||
"H": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "test_pad_1mm",
|
||||
"pos": "5.2,8.8"
|
||||
},
|
||||
{
|
||||
"id": "si",
|
||||
"name": "label_line_up",
|
||||
"pos": "6.0,8.9",
|
||||
"vars": {
|
||||
"DIR": "right",
|
||||
"W": 1,
|
||||
"H": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "test_pad_1mm",
|
||||
"pos": "2.1,11.6"
|
||||
},
|
||||
{
|
||||
"id": "2tx",
|
||||
"name": "label_line_up",
|
||||
"pos": "1.3,11.7",
|
||||
"vars": {
|
||||
"DIR": "left",
|
||||
"W": 0,
|
||||
"H": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "test_pad_1mm",
|
||||
"pos": "4.3,11.6"
|
||||
},
|
||||
{
|
||||
"id": "test",
|
||||
"name": "label_line_up",
|
||||
"pos": "5.1,11.7",
|
||||
"vars": {
|
||||
"DIR": "right",
|
||||
"W": 1.9,
|
||||
"H": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "test_pad_1mm",
|
||||
"pos": "2.5,14.5"
|
||||
},
|
||||
{
|
||||
"id": "vbat",
|
||||
"name": "label_line_up",
|
||||
"pos": "1.7,14.6",
|
||||
"vars": {
|
||||
"DIR": "left",
|
||||
"W": 0.4,
|
||||
"H": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "test_pad_1mm",
|
||||
"pos": "4.8,14.5"
|
||||
},
|
||||
{
|
||||
"id": "gnd",
|
||||
"name": "label_line_up",
|
||||
"pos": "5.6,14.6",
|
||||
"vars": {
|
||||
"DIR": "right",
|
||||
"W": 1.4,
|
||||
"H": 0
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
93
boards/_base/pcb/wa2.json
Normal file
93
boards/_base/pcb/wa2.json
Normal file
@@ -0,0 +1,93 @@
|
||||
{
|
||||
"pcb": {
|
||||
"scale": 11,
|
||||
"templates": [
|
||||
"tuya2",
|
||||
"pcb-blue-light",
|
||||
"rf-type1"
|
||||
],
|
||||
"pinout_hidden": "I2S,SD",
|
||||
"pinout": {
|
||||
"1": {
|
||||
"PWR": 3.3
|
||||
},
|
||||
"2": {
|
||||
"IC": 16,
|
||||
"ARD": "D0"
|
||||
},
|
||||
"3": {
|
||||
"GND": null
|
||||
},
|
||||
"4": {
|
||||
"IC": 15,
|
||||
"ARD": "D1"
|
||||
},
|
||||
"5": {
|
||||
"IC": 25,
|
||||
"ARD": "D4"
|
||||
},
|
||||
"6": {
|
||||
"IC": 14,
|
||||
"ARD": "D2"
|
||||
},
|
||||
"7": {
|
||||
"IC": 26,
|
||||
"ARD": "D5"
|
||||
},
|
||||
"8": {
|
||||
"IC": 32,
|
||||
"ARD": [
|
||||
"D3",
|
||||
"A0"
|
||||
]
|
||||
},
|
||||
"9": {
|
||||
"IC": 22,
|
||||
"ARD": "D6"
|
||||
},
|
||||
"10": {
|
||||
"IC": 37
|
||||
},
|
||||
"11": {
|
||||
"IC": 21,
|
||||
"ARD": "D7"
|
||||
},
|
||||
"TSCK": {
|
||||
"IC": 29,
|
||||
"ARD": "D8"
|
||||
},
|
||||
"TP4": {
|
||||
"IC": 35,
|
||||
"ARD": "D9"
|
||||
},
|
||||
"TTEST": {
|
||||
"IC": 23
|
||||
},
|
||||
"TTX2": {
|
||||
"IC": 28,
|
||||
"ARD": "D10"
|
||||
},
|
||||
"TCSN": {
|
||||
"IC": 30,
|
||||
"ARD": "D11"
|
||||
},
|
||||
"TSI": {
|
||||
"IC": 31,
|
||||
"ARD": "D12"
|
||||
},
|
||||
"TSO": {
|
||||
"IC": 32,
|
||||
"ARD": [
|
||||
"D3",
|
||||
"A0"
|
||||
]
|
||||
},
|
||||
"TVCC": {
|
||||
"PWR": 3.3
|
||||
},
|
||||
"TGND": {
|
||||
"GND": null
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
93
boards/_base/pcb/wb02a-test.json
Normal file
93
boards/_base/pcb/wb02a-test.json
Normal file
@@ -0,0 +1,93 @@
|
||||
{
|
||||
"pcb": {
|
||||
"test_pads": {
|
||||
"TA9": "wb02a.back.a9.anchor",
|
||||
"TGND": "wb02a.back.gnd.anchor",
|
||||
"TRX1": "wb02a.back.rx1.anchor",
|
||||
"TTX1": "wb02a.back.tx1.anchor"
|
||||
},
|
||||
"back": [
|
||||
{
|
||||
"type": "text",
|
||||
"pos": "0.5,2.3",
|
||||
"text": "WB02A-0882H-1518D1",
|
||||
"font_size": 1.4,
|
||||
"fill": {
|
||||
"color": "${SILK_COLOR}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "circle",
|
||||
"pos": "11.6,6.4",
|
||||
"d": 4.5,
|
||||
"preset": "copper1"
|
||||
},
|
||||
{
|
||||
"type": "rect",
|
||||
"pos": "3.5,8.5",
|
||||
"size": "4.2,3.7",
|
||||
"preset": "copper1"
|
||||
},
|
||||
{
|
||||
"id": "a9",
|
||||
"name": "label_line_up",
|
||||
"pos": "1.9,12.3",
|
||||
"vars": {
|
||||
"DIR": "left",
|
||||
"W": 1.3,
|
||||
"H": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "test_pad_1mm",
|
||||
"pos": "2.5,12.3"
|
||||
},
|
||||
{
|
||||
"id": "gnd",
|
||||
"name": "label_line_up",
|
||||
"pos": ".6,6.6",
|
||||
"vars": {
|
||||
"DIR": "left",
|
||||
"W": 0,
|
||||
"H": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "test_pad_1mm",
|
||||
"pos": "1.2,6.6"
|
||||
},
|
||||
{
|
||||
"id": "rx1",
|
||||
"name": "label_line_up",
|
||||
"pos": "3.2,6",
|
||||
"vars": {
|
||||
"DIR": "left",
|
||||
"W": 2.6,
|
||||
"H": 1.4
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "test_pad_1mm",
|
||||
"pos": "3.2,6.6"
|
||||
},
|
||||
{
|
||||
"id": "tx1",
|
||||
"name": "label_line_up",
|
||||
"pos": "5.2,6",
|
||||
"vars": {
|
||||
"DIR": "left",
|
||||
"W": 4.6,
|
||||
"H": 3.4
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "test_pad_1mm",
|
||||
"pos": "5.2,6.6"
|
||||
},
|
||||
{
|
||||
"name": "test_pad_1mm",
|
||||
"pos": "8.5,12.3"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
75
boards/_base/pcb/wb02a.json
Normal file
75
boards/_base/pcb/wb02a.json
Normal file
@@ -0,0 +1,75 @@
|
||||
{
|
||||
"pcb": {
|
||||
"templates": [
|
||||
"tuya2",
|
||||
"pcb-blue-light",
|
||||
"rf-type1"
|
||||
],
|
||||
"scale": 10.5,
|
||||
"pinout_hidden": "I2S,TRIG,WAKE,CTS,RTS,SD,SPI,I2C",
|
||||
"pinout": {
|
||||
"1": {
|
||||
"PWR": 3.3
|
||||
},
|
||||
"2": {
|
||||
"IC": 15,
|
||||
"ARD": "D0"
|
||||
},
|
||||
"3": {
|
||||
"GND": null
|
||||
},
|
||||
"4": {
|
||||
"IC": 13,
|
||||
"ARD": "D1"
|
||||
},
|
||||
"5": {
|
||||
"IC": 11,
|
||||
"ARD": "D2"
|
||||
},
|
||||
"6": {
|
||||
"IC": 21,
|
||||
"ARD": "D3"
|
||||
},
|
||||
"7": {
|
||||
"IC": 10,
|
||||
"ARD": "D4"
|
||||
},
|
||||
"8": {
|
||||
"IC": 9,
|
||||
"ARD": [
|
||||
"D5",
|
||||
"A0"
|
||||
]
|
||||
},
|
||||
"9": {
|
||||
"IC": 12,
|
||||
"ARD": [
|
||||
"D6",
|
||||
"A1"
|
||||
]
|
||||
},
|
||||
"10": {
|
||||
"IC": 7
|
||||
},
|
||||
"11": {
|
||||
"IC": 13,
|
||||
"ARD": "D1"
|
||||
},
|
||||
"TA9": {
|
||||
"IC": 17,
|
||||
"ARD": "D7"
|
||||
},
|
||||
"TGND": {
|
||||
"GND": null
|
||||
},
|
||||
"TRX1": {
|
||||
"IC": 29,
|
||||
"ARD": "D8"
|
||||
},
|
||||
"TTX1": {
|
||||
"IC": 30,
|
||||
"ARD": "D9"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
99
boards/_base/pcb/wb1s.json
Normal file
99
boards/_base/pcb/wb1s.json
Normal file
@@ -0,0 +1,99 @@
|
||||
{
|
||||
"pcb": {
|
||||
"templates": [
|
||||
"tuya1",
|
||||
"tuya1s",
|
||||
"pcb-blue-light",
|
||||
"tuya-16x24",
|
||||
"rf-type1"
|
||||
],
|
||||
"scale": 15,
|
||||
"pinout_hidden": "I2S,TRIG,WAKE,CTS,RTS,SD",
|
||||
"pinout": {
|
||||
"1": {
|
||||
"PWR": "VCC5"
|
||||
},
|
||||
"2": {
|
||||
"IC": 27,
|
||||
"ARD": "D0"
|
||||
},
|
||||
"3": {
|
||||
"IC": 26,
|
||||
"ARD": "D1"
|
||||
},
|
||||
"4": {
|
||||
"PWR": 3.3
|
||||
},
|
||||
"5": {
|
||||
"GND": null
|
||||
},
|
||||
"6": {
|
||||
"IC": 15,
|
||||
"ARD": "D2"
|
||||
},
|
||||
"7": {
|
||||
"IC": 16,
|
||||
"ARD": "D3"
|
||||
},
|
||||
"8": {
|
||||
"IC": 29,
|
||||
"ARD": "D4"
|
||||
},
|
||||
"9": {
|
||||
"IC": 24,
|
||||
"ARD": "D5"
|
||||
},
|
||||
"10": {
|
||||
"IC": 23,
|
||||
"ARD": "D6"
|
||||
},
|
||||
"11": {
|
||||
"IC": 28,
|
||||
"ARD": "D7"
|
||||
},
|
||||
"12": {
|
||||
"IC": 25,
|
||||
"ARD": "D8"
|
||||
},
|
||||
"13": {
|
||||
"IC": 22,
|
||||
"ARD": "D9"
|
||||
},
|
||||
"14": {
|
||||
"GND": null
|
||||
},
|
||||
"15": {
|
||||
"GND": null
|
||||
},
|
||||
"16": {
|
||||
"IC": 21
|
||||
},
|
||||
"17": {
|
||||
"IC": 17,
|
||||
"ARD": [
|
||||
"D10",
|
||||
"A0"
|
||||
]
|
||||
},
|
||||
"18": {
|
||||
"GND": null
|
||||
},
|
||||
"19": {
|
||||
"IC": 17,
|
||||
"ARD": [
|
||||
"D10",
|
||||
"A0"
|
||||
]
|
||||
},
|
||||
"20": {
|
||||
"IC": 18
|
||||
},
|
||||
"21": {
|
||||
"IC": 19
|
||||
},
|
||||
"22": {
|
||||
"IC": 20
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
16
boards/_base/pcb/wb2l-m1-test.json
Normal file
16
boards/_base/pcb/wb2l-m1-test.json
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"pcb": {
|
||||
"test_pads": {
|
||||
"TRST": "wb2l-m1.back.rst.anchor",
|
||||
"TRX1": "wb2l-m1.back.u1_rxd.anchor",
|
||||
"TTX1": "wb2l-m1.back.u1_txd.anchor",
|
||||
"TRX2": "wb2l-m1.back.u2_rxd.anchor",
|
||||
"TTX2": "wb2l-m1.back.u2_txd.anchor",
|
||||
"TGND": "wb2l-m1.back.gnd.anchor",
|
||||
"TSCK": "wb2l-m1.back.f_sck.anchor",
|
||||
"TCSN": "wb2l-m1.back.f_csn.anchor",
|
||||
"TSI": "wb2l-m1.back.f_si.anchor",
|
||||
"TSO": "wb2l-m1.back.f_so.anchor"
|
||||
}
|
||||
}
|
||||
}
|
||||
165
boards/_base/pcb/wb2l-test.json
Normal file
165
boards/_base/pcb/wb2l-test.json
Normal file
@@ -0,0 +1,165 @@
|
||||
{
|
||||
"pcb": {
|
||||
"test_pads": {
|
||||
"TRST": "wb2l.back.rst.anchor",
|
||||
"TRX1": "wb2l.back.u1_rxd.anchor",
|
||||
"TTX1": "wb2l.back.u1_txd.anchor",
|
||||
"TRX2": "wb2l.back.u2_rxd.anchor",
|
||||
"TTX2": "wb2l.back.u2_txd.anchor",
|
||||
"TGND": "wb2l.back.gnd.anchor",
|
||||
"TSCK": "wb2l.back.f_sck.anchor",
|
||||
"TCSN": "wb2l.back.f_csn.anchor",
|
||||
"TSI": "wb2l.back.f_si.anchor",
|
||||
"TSO": "wb2l.back.f_so.anchor"
|
||||
},
|
||||
"back": [
|
||||
{
|
||||
"name": "test_pad_1mm",
|
||||
"pos": "1.5,7.5"
|
||||
},
|
||||
{
|
||||
"name": "label_line_down",
|
||||
"pos": "0.4,4.7",
|
||||
"vars": {
|
||||
"DIR": "right",
|
||||
"W": 0.2,
|
||||
"H": 2.7
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "rst.anchor",
|
||||
"type": "rect",
|
||||
"pos": "0.9,5.0",
|
||||
"size": "0,0",
|
||||
"label_dir": "left",
|
||||
"label_size": 2
|
||||
},
|
||||
{
|
||||
"name": "test_pad_1mm",
|
||||
"pos": "2.2,5.9"
|
||||
},
|
||||
{
|
||||
"id": "u1_rxd",
|
||||
"name": "label_line_up",
|
||||
"pos": "2.2,5.1",
|
||||
"vars": {
|
||||
"DIR": "left",
|
||||
"W": 1.5,
|
||||
"H": 2
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "test_pad_1mm",
|
||||
"pos": "4.0,5.9"
|
||||
},
|
||||
{
|
||||
"id": "u1_txd",
|
||||
"name": "label_line_up",
|
||||
"pos": "4.0,5.1",
|
||||
"vars": {
|
||||
"DIR": "left",
|
||||
"W": 3.3,
|
||||
"H": 4
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "test_pad_1mm",
|
||||
"pos": "5.7,5.9"
|
||||
},
|
||||
{
|
||||
"id": "u2_rxd",
|
||||
"name": "label_line_up",
|
||||
"pos": "5.7,5.1",
|
||||
"vars": {
|
||||
"DIR": "left",
|
||||
"W": 5.0,
|
||||
"H": 6
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "test_pad_1mm",
|
||||
"pos": "7.3,5.9"
|
||||
},
|
||||
{
|
||||
"id": "u2_txd",
|
||||
"name": "label_line_up",
|
||||
"pos": "7.3,5.1",
|
||||
"vars": {
|
||||
"DIR": "left",
|
||||
"W": 6.6,
|
||||
"H": 8
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "test_pad_1mm",
|
||||
"pos": "9.2,5.9"
|
||||
},
|
||||
{
|
||||
"id": "gnd",
|
||||
"name": "label_line_up",
|
||||
"pos": "9.2,5.1",
|
||||
"vars": {
|
||||
"DIR": "left",
|
||||
"W": 8.5,
|
||||
"H": 10
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "test_pad_1mm",
|
||||
"pos": "2.2,10.7"
|
||||
},
|
||||
{
|
||||
"id": "f_sck",
|
||||
"name": "label_line_up",
|
||||
"pos": "2.2,9.9",
|
||||
"vars": {
|
||||
"DIR": "left",
|
||||
"W": 1.5,
|
||||
"H": 1.0
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "test_pad_1mm",
|
||||
"pos": "2.2,12.0"
|
||||
},
|
||||
{
|
||||
"id": "f_csn",
|
||||
"name": "label_line_down",
|
||||
"pos": "2.2,12.8",
|
||||
"vars": {
|
||||
"DIR": "left",
|
||||
"W": 1.5,
|
||||
"H": 1.0
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "test_pad_1mm",
|
||||
"pos": "3.5,13.5"
|
||||
},
|
||||
{
|
||||
"id": "f_so",
|
||||
"name": "label_line_down",
|
||||
"pos": "3.5,14.3",
|
||||
"vars": {
|
||||
"DIR": "left",
|
||||
"W": 2.8,
|
||||
"H": 1.5
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "test_pad_1mm",
|
||||
"pos": "5.2,13.5"
|
||||
},
|
||||
{
|
||||
"id": "f_si",
|
||||
"name": "label_line_down",
|
||||
"pos": "5.2,14.3",
|
||||
"vars": {
|
||||
"DIR": "left",
|
||||
"W": 4.5,
|
||||
"H": 3.5
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
79
boards/_base/pcb/wb2l.json
Normal file
79
boards/_base/pcb/wb2l.json
Normal file
@@ -0,0 +1,79 @@
|
||||
{
|
||||
"pcb": {
|
||||
"templates": [
|
||||
"tuya2l",
|
||||
"pcb-white",
|
||||
"rf-type1"
|
||||
],
|
||||
"pinout_hidden": "I2S",
|
||||
"pinout": {
|
||||
"1": {
|
||||
"IC": 24,
|
||||
"ARD": "D0"
|
||||
},
|
||||
"2": {
|
||||
"IC": 23,
|
||||
"ARD": "D1"
|
||||
},
|
||||
"3": {
|
||||
"IC": 22,
|
||||
"ARD": "D2"
|
||||
},
|
||||
"4": {
|
||||
"IC": 15,
|
||||
"ARD": "D3"
|
||||
},
|
||||
"5": {
|
||||
"IC": 16,
|
||||
"ARD": "D4"
|
||||
},
|
||||
"6": {
|
||||
"GND": null
|
||||
},
|
||||
"7": {
|
||||
"PWR": 3.3
|
||||
},
|
||||
"TGND": {
|
||||
"GND": null
|
||||
},
|
||||
"TRST": {
|
||||
"IC": 21
|
||||
},
|
||||
"TRX1": {
|
||||
"IC": 26,
|
||||
"ARD": "D5"
|
||||
},
|
||||
"TTX1": {
|
||||
"IC": 27,
|
||||
"ARD": "D6"
|
||||
},
|
||||
"TRX2": {
|
||||
"IC": 28,
|
||||
"ARD": "D7"
|
||||
},
|
||||
"TTX2": {
|
||||
"IC": 29,
|
||||
"ARD": "D8"
|
||||
},
|
||||
"TSCK": {
|
||||
"IC": 20,
|
||||
"ARD": "D9"
|
||||
},
|
||||
"TCSN": {
|
||||
"IC": 19,
|
||||
"ARD": "D10"
|
||||
},
|
||||
"TSO": {
|
||||
"IC": 17,
|
||||
"ARD": [
|
||||
"D11",
|
||||
"A0"
|
||||
]
|
||||
},
|
||||
"TSI": {
|
||||
"IC": 18,
|
||||
"ARD": "D12"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
158
boards/_base/pcb/wb2s-test.json
Normal file
158
boards/_base/pcb/wb2s-test.json
Normal file
@@ -0,0 +1,158 @@
|
||||
{
|
||||
"pcb": {
|
||||
"test_pads": {
|
||||
"TRST": "wb2s.back.cen.anchor",
|
||||
"TRX2": "wb2s.back.2rx.anchor",
|
||||
"TTX2": "wb2s.back.2tx.anchor",
|
||||
"TGND": "wb2s.back.gnd.anchor",
|
||||
"TSCK": "wb2s.back.sck.anchor",
|
||||
"TCSN": "wb2s.back.csn.anchor",
|
||||
"TSI": "wb2s.back.si.anchor",
|
||||
"TSO": "wb2s.back.adc_so.anchor",
|
||||
"TPWM3": "wb2s.back.pwm3.anchor",
|
||||
"TVCC": "wb2s.back.vbat.anchor"
|
||||
},
|
||||
"back": [
|
||||
{
|
||||
"name": "test_pad_1mm",
|
||||
"pos": "2.6,6.2"
|
||||
},
|
||||
{
|
||||
"id": "sck",
|
||||
"name": "label_line_up",
|
||||
"pos": "2.6,5.4",
|
||||
"vars": {
|
||||
"DIR": "left",
|
||||
"W": 1.3,
|
||||
"H": 2
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "test_pad_1mm",
|
||||
"pos": "4.6,6.2"
|
||||
},
|
||||
{
|
||||
"id": "pwm3",
|
||||
"name": "label_line_up",
|
||||
"pos": "4.6,5.4",
|
||||
"vars": {
|
||||
"DIR": "left",
|
||||
"W": 3.3,
|
||||
"H": 4
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "test_pad_1mm",
|
||||
"pos": "7.0,6.2"
|
||||
},
|
||||
{
|
||||
"id": "2rx",
|
||||
"name": "label_line_up",
|
||||
"pos": "7.0,5.4",
|
||||
"vars": {
|
||||
"DIR": "right",
|
||||
"W": 2,
|
||||
"H": 4
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "test_pad_1mm",
|
||||
"pos": "9.0,6.2"
|
||||
},
|
||||
{
|
||||
"id": "2tx",
|
||||
"name": "label_line_up",
|
||||
"pos": "9.0,5.4",
|
||||
"vars": {
|
||||
"DIR": "right",
|
||||
"W": 0,
|
||||
"H": 2
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "test_pad_1mm",
|
||||
"pos": "3.0,8.3"
|
||||
},
|
||||
{
|
||||
"id": "csn",
|
||||
"name": "label_line_up",
|
||||
"pos": "2.2,8.4",
|
||||
"vars": {
|
||||
"DIR": "left",
|
||||
"W": 0.9,
|
||||
"H": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "test_pad_1mm",
|
||||
"pos": "5.2,8.8"
|
||||
},
|
||||
{
|
||||
"id": "si",
|
||||
"name": "label_line_up",
|
||||
"pos": "6.0,8.9",
|
||||
"vars": {
|
||||
"DIR": "right",
|
||||
"W": 3,
|
||||
"H": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "test_pad_1mm",
|
||||
"pos": "2.1,11.6"
|
||||
},
|
||||
{
|
||||
"id": "adc_so",
|
||||
"name": "label_line_up",
|
||||
"pos": "1.3,11.7",
|
||||
"vars": {
|
||||
"DIR": "left",
|
||||
"W": 0,
|
||||
"H": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "test_pad_1mm",
|
||||
"pos": "4.3,11.6"
|
||||
},
|
||||
{
|
||||
"id": "cen",
|
||||
"name": "label_line_up",
|
||||
"pos": "5.1,11.7",
|
||||
"vars": {
|
||||
"DIR": "right",
|
||||
"W": 3.9,
|
||||
"H": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "test_pad_1mm",
|
||||
"pos": "2.5,14.5"
|
||||
},
|
||||
{
|
||||
"id": "vbat",
|
||||
"name": "label_line_up",
|
||||
"pos": "1.7,14.6",
|
||||
"vars": {
|
||||
"DIR": "left",
|
||||
"W": 0.4,
|
||||
"H": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "test_pad_1mm",
|
||||
"pos": "4.8,14.5"
|
||||
},
|
||||
{
|
||||
"id": "gnd",
|
||||
"name": "label_line_up",
|
||||
"pos": "5.6,14.6",
|
||||
"vars": {
|
||||
"DIR": "right",
|
||||
"W": 3.4,
|
||||
"H": 0
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
96
boards/_base/pcb/wb2s.json
Normal file
96
boards/_base/pcb/wb2s.json
Normal file
@@ -0,0 +1,96 @@
|
||||
{
|
||||
"pcb": {
|
||||
"templates": [
|
||||
"tuya2",
|
||||
"pcb-blue-light",
|
||||
"rf-type1"
|
||||
],
|
||||
"pinout_hidden": "I2S,FLASH",
|
||||
"pinout": {
|
||||
"1": {
|
||||
"PWR": 3.3
|
||||
},
|
||||
"2": {
|
||||
"IC": 24,
|
||||
"ARD": "D0"
|
||||
},
|
||||
"3": {
|
||||
"GND": null
|
||||
},
|
||||
"4": {
|
||||
"IC": 23,
|
||||
"ARD": "D1"
|
||||
},
|
||||
"5": {
|
||||
"IC": 26,
|
||||
"ARD": "D4"
|
||||
},
|
||||
"6": {
|
||||
"IC": 22,
|
||||
"ARD": "D2"
|
||||
},
|
||||
"7": {
|
||||
"IC": 27,
|
||||
"ARD": "D5"
|
||||
},
|
||||
"8": {
|
||||
"IC": 17,
|
||||
"ARD": [
|
||||
"D3",
|
||||
"A0"
|
||||
]
|
||||
},
|
||||
"9": {
|
||||
"IC": 16,
|
||||
"ARD": "D6"
|
||||
},
|
||||
"10": {
|
||||
"IC": 21
|
||||
},
|
||||
"11": {
|
||||
"IC": 15,
|
||||
"ARD": "D7"
|
||||
},
|
||||
"TSCK": {
|
||||
"IC": 20,
|
||||
"ARD": "D8"
|
||||
},
|
||||
"TPWM3": {
|
||||
"IC": 25,
|
||||
"ARD": "D9"
|
||||
},
|
||||
"TRX2": {
|
||||
"IC": 28,
|
||||
"ARD": "D10"
|
||||
},
|
||||
"TTX2": {
|
||||
"IC": 29,
|
||||
"ARD": "D11"
|
||||
},
|
||||
"TCSN": {
|
||||
"IC": 19,
|
||||
"ARD": "D12"
|
||||
},
|
||||
"TSI": {
|
||||
"IC": 18,
|
||||
"ARD": "D13"
|
||||
},
|
||||
"TSO": {
|
||||
"IC": 17,
|
||||
"ARD": [
|
||||
"D3",
|
||||
"A0"
|
||||
]
|
||||
},
|
||||
"TRST": {
|
||||
"CTRL": "^RST"
|
||||
},
|
||||
"TVCC": {
|
||||
"PWR": 3.3
|
||||
},
|
||||
"TGND": {
|
||||
"GND": null
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
102
boards/_base/pcb/wb3l.json
Normal file
102
boards/_base/pcb/wb3l.json
Normal file
@@ -0,0 +1,102 @@
|
||||
{
|
||||
"pcb": {
|
||||
"templates": [
|
||||
"esp12e-21",
|
||||
"pcb-white",
|
||||
"tuya-16x24",
|
||||
"rf-type1"
|
||||
],
|
||||
"vars": {
|
||||
"PINHOLE": 0
|
||||
},
|
||||
"pinout_hidden": "I2S,SD",
|
||||
"pinout": {
|
||||
"1": {
|
||||
"NC": null
|
||||
},
|
||||
"2": {
|
||||
"IC": 17,
|
||||
"ARD": [
|
||||
"D0",
|
||||
"A0"
|
||||
]
|
||||
},
|
||||
"3": {
|
||||
"IC": 21
|
||||
},
|
||||
"4": {
|
||||
"IC": 11,
|
||||
"ARD": "D1"
|
||||
},
|
||||
"5": {
|
||||
"IC": 15,
|
||||
"ARD": "D2"
|
||||
},
|
||||
"6": {
|
||||
"IC": 16,
|
||||
"ARD": "D3"
|
||||
},
|
||||
"7": {
|
||||
"IC": 22,
|
||||
"ARD": "D4"
|
||||
},
|
||||
"8": {
|
||||
"PWR": 3.3
|
||||
},
|
||||
"9": {
|
||||
"GND": null
|
||||
},
|
||||
"10": {
|
||||
"IC": 25,
|
||||
"ARD": "D5"
|
||||
},
|
||||
"11": {
|
||||
"IC": 29,
|
||||
"ARD": "D6"
|
||||
},
|
||||
"12": {
|
||||
"IC": 12,
|
||||
"ARD": "D7"
|
||||
},
|
||||
"13": {
|
||||
"IC": 24,
|
||||
"ARD": "D8"
|
||||
},
|
||||
"14": {
|
||||
"IC": 23,
|
||||
"ARD": "D9"
|
||||
},
|
||||
"15": {
|
||||
"IC": 26,
|
||||
"ARD": "D10"
|
||||
},
|
||||
"16": {
|
||||
"IC": 27,
|
||||
"ARD": "D11"
|
||||
},
|
||||
"17": {
|
||||
"IC": 17,
|
||||
"ARD": [
|
||||
"D0",
|
||||
"A0"
|
||||
]
|
||||
},
|
||||
"18": {
|
||||
"IC": 18,
|
||||
"ARD": "D12"
|
||||
},
|
||||
"19": {
|
||||
"IC": 19,
|
||||
"ARD": "D13"
|
||||
},
|
||||
"20": {
|
||||
"IC": 20,
|
||||
"ARD": "D14"
|
||||
},
|
||||
"21": {
|
||||
"IC": 28,
|
||||
"ARD": "D15"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user