Compare commits

...

51 Commits

Author SHA1 Message Date
Ben V. Brown
816b1b03a1 Merge c6f5fdd7be into 57c8a35041 2025-02-22 06:33:38 +00:00
Ben V. Brown
c6f5fdd7be Refactor I2C result to use notifications, allowing faster task yield
Some checks are pending
CI / build (MHP30) (push) Waiting to run
CI / tests (push) Waiting to run
CI / build (Pinecil) (push) Waiting to run
CI / build (Pinecilv2) (push) Waiting to run
CI / build (S60) (push) Waiting to run
CI / build (S60P) (push) Waiting to run
CI / build (T55) (push) Waiting to run
CI / build (TS100) (push) Waiting to run
CI / check_c-cpp (push) Waiting to run
CI / build (TS101) (push) Waiting to run
CI / build (TS80) (push) Waiting to run
CI / build (TS80P) (push) Waiting to run
CI / build_multi-lang (Pinecil) (push) Waiting to run
CI / build_multi-lang (Pinecilv2) (push) Waiting to run
CI / upload_metadata (push) Blocked by required conditions
CI / check_python (push) Waiting to run
CI / check_shell (push) Waiting to run
CI / check_docs (push) Waiting to run
So that one I2C done, task can directly swap and pickup later if I2C is blocking
2025-02-22 17:33:33 +11:00
Ben V. Brown
c888e8bba1 Add some PinecilV2 troubleshooing notes
Some checks are pending
CI / upload_metadata (push) Blocked by required conditions
CI / build (MHP30) (push) Waiting to run
CI / build (Pinecil) (push) Waiting to run
CI / build (Pinecilv2) (push) Waiting to run
CI / build (S60) (push) Waiting to run
CI / build (S60P) (push) Waiting to run
CI / build (T55) (push) Waiting to run
CI / build (TS100) (push) Waiting to run
CI / build (TS101) (push) Waiting to run
CI / build (TS80) (push) Waiting to run
CI / build (TS80P) (push) Waiting to run
CI / build_multi-lang (Pinecil) (push) Waiting to run
CI / build_multi-lang (Pinecilv2) (push) Waiting to run
CI / tests (push) Waiting to run
CI / check_c-cpp (push) Waiting to run
CI / check_python (push) Waiting to run
CI / check_shell (push) Waiting to run
CI / check_docs (push) Waiting to run
2025-02-22 15:04:49 +11:00
Ben V. Brown
6bc3811706 IRQ Read from FiFo 2025-02-22 14:56:24 +11:00
Ben V. Brown
aa1ac1f203 Ensure lock occurs once result captured 2025-02-22 14:53:45 +11:00
Ben V. Brown
4894451646 Add Rx FIFO status 2025-02-22 14:44:17 +11:00
Ben V. Brown
bef8233aa7 Use IRQ for all I2C Writes 2025-02-22 14:02:49 +11:00
Ben V. Brown
1095d1bc0a I2C inner function needs irq's 2025-02-22 13:32:00 +11:00
Ben V. Brown
5e8d44e07f [Squash] Move I2C to IRQ based for big txn
Squash DMA attempt out

.
2025-02-22 13:32:00 +11:00
Ben V. Brown
abefe96072 Use runaway counter trigger 2025-02-22 13:32:00 +11:00
Ben V. Brown
92730d1acb Use the ADC_MAX_READING value 2025-02-22 13:32:00 +11:00
Ben V. Brown
81da39e09f Update I2C_Wrapper.cpp 2025-02-22 13:31:59 +11:00
Ben V. Brown
57c8a35041 Merge pull request #2081 from Ralim/pd-sink-cap
Some checks are pending
Docs / deploy-docs (push) Waiting to run
CI / check_docs (push) Waiting to run
CI / build (MHP30) (push) Waiting to run
CI / build (Pinecil) (push) Waiting to run
CI / build (Pinecilv2) (push) Waiting to run
CI / build (S60) (push) Waiting to run
CI / build (S60P) (push) Waiting to run
CI / build (T55) (push) Waiting to run
CI / build (TS100) (push) Waiting to run
CI / build (TS101) (push) Waiting to run
CI / build (TS80) (push) Waiting to run
CI / build (TS80P) (push) Waiting to run
CI / build_multi-lang (Pinecil) (push) Waiting to run
CI / build_multi-lang (Pinecilv2) (push) Waiting to run
CI / upload_metadata (push) Blocked by required conditions
CI / tests (push) Waiting to run
CI / check_c-cpp (push) Waiting to run
CI / check_python (push) Waiting to run
CI / check_shell (push) Waiting to run
USB-PD: Add minimal sink caps
2025-02-22 11:38:53 +11:00
Ben V. Brown
3ed86d2acf sink caps: Add default profiles 2025-02-22 11:35:49 +11:00
Ben V. Brown
7c6ce812f6 Add minimal sink caps 2025-02-22 11:24:02 +11:00
Ivan Zorin
c92bf89296 Merge pull request #2075 from ia/debug-time
Some checks failed
Docs / deploy-docs (push) Has been cancelled
CI / build (MHP30) (push) Has been cancelled
CI / build (Pinecil) (push) Has been cancelled
CI / build (Pinecilv2) (push) Has been cancelled
CI / build (S60) (push) Has been cancelled
CI / build (S60P) (push) Has been cancelled
CI / build (T55) (push) Has been cancelled
CI / build (TS100) (push) Has been cancelled
CI / build (TS101) (push) Has been cancelled
CI / build (TS80) (push) Has been cancelled
CI / build (TS80P) (push) Has been cancelled
CI / build_multi-lang (Pinecil) (push) Has been cancelled
CI / build_multi-lang (Pinecilv2) (push) Has been cancelled
CI / tests (push) Has been cancelled
CI / check_c-cpp (push) Has been cancelled
CI / check_python (push) Has been cancelled
CI / check_shell (push) Has been cancelled
CI / check_docs (push) Has been cancelled
CI / upload_metadata (push) Has been cancelled
Debug Menu: add time of compilation to timestamp build
2025-02-19 09:43:07 +03:00
Ivan Zorin
8a392b5364 Add the notice about EPR/PPS disabled by default in the main README.md (#2074)
* README.md: Supported Hardware - add notice about EPR/PPS disabled by default.
2025-02-19 17:42:55 +11:00
Ivan Zorin
68aac2847b Debug Menu: update documentation about timestamp format 2025-02-13 07:59:20 +03:00
Ivan Zorin
dc2b91c879 Debug Menu: add time of compilation to timestamp build 2025-02-13 07:49:22 +03:00
Ben V. Brown
ebdff59293 Default to no EPR/PPS so its opt in (#2073)
Some checks failed
Docs / deploy-docs (push) Has been cancelled
CI / build (MHP30) (push) Has been cancelled
CI / build (Pinecil) (push) Has been cancelled
CI / build (Pinecilv2) (push) Has been cancelled
CI / build (S60) (push) Has been cancelled
CI / build (S60P) (push) Has been cancelled
CI / build (T55) (push) Has been cancelled
CI / build (TS100) (push) Has been cancelled
CI / build (TS101) (push) Has been cancelled
CI / build (TS80) (push) Has been cancelled
CI / build (TS80P) (push) Has been cancelled
CI / build_multi-lang (Pinecil) (push) Has been cancelled
CI / build_multi-lang (Pinecilv2) (push) Has been cancelled
CI / tests (push) Has been cancelled
CI / check_c-cpp (push) Has been cancelled
CI / check_python (push) Has been cancelled
CI / check_shell (push) Has been cancelled
CI / check_docs (push) Has been cancelled
CI / upload_metadata (push) Has been cancelled
Some chargers have funky PPS.
Plus some do not want EPR be default (even though 28V is safe by designer on PinecilV2).

So take the safest option by default and make it opt-in
2025-02-08 09:17:01 +03:00
Leo
08ff68cd4f Added guide for compiling under Windows (#2060)
Some checks are pending
Docs / deploy-docs (push) Waiting to run
CI / build (MHP30) (push) Waiting to run
CI / build (Pinecil) (push) Waiting to run
CI / build (Pinecilv2) (push) Waiting to run
CI / build (S60) (push) Waiting to run
CI / build (S60P) (push) Waiting to run
CI / build (T55) (push) Waiting to run
CI / build (TS100) (push) Waiting to run
CI / build (TS101) (push) Waiting to run
CI / build (TS80) (push) Waiting to run
CI / build (TS80P) (push) Waiting to run
CI / build_multi-lang (Pinecil) (push) Waiting to run
CI / build_multi-lang (Pinecilv2) (push) Waiting to run
CI / upload_metadata (push) Blocked by required conditions
CI / tests (push) Waiting to run
CI / check_c-cpp (push) Waiting to run
CI / check_python (push) Waiting to run
CI / check_shell (push) Waiting to run
CI / check_docs (push) Waiting to run
* Update documentation to build IronOS in Windows using MSYS2 environment and fix compilation on case-sensitive file systems.

---------

Co-authored-by: Ivan Zorin <ivan.a.zorin@gmail.com>
2025-02-08 00:03:49 +03:00
Ivan Zorin
4ce63fab47 README.md: fix formatting of heading levels for BLE section (#2068)
Some checks failed
Docs / deploy-docs (push) Has been cancelled
CI / build (MHP30) (push) Has been cancelled
CI / build (Pinecil) (push) Has been cancelled
CI / build (Pinecilv2) (push) Has been cancelled
CI / build (S60) (push) Has been cancelled
CI / build (S60P) (push) Has been cancelled
CI / build (T55) (push) Has been cancelled
CI / build (TS100) (push) Has been cancelled
CI / build (TS101) (push) Has been cancelled
CI / build (TS80) (push) Has been cancelled
CI / build (TS80P) (push) Has been cancelled
CI / build_multi-lang (Pinecil) (push) Has been cancelled
CI / build_multi-lang (Pinecilv2) (push) Has been cancelled
CI / tests (push) Has been cancelled
CI / check_c-cpp (push) Has been cancelled
CI / check_python (push) Has been cancelled
CI / check_shell (push) Has been cancelled
CI / check_docs (push) Has been cancelled
CI / upload_metadata (push) Has been cancelled
2025-02-03 09:14:51 +11:00
Ivan Zorin
02bc98e41e Merge pull request #2067 from ia/readme-ble
README.md: add notice about BLE turned off by default now
2025-02-02 21:37:28 +03:00
Ivan Zorin
f01ab47647 README.md: update formatting 2025-02-02 21:25:07 +03:00
Ivan Zorin
c7b029482e README.md: add BLE notice 2025-02-02 21:18:56 +03:00
Ben V. Brown
e2c4ea4589 Merge pull request #2066 from safocl/fix_union_member_usage
Some checks are pending
Docs / deploy-docs (push) Waiting to run
CI / build (MHP30) (push) Waiting to run
CI / build (Pinecil) (push) Waiting to run
CI / build (Pinecilv2) (push) Waiting to run
CI / build (S60) (push) Waiting to run
CI / build (S60P) (push) Waiting to run
CI / build (T55) (push) Waiting to run
CI / build (TS100) (push) Waiting to run
CI / build (TS101) (push) Waiting to run
CI / build (TS80) (push) Waiting to run
CI / build (TS80P) (push) Waiting to run
CI / build_multi-lang (Pinecil) (push) Waiting to run
CI / build_multi-lang (Pinecilv2) (push) Waiting to run
CI / upload_metadata (push) Blocked by required conditions
CI / tests (push) Waiting to run
CI / check_c-cpp (push) Waiting to run
CI / check_python (push) Waiting to run
CI / check_shell (push) Waiting to run
CI / check_docs (push) Waiting to run
fix: accessing inactive union members
2025-02-02 20:59:03 +11:00
safocl
5797d5a68b fix: accessing inactive union members
Access to the inactive union members is an undefined behavior.
`column.whole = (1 << height) - 1;` -- 'whole' is active member here,
`fillArea(OLED_WIDTH - 1, 0, 1, 8, column.strips[0]);` -- but the 'strips'
member accessed here.
Same issue: https://gitlab.com/libeigen/eigen/-/issues/2898
2025-02-02 13:48:49 +04:00
safocl
ab1fa24863 settingsGUI.cpp: remove duplicated calls (#2065)
settingsGUI.cpp: remove duplicated calls from if-else blocks
2025-02-02 08:45:17 +03:00
Ivan Zorin
22d0676a5c scripts/deploy.sh: add handmade linter for translation-related json files to check for tabs and odd spaces (#2064)
Some checks are pending
Docs / deploy-docs (push) Waiting to run
CI / build (MHP30) (push) Waiting to run
CI / build (Pinecil) (push) Waiting to run
CI / build (Pinecilv2) (push) Waiting to run
CI / build (S60) (push) Waiting to run
CI / build (S60P) (push) Waiting to run
CI / build (T55) (push) Waiting to run
CI / build (TS100) (push) Waiting to run
CI / build (TS101) (push) Waiting to run
CI / build (TS80) (push) Waiting to run
CI / build (TS80P) (push) Waiting to run
CI / build_multi-lang (Pinecil) (push) Waiting to run
CI / build_multi-lang (Pinecilv2) (push) Waiting to run
CI / upload_metadata (push) Blocked by required conditions
CI / tests (push) Waiting to run
CI / check_c-cpp (push) Waiting to run
CI / check_python (push) Waiting to run
CI / check_shell (push) Waiting to run
CI / check_docs (push) Waiting to run
* scripts/deploy.sh: add handmade linter for translation-related json files to check for tabs and odd spaces
2025-02-02 07:20:12 +11:00
Ivan Zorin
aa0784d34c Set python-version for actions/setup-python to remove the github actions warning (#2057)
Some checks failed
Docs / deploy-docs (push) Has been cancelled
CI / build (MHP30) (push) Has been cancelled
CI / build (Pinecil) (push) Has been cancelled
CI / build (Pinecilv2) (push) Has been cancelled
CI / build (S60) (push) Has been cancelled
CI / check_docs (push) Has been cancelled
CI / build (S60P) (push) Has been cancelled
CI / build (T55) (push) Has been cancelled
CI / build (TS100) (push) Has been cancelled
CI / build (TS101) (push) Has been cancelled
CI / build (TS80) (push) Has been cancelled
CI / build (TS80P) (push) Has been cancelled
CI / build_multi-lang (Pinecil) (push) Has been cancelled
CI / build_multi-lang (Pinecilv2) (push) Has been cancelled
CI / tests (push) Has been cancelled
CI / check_c-cpp (push) Has been cancelled
CI / check_python (push) Has been cancelled
CI / check_shell (push) Has been cancelled
CI / upload_metadata (push) Has been cancelled
2025-01-28 08:18:21 +11:00
Leo
f67cc25acc Update translation_UK.json (#2058)
Some checks failed
CI / check_python (push) Has been cancelled
Docs / deploy-docs (push) Has been cancelled
CI / build (MHP30) (push) Has been cancelled
CI / build (Pinecil) (push) Has been cancelled
CI / check_shell (push) Has been cancelled
CI / build (Pinecilv2) (push) Has been cancelled
CI / build (S60) (push) Has been cancelled
CI / build (S60P) (push) Has been cancelled
CI / build (T55) (push) Has been cancelled
CI / build (TS100) (push) Has been cancelled
CI / build (TS101) (push) Has been cancelled
CI / build (TS80) (push) Has been cancelled
CI / build (TS80P) (push) Has been cancelled
CI / build_multi-lang (Pinecil) (push) Has been cancelled
CI / build_multi-lang (Pinecilv2) (push) Has been cancelled
CI / tests (push) Has been cancelled
CI / check_c-cpp (push) Has been cancelled
CI / check_docs (push) Has been cancelled
CI / upload_metadata (push) Has been cancelled
* Update translation_UK.json

Unified statement to one type of translation ("Sleep mode" instead of "Waiting mode")
Corrected "blink" translation
Shortened phrases for statements ("t° у сек"/"градусів на секунду"; "сек"/"секунд","секунди"; "Хв"/"Хвилин","Хвилини")
Traslated soldering tip type selection menu
2025-01-25 16:00:10 +03:00
fredericuslaurentii
dfddd5916a Update translation_IT.json (#2052)
Some checks failed
Docs / deploy-docs (push) Has been cancelled
CI / build (MHP30) (push) Has been cancelled
CI / build (Pinecil) (push) Has been cancelled
CI / build (Pinecilv2) (push) Has been cancelled
CI / build (S60) (push) Has been cancelled
CI / build (S60P) (push) Has been cancelled
CI / build (T55) (push) Has been cancelled
CI / build (TS100) (push) Has been cancelled
CI / build (TS101) (push) Has been cancelled
CI / build (TS80) (push) Has been cancelled
CI / build (TS80P) (push) Has been cancelled
CI / build_multi-lang (Pinecil) (push) Has been cancelled
CI / build_multi-lang (Pinecilv2) (push) Has been cancelled
CI / tests (push) Has been cancelled
CI / check_c-cpp (push) Has been cancelled
CI / check_python (push) Has been cancelled
CI / check_shell (push) Has been cancelled
CI / check_docs (push) Has been cancelled
CI / upload_metadata (push) Has been cancelled
2025-01-20 21:48:34 +01:00
Ben V. Brown
fd91cf9f35 Revert "Merge pull request #2048 from Ralim/pinecilv2-i2c-rework"
Some checks failed
Docs / deploy-docs (push) Has been cancelled
CI / build (MHP30) (push) Has been cancelled
CI / tests (push) Has been cancelled
CI / build (Pinecil) (push) Has been cancelled
CI / build (Pinecilv2) (push) Has been cancelled
CI / build (S60) (push) Has been cancelled
CI / build (S60P) (push) Has been cancelled
CI / build (T55) (push) Has been cancelled
CI / build (TS100) (push) Has been cancelled
CI / check_c-cpp (push) Has been cancelled
CI / build (TS101) (push) Has been cancelled
CI / build (TS80) (push) Has been cancelled
CI / build (TS80P) (push) Has been cancelled
CI / build_multi-lang (Pinecil) (push) Has been cancelled
CI / build_multi-lang (Pinecilv2) (push) Has been cancelled
CI / check_python (push) Has been cancelled
CI / check_shell (push) Has been cancelled
CI / check_docs (push) Has been cancelled
CI / upload_metadata (push) Has been cancelled
This reverts commit b401dc8264, reversing
changes made to 42fb9e1105.
2025-01-11 12:46:32 +11:00
Ben V. Brown
b401dc8264 Merge pull request #2048 from Ralim/pinecilv2-i2c-rework
Some checks are pending
Docs / deploy-docs (push) Waiting to run
CI / tests (push) Waiting to run
CI / build (MHP30) (push) Waiting to run
CI / check_c-cpp (push) Waiting to run
CI / build (Pinecil) (push) Waiting to run
CI / build (Pinecilv2) (push) Waiting to run
CI / build (S60) (push) Waiting to run
CI / build (S60P) (push) Waiting to run
CI / build (T55) (push) Waiting to run
CI / build (TS100) (push) Waiting to run
CI / build (TS101) (push) Waiting to run
CI / build (TS80) (push) Waiting to run
CI / build (TS80P) (push) Waiting to run
CI / build_multi-lang (Pinecil) (push) Waiting to run
CI / build_multi-lang (Pinecilv2) (push) Waiting to run
CI / upload_metadata (push) Blocked by required conditions
CI / check_python (push) Waiting to run
CI / check_shell (push) Waiting to run
CI / check_docs (push) Waiting to run
Drop critical section on I2C
2025-01-11 10:04:33 +11:00
Ben V. Brown
a3082c389e Drop crit section on I2C 2025-01-11 10:00:50 +11:00
Ben V. Brown
42fb9e1105 Merge pull request #2042 from Ralim/fix-op-mode-enum
Some checks failed
Docs / deploy-docs (push) Has been cancelled
CI / build (MHP30) (push) Has been cancelled
CI / build (Pinecil) (push) Has been cancelled
CI / build (Pinecilv2) (push) Has been cancelled
CI / build (S60) (push) Has been cancelled
CI / build (S60P) (push) Has been cancelled
CI / build (T55) (push) Has been cancelled
CI / build (TS100) (push) Has been cancelled
CI / build (TS101) (push) Has been cancelled
CI / build (TS80) (push) Has been cancelled
CI / build (TS80P) (push) Has been cancelled
CI / build_multi-lang (Pinecil) (push) Has been cancelled
CI / build_multi-lang (Pinecilv2) (push) Has been cancelled
CI / tests (push) Has been cancelled
CI / check_c-cpp (push) Has been cancelled
CI / check_python (push) Has been cancelled
CI / check_shell (push) Has been cancelled
CI / check_docs (push) Has been cancelled
CI / upload_metadata (push) Has been cancelled
Allocate fixed ID's for Operating Modes
2025-01-06 13:05:01 +11:00
Ben V. Brown
169d9e6956 Allocate fixed ID's for Operating Modes 2025-01-06 10:19:57 +11:00
Ivan Zorin
000eba7b8c Merge pull request #2035 from KITT3000/patch-7
Some checks failed
CI / check_shell (push) Has been cancelled
CI / check_docs (push) Has been cancelled
Docs / deploy-docs (push) Has been cancelled
CI / build (MHP30) (push) Has been cancelled
CI / build (Pinecil) (push) Has been cancelled
CI / build (Pinecilv2) (push) Has been cancelled
CI / build (S60) (push) Has been cancelled
CI / build (S60P) (push) Has been cancelled
CI / build (T55) (push) Has been cancelled
CI / build (TS100) (push) Has been cancelled
CI / build (TS101) (push) Has been cancelled
CI / build (TS80) (push) Has been cancelled
CI / build (TS80P) (push) Has been cancelled
CI / build_multi-lang (Pinecil) (push) Has been cancelled
CI / build_multi-lang (Pinecilv2) (push) Has been cancelled
CI / tests (push) Has been cancelled
CI / check_c-cpp (push) Has been cancelled
CI / check_python (push) Has been cancelled
CI / upload_metadata (push) Has been cancelled
Update PL translation (v2.23 rc1)
2024-12-27 01:40:33 +03:00
Ziuta
5cf9d5bfff Update PL translation (v2.23 rc1) 2024-12-26 13:31:29 +01:00
Ivan Zorin
5347385b28 Merge pull request #2032 from ia/tip-type-ts80
Some checks failed
CI / tests (push) Has been cancelled
CI / check_c-cpp (push) Has been cancelled
CI / check_python (push) Has been cancelled
CI / check_shell (push) Has been cancelled
CI / check_docs (push) Has been cancelled
Docs / deploy-docs (push) Has been cancelled
CI / build (MHP30) (push) Has been cancelled
CI / build (Pinecil) (push) Has been cancelled
CI / build (Pinecilv2) (push) Has been cancelled
CI / build (S60) (push) Has been cancelled
CI / build (S60P) (push) Has been cancelled
CI / build (T55) (push) Has been cancelled
CI / build (TS100) (push) Has been cancelled
CI / build (TS101) (push) Has been cancelled
CI / build (TS80) (push) Has been cancelled
CI / build (TS80P) (push) Has been cancelled
CI / build_multi-lang (Pinecil) (push) Has been cancelled
CI / build_multi-lang (Pinecilv2) (push) Has been cancelled
CI / upload_metadata (push) Has been cancelled
Set tip type as auto by default in runtime
2024-12-24 05:30:39 +03:00
Ivan Zorin
1e285a6a5c Set tip type as auto by default 2024-12-24 04:04:14 +03:00
Ivan Zorin
989a2cf2d5 Merge pull request #2031 from ia/tip-type
Add macro to enable tip types for supported hardware only
2024-12-24 03:36:24 +03:00
Ivan Zorin
ee6aff54b3 Restore the original file 2024-12-23 23:01:15 +03:00
Ivan Zorin
6cf9916a6e Revert formatting for the unmodified file 2024-12-23 22:37:49 +03:00
Ivan Zorin
5f38e1812c Implement getUserSelectedTipResistance() as stub 2024-12-23 21:51:51 +03:00
Ivan Zorin
0a63b6b5df Add macro to enable tip types for supported hardware only 2024-12-23 21:13:44 +03:00
Steven Seifried
71a1e2a367 Updated translation_DE.json (again) (#2030)
Some checks failed
CI / build (TS80) (push) Has been cancelled
CI / check_shell (push) Has been cancelled
Docs / deploy-docs (push) Has been cancelled
CI / check_docs (push) Has been cancelled
CI / build (MHP30) (push) Has been cancelled
CI / build (Pinecil) (push) Has been cancelled
CI / build (Pinecilv2) (push) Has been cancelled
CI / build (S60) (push) Has been cancelled
CI / build (S60P) (push) Has been cancelled
CI / build (T55) (push) Has been cancelled
CI / build (TS100) (push) Has been cancelled
CI / build (TS101) (push) Has been cancelled
CI / build (TS80P) (push) Has been cancelled
CI / build_multi-lang (Pinecil) (push) Has been cancelled
CI / build_multi-lang (Pinecilv2) (push) Has been cancelled
CI / tests (push) Has been cancelled
CI / check_c-cpp (push) Has been cancelled
CI / check_python (push) Has been cancelled
CI / upload_metadata (push) Has been cancelled
Updated translation_DE.json
2024-12-22 21:59:32 +03:00
Ben V. Brown
37efde3d15 Merge pull request #2029 from StevenSeifried/update_translation_DE
Some checks are pending
Docs / deploy-docs (push) Waiting to run
CI / check_shell (push) Waiting to run
CI / check_docs (push) Waiting to run
CI / build (MHP30) (push) Waiting to run
CI / build (Pinecil) (push) Waiting to run
CI / build (Pinecilv2) (push) Waiting to run
CI / build (S60) (push) Waiting to run
CI / build (S60P) (push) Waiting to run
CI / build (T55) (push) Waiting to run
CI / build (TS100) (push) Waiting to run
CI / build (TS101) (push) Waiting to run
CI / build (TS80) (push) Waiting to run
CI / build (TS80P) (push) Waiting to run
CI / build_multi-lang (Pinecil) (push) Waiting to run
CI / build_multi-lang (Pinecilv2) (push) Waiting to run
CI / upload_metadata (push) Blocked by required conditions
CI / tests (push) Waiting to run
CI / check_c-cpp (push) Waiting to run
CI / check_python (push) Waiting to run
Updated translation_DE.json
2024-12-22 19:48:08 +11:00
Steven Seifried
d899dc7433 Updated translation_DE.json 2024-12-22 09:35:22 +01:00
Ben V. Brown
a9e899c1ec Merge pull request #2028 from StevenSeifried/sequre-typo
Typo corrected (Squire -> Sequre)
2024-12-22 19:01:53 +11:00
Steven Seifried
1d9b16e963 Typo corrected (Squire -> Sequre) 2024-12-22 08:42:20 +01:00
50 changed files with 811 additions and 741 deletions

View File

@@ -24,6 +24,8 @@ jobs:
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: '3.12.3'
- run: |
pip install --upgrade pip &&

View File

@@ -215,7 +215,7 @@ jobs:
steps:
- name: Install dependencies (apk)
run: apk add --no-cache git
run: apk add --no-cache git bash grep
- uses: actions/checkout@v4
with:
@@ -227,4 +227,4 @@ jobs:
run: git config --global --add safe.directory /__w/IronOS/IronOS && git config --global safe.directory "$GITHUB_WORKSPACE"
- name: Check and verify documentation
run: /bin/sh ./scripts/deploy.sh docs
run: ./scripts/deploy.sh docs

View File

@@ -40,9 +40,9 @@ I.e.:
**Additional scroll-able items appear in this order**:
### Date
### Timestamp
- This is a date of firmware compilation and it has the following format: `DD-MM-YY` (i.e., `01-07-23` means it has been built in July, 1st, 2023)
- This is a timestamp of firmware compilation and it has the following format: `YYYYMMDD HHMMSS` (i.e., `20230701 213456` means it has been built in July, 1st, 2023 at 9:34:56 pm)
### ID

View File

@@ -14,6 +14,42 @@ You will need to update the build settings for include paths and point to the ne
In the `source` folder there is a `Makefile` that can be used to build the repository using command line tools.
When running the `make` command, specify which model of the device and the language(s) you would like to use.
### Windows (MSYS2 environment)
1. Download `msys2` install package from the [official website](https://msys2.org) and install it according to the instruction there;
2. Install requried packages (here and for the future commands use **`mingw64.exe`** terminal):
```
$ pacman -S mingw-w64-x86_64-arm-none-eabi-gcc mingw-w64-x86_64-libwinpthread-git python3 python3-pip make unzip git
```
3. Download _3rd party RISC-V toolchain_ `xpack-riscv-none-elf-gcc-...-win32-x64.zip` from [this repository](https://github.com/xpack-dev-tools/riscv-none-elf-gcc-xpack/releases);
4. Move downloaded `xpack-riscv-none-elf-gcc-...-win32-x64.zip` to `msys64` _Windows_ directory (e.g., `C:\msys64\`);
5. Extract files from `xpack-riscv-none-elf-gcc-...-win32-x64.zip` and go back to _home_ directory:
```
$ cd /
$ unzip xpack-riscv-none-elf-gcc-...-win32-x64.zip
$ cd ~
```
6. Permanently set `PATH` environment variable, so all required toolchains could be available for `make` and for other build scripts:
```
$ echo 'export PATH=/xpack-riscv-none-elf-gcc-.../bin:${PATH}' >> ~/.bashrc
$ source ~/.bashrc
```
7. Additionally, `OpenOCD` and/or `ST-Link` can be installed as well to help with flashing:
```
$ pacman -S mingw-w64-x86_64-openocd
$ pacman -S mingw-w64-x86_64-stlink
```
8. Clone _IronOS_ repo:
```
$ git clone --recursive https://github.com/Ralim/IronOS.git
$ cd IronOS
```
9. Follow steps _4-8_ from [macOS section](#macos);
10. `pip` can be updated inside `venv` only:
```
$ python3 -m pip install --upgrade pip
```
### macOS
Use the following steps to set up a build environment for IronOS on the command line (in Terminal).

View File

@@ -24,7 +24,7 @@ In general you probably want `master`.
Once you click on a run, scroll down to the "Artifacts" section and then click on your device model name to download a zip file.
Then this works the same as a production release (use the correct file).
# Pinecil V2
## Pinecil V2
- The MCU in Pinecil V2 is Bouffalo BL706 and does _not_ use usb-dfu for flashing as the previous Pinecil V1 MCU did.
- See the Pinecil Wiki page [here](https://wiki.pine64.org/wiki/Pinecil#Firmware_&_Updates) for instructions.
@@ -34,3 +34,16 @@ Then this works the same as a production release (use the correct file).
- One advantage of Pinecil is that you cannot permanently damage it doing a firmware update (because BIN is in ROM); an update could render Pinecil temporarily inoperable if you flash an invalid firmware. But no worries, simply re-flashing with a working firmware copy will fix everything.
- USB-C cable is required to do an update. Generally, all USB controllers work, but some hubs have issues, so it is preferred to avoid USB hubs for updates.
- Background on the [BL706 chipset](https://lupyuen.github.io/articles/bl706)
### Troubleshooting
If you are running into issues such as timeouts during the programming or bootloader errors, the BL702 has a not-amazing USB PHY built in. This can cause problems on cheap cables (especially "thin" ones that tend not to have shielding). One of the authors (Ralim) has found this especially common on the cables supplied with Apple chargers when used with newer Ryzen processor ports.
It is _strongly_ reccomended to use a good quality cable, ideally _short_.
Also try other USB ports, as on some devices they can use different hub's or lengths of signalling, and this can fix the issue.
By the PinecilV2's design, by default some of the internal buses are exposed on the USB3 pins, to enable hacking/debugging/mods. This is suspected it _may_ play poorly on some chipsets. Try using a USB2.0 cable. Others have had luck with chaining USB-C->USB-A->USB-C. This may be due to this, as a lot of these adaptors are USB2 or only USB3 5gbps (half USB3 pins).
Another workaround is to put a USB hub somewhere in the chain, as these will re-form the signal and can work around the issue.
_Finally_, some users have reported issues under Windows that were fixed by changing OS (Typically to a Linux live cd).

View File

@@ -39,7 +39,7 @@ The model should be replaced by one of the following options:
- `pinecilv1` for the Pinecil V1
- `pinecilv2` for the Pinecil V2
- `ts101` for the Miniware TS101 [^1] [^2]
- `s60` for the Squire S60 [^1]
- `s60` for the Sequre S60 [^1]
- `mhp30` for the Miniware MHP30
Different models are used for different flash locations for the image storage.

View File

@@ -149,7 +149,7 @@ test-md:
@echo ""
@echo "---- Checking documentation... ----"
@echo ""
@/bin/sh ./scripts/deploy.sh docs
@./scripts/deploy.sh docs
# shell style & linter check (github CI version of shellcheck is more recent than alpine one so the latter may not catch some policies)
test-sh:

View File

@@ -23,7 +23,7 @@ _This firmware does **NOT** support the USB port while running for changing sett
## Supported Hardware
| Device | DC | QC | PD | EPR | BLE | Tip Sense | Recommended Purchase | Notes |
| Device | DC | QC | PD | EPR\*\*\*\* | BLE | Tip Sense | Recommended Purchase | Notes |
| :------------: | :-: | :-: | :-: | :-: | :-: | :-------: | :------------------: | :-------------------------------------: |
| Miniware MHP30 | ❌ | ❌ | ✔️ | ❌ | ❌ | ✔️ | ✔️ | |
| Pinecil V1 | ✔️ | ✔️ | ✔️ | ❌ | ❌ | ❌ | ❌ \* | |
@@ -48,6 +48,9 @@ The _TS101_ & _S60(P)_ irons and _MHP30_ & _T55_ plates feature a higher resolut
\*\*\* _TS80_ is replaced by _TS80P_. Production ramped down a long time ago and it's just existing stock clearing the system. It's marked not recommended being optimistic that people might pause and buy the far superior _TS80P_ instead. This is the main reason why the _TS80_ is **_no longer recommended_**.
\*\*\*\* **EPR/PPS with 28V support** is _**disabled by default**_ due to [safety concerns](https://github.com/Ralim/IronOS/pull/2073), but to turn it back on set
_PD Mode_ option in _Power settings_ submenu to _Safe_ or _Default_.
## Getting Started
To get started with _IronOS firmware_, please jump to [Getting Started Guide](https://ralim.github.io/IronOS/GettingStarted/).
@@ -139,6 +142,22 @@ After powering on the device for the first time with _IronOS_ installed and havi
Additional details are described in the [menu information](https://ralim.github.io/IronOS/Menu/).
## Remote Control
### Pinecil V2 only
Pinecil V2 has [_Bluetooth Low Energy_ module](https://ralim.github.io/IronOS/Bluetooth), which is supported by _IronOS_ since `2.21` release to control some of the settings using additional tools like [PineSAM](https://github.com/builder555/PineSAM) or [PineTool](https://github.com/lachlanbell/PineTool). In `2.21` and `2.22` releases the module was _on_ by default. However, **_Bluetooth_ is turned off in the settings by default in current `dev` builds and for the next releases** [due to security concerns](#1856).[^ble]
To enable _Bluetooth_ back:
- go to _Settings_ menu;
- press `-/B` button four times to scroll the menu for `Advanced settings`;
- press `+/A` button to open submenu;
- press `+/A` button to toggle/enable _Bluetooth_ feature;
- press `-/B` **and hold it** for just more than five seconds to exit from the _Settings_ menu.
[^ble]:
This is related only to situations when a user restores default settings using menu, or when _IronOS_ update is taking place on a new device or on a device with a previous firmware version.
## Translations
Is your preferred language missing localisation of some of the text?
@@ -175,6 +194,6 @@ Other components such as _FreeRTOS_ and _USB-PD_ have their own licenses.
## Commercial Use
This software is provided "AS IS", so I cannot provide any commercial support for the firmware.
This software is provided _**"AS IS"**_, so I cannot provide any commercial support for the firmware.
However, you are more than welcome to distribute links to the firmware or provide hardware with this firmware.
**Please do not re-host the files, but rather link to this page, so that there are no old versions of the firmware scattered around**.

View File

@@ -152,7 +152,7 @@ def get_constants() -> List[Tuple[str, str]]:
def get_debug_menu() -> List[str]:
return [
datetime.today().strftime("%Y-%m-%d"),
datetime.today().strftime("%Y%m%d %H%M%S"),
"ID ",
"ACC ",
"PWR ",

View File

@@ -340,8 +340,8 @@
"description": ""
},
"SolderingTipType": {
"displayText": "Soldering\nTip Type",
"description": "Select the tip type fitted"
"displayText": "Löt-\nspitzentyp",
"description": "Wählen Sie den Typ der eingesetzten Spitze"
}
}
}

View File

@@ -152,11 +152,11 @@
"description": "Imposta il tempo di negoziazione del protocollo USB Power Delivery con alimentatori compatibili [0: disattiva; multipli di 100 ms]"
},
"USBPDMode": {
"displayText": "PD\nMode",
"displayText": "Modalità\nUSB PD",
"description": "Abilita le modalità Power Delivery PPS ed EPR"
},
"BoostTemperature": {
"displayText": "Temp\nTurbo",
"displayText": "Temp\nturbo",
"description": "Imposta la temperatura della funzione turbo [°C/°F]"
},
"AutoStart": {
@@ -252,7 +252,7 @@
"description": "Regola la sensibilità del sensore ad effetto Hall per entrare in modalità riposo [1: minima; 9: massima]"
},
"HallEffSleepTimeout": {
"displayText": "Timer\nriposoHall",
"displayText": "Timer\nHall",
"description": "Imposta un timer per entrare in modalità riposo quando il sensore ad effetto Hall è al di sopra della soglia di attivazione [secondi]"
},
"TemperatureUnit": {

View File

@@ -4,7 +4,7 @@
"tempUnitFahrenheit": false,
"messagesWarn": {
"CalibrationDone": {
"message": "Kalibracja\nwykonana!"
"message": "Skalibrowano!"
},
"ResetOKMessage": {
"message": "Reset OK"
@@ -19,7 +19,7 @@
"message": "Nie rozpoznano\nkont. USB-PD IC!"
},
"LockingKeysString": {
"message": " ZABLOK."
"message": "ZABLOK."
},
"UnlockingKeysString": {
"message": "ODBLOK."
@@ -31,7 +31,7 @@
"message": "Ucieczka\ntermiczna"
},
"WarningTipShorted": {
"message": "!Tip Shorted!"
"message": "!Zwarty grot!"
},
"SettingsCalibrationWarning": {
"message": "Upewnij się, że końcówka i uchwyt mają temperaturę pokojową podczas następnego rozruchu!"
@@ -58,16 +58,16 @@
"message": "Grot: \n"
},
"ProfilePreheatString": {
"message": "Preheat\n"
"message": "Rozgrzewanie\n"
},
"ProfileCooldownString": {
"message": "Cooldown\n"
"message": "Schładzanie\n"
},
"DeviceFailedValidationWarning": {
"message": "Twoje urządzenie jest najprawdopodobniej podróbką!"
},
"TooHotToStartProfileWarning": {
"message": "Too hot to\nstart profile"
"message": "Zbyt gorące, aby\nuruchomić profil"
}
},
"characters": {
@@ -107,22 +107,22 @@
},
"menuValues": {
"USBPDModeDefault": {
"displayText": "Default\nMode"
"displayText": "Tryb\ndomyślny"
},
"USBPDModeNoDynamic": {
"displayText": "No\nDynamic"
"displayText": "Nie\ndynamiczny"
},
"USBPDModeSafe": {
"displayText": "Safe\nMode"
"displayText": "Tryb\nbezpieczny"
},
"TipTypeAuto": {
"displayText": "Auto\nSense"
"displayText": "Auto\nwykrycie"
},
"TipTypeT12Long": {
"displayText": "TS100\nLong"
"displayText": "Długi\nTS100"
},
"TipTypeT12Short": {
"displayText": "Pine\nShort"
"displayText": "Krótki\nPine"
},
"TipTypeT12PTS": {
"displayText": "PTS\n200"
@@ -137,27 +137,27 @@
"menuOptions": {
"DCInCutoff": {
"displayText": "Źródło\nzasilania",
"description": "Źródło zasilania. Ustaw napięcie odcięcia. (DC 10V) (S 3.3V dla ogniw Li, wyłącz limit mocy)"
"description": "Źródło zasilania. Ustaw napięcie odcięcia. (DC 10V) (S=3.3V dla ogniw Li, wyłącz limit mocy)"
},
"MinVolCell": {
"displayText": "Minimalne\nnapięcie",
"description": "Minimalne dozwolone napięcie na komórkę (3S: 3 - 3,7V | 4-6S: 2,4 - 3,7V)"
},
"QCMaxVoltage": {
"displayText": "QC\nnapięcie",
"displayText": "Napięcie QC",
"description": "Maksymalne napięcie, które lutownica będzie próbowała wynegocjować z ładowarką Quick Charge (V)"
},
"PDNegTimeout": {
"displayText": "Limit czasu\nPD",
"description": "Limit czasu negocjacji PD w krokach co 100 ms dla zgodności z niektórymi ładowarkami QC (0: wyłączone)"
"description": "Limit czasu negocjacji PD w krokach co 100ms dla zgodności z niektórymi ładowarkami QC (0: wyłączone)"
},
"USBPDMode": {
"displayText": "PD\nMode",
"displayText": "Tryb PD",
"description": "Włącza tryby PPS & EPR."
},
"BoostTemperature": {
"displayText": "Temp.\nboost",
"description": "Temperatura w trybie \"boost\" "
"description": "Temp. w trybie \"boost\" "
},
"AutoStart": {
"displayText": "Aut. uruch.\ntr. lutowania",
@@ -176,60 +176,60 @@
"description": "W trybie lutowania, wciśnij oba przyciski aby je zablokować (B=tylko Boost | P=pełna blokada)"
},
"ProfilePhases": {
"displayText": "Profile\nPhases",
"description": "Number of phases in profile mode"
"displayText": "Fazy\nprofilu",
"description": "Liczba faz w trybie profilu"
},
"ProfilePreheatTemp": {
"displayText": "Preheat\nTemp",
"description": "Preheat to this temperature at the start of profile mode"
"displayText": "Temp.\nrozgrzewania",
"description": "Rozgrzanie do tej temp. na początku trybu profilu"
},
"ProfilePreheatSpeed": {
"displayText": "Preheat\nSpeed",
"description": "Preheat at this rate (degrees per second)"
"displayText": "Prędk.\nrozgrzewania",
"description": "Tempo rozgrzewania (stopnie na sekundę)"
},
"ProfilePhase1Temp": {
"displayText": "Phase 1\nTemp",
"description": "Target temperature for the end of this phase"
"displayText": "Temp.\nfazy 1",
"description": "Docelowa temp. na koniec tej fazy"
},
"ProfilePhase1Duration": {
"displayText": "Phase 1\nDuration",
"description": "Target duration of this phase (seconds)"
"displayText": "Dług.\nfazy 1",
"description": "Docelowy czas trwania tej fazy (sekundy)"
},
"ProfilePhase2Temp": {
"displayText": "Phase 2\nTemp",
"displayText": "Temp.\nfazy 2",
"description": ""
},
"ProfilePhase2Duration": {
"displayText": "Phase 2\nDuration",
"displayText": "Dług.\nfazy 2",
"description": ""
},
"ProfilePhase3Temp": {
"displayText": "Phase 3\nTemp",
"displayText": "Temp.\nfazy 3",
"description": ""
},
"ProfilePhase3Duration": {
"displayText": "Phase 3\nDuration",
"displayText": "Dług.\nfazy 3",
"description": ""
},
"ProfilePhase4Temp": {
"displayText": "Phase 4\nTemp",
"displayText": "Temp.\nfazy 4",
"description": ""
},
"ProfilePhase4Duration": {
"displayText": "Phase 4\nDuration",
"displayText": "Dług.\nfazy 4",
"description": ""
},
"ProfilePhase5Temp": {
"displayText": "Phase 5\nTemp",
"displayText": "Temp.\nfazy 5",
"description": ""
},
"ProfilePhase5Duration": {
"displayText": "Phase 5\nDuration",
"displayText": "Dług.\nfazy 5",
"description": ""
},
"ProfileCooldownSpeed": {
"displayText": "Cooldown\nSpeed",
"description": "Cooldown at this rate at the end of profile mode (degrees per second)"
"displayText": "Prędk.\nschładzania",
"description": "Tempo schładzania na koniec trybu profilu (stopnie na sekundę)"
},
"MotionSensitivity": {
"displayText": "Czułość\nwykr. ruchu",
@@ -264,8 +264,8 @@
"description": "Obrót ekranu (P: dla praworęcznych | L: dla leworęcznych | A: automatycznie)"
},
"CooldownBlink": {
"displayText": "Mig. podczas\nwychładzania",
"description": "Temperatura miga podczas wychładzania, gdy grot jest wciąż gorący"
"displayText": "Mig. podczas\nschładzania",
"description": "Temperatura miga podczas schładzania, gdy grot jest wciąż gorący"
},
"ScrollingSpeed": {
"displayText": "Sz. przew.\ntekstu",
@@ -296,7 +296,7 @@
"description": "Ustawia czas wyświetlania loga podczas uruchamiania (s=sekund)"
},
"AdvancedIdle": {
"displayText": "Szeczegółowy\nekran bezczy.",
"displayText": "Szczegółowy\nekran bezczyn.",
"description": "Wyświetla szczegółowe informacje za pomocą mniejszej czcionki na ekranie bezczynności"
},
"AdvancedSoldering": {
@@ -305,7 +305,7 @@
},
"BluetoothLE": {
"displayText": "Bluetooth\n",
"description": "Enables BLE"
"description": "Włącza Bluetooth Low Energy"
},
"PowerLimit": {
"displayText": "Ogr.\nmocy",
@@ -340,8 +340,8 @@
"description": ""
},
"SolderingTipType": {
"displayText": "Soldering\nTip Type",
"description": "Select the tip type fitted"
"displayText": "Typ grotu",
"description": "Wybierz typ zamontowanego grotu"
}
}
}

View File

@@ -52,7 +52,7 @@
"message": "Жив.(B): \n"
},
"SleepingAdvancedString": {
"message": "Очікування...\n"
"message": "Сон...\n"
},
"SleepingTipAdvancedString": {
"message": "Жало: \n"
@@ -78,7 +78,7 @@
"SettingMediumChar": "С",
"SettingFastChar": "М",
"SettingStartSolderingChar": "П",
"SettingStartSleepChar": "О",
"SettingStartSleepChar": "С",
"SettingStartSleepOffChar": "К",
"SettingLockBoostChar": "Т",
"SettingLockFullChar": "П"
@@ -93,7 +93,7 @@
"description": ""
},
"PowerSavingMenu": {
"displayText": "Режим\nсну",
"displayText": "Режим сну\n",
"description": ""
},
"UIMenu": {
@@ -116,13 +116,13 @@
"displayText": "Безпечний\nРежим"
},
"TipTypeAuto": {
"displayText": "Auto\nSense"
"displayText": "Авто\nВизначення"
},
"TipTypeT12Long": {
"displayText": "TS100\nLong"
"displayText": "TS100\nДовге"
},
"TipTypeT12Short": {
"displayText": "Pine\nShort"
"displayText": "Pine\nКоротке"
},
"TipTypeT12PTS": {
"displayText": "PTS\n200"
@@ -145,31 +145,31 @@
},
"QCMaxVoltage": {
"displayText": "Потужність\nдж. живлення",
"description": "Потужність джерела живлення в Ватах"
"description": "Потужність ДЖ в Ватах"
},
"PDNegTimeout": {
"displayText": "PD\nзатримка",
"description": "Затримка у 100мс інкрементах для PD для сумісності з деякими QC зарядними пристроями (0: вимкнено)"
"displayText": "PD\nЗатримка",
"description": "Затримка у 100мс інкрементах для PD для сумісності з деякими версіями QC (0: вимкнена)"
},
"USBPDMode": {
"displayText": "PD\nMode",
"displayText": "PD\nРежим",
"description": "Вмикає режими PPS & EPR."
},
"BoostTemperature": {
"displayText": "Темпер.\nТурбо",
"description": "Температура в \"Турбо\" режимі"
"description": "Температура \"Турбо\" режиму"
},
"AutoStart": {
"displayText": "Гарячий\nстарт",
"description": "Режим в якому запускається паяльник при ввімкненні (П=Пайка | О=Очікування | К=Очікування при кімн. темп.)"
"description": "Режим запуску паяльника (П=Пайка | С=Сон | К=Сон при кімн. темп.)"
},
"TempChangeShortStep": {
"displayText": "Зміна темп.\nкоротко?",
"description": "Змінювати температуру при короткому натисканні!"
"displayText": "Зміна темп.\nкоротким",
"description": "Зміна температуру при короткому натисканні!"
},
"TempChangeLongStep": {
"displayText": "Зміна темп.\nдовго?",
"description": "Змінювати температуру при довгому натисканні!"
"displayText": "Зміна темп.\nдовгим",
"description": "Зміна температуру при довгому натисканні!"
},
"LockingMode": {
"displayText": "Дозволити\nблок. кнопок",
@@ -185,15 +185,15 @@
},
"ProfilePreheatSpeed": {
"displayText": "Швидкість\nПоп.Розігріву",
"description": "Розігрівати з такою швидкістю (градусів в секунду)"
"description": "Розігрівати з швидкістю (у сек)"
},
"ProfilePhase1Temp": {
"displayText": "Етап 1\nТемпература",
"description": "Температура в кінці цього етапу"
"description": "Температура на кінці цього етапу"
},
"ProfilePhase1Duration": {
"displayText": "Етап 1\nТривалість",
"description": "Тривалість цього етапу (секунд)"
"description": "Тривалість цього етапу (сек)"
},
"ProfilePhase2Temp": {
"displayText": "Етап 2\nТемпература",
@@ -229,43 +229,43 @@
},
"ProfileCooldownSpeed": {
"displayText": "Швидкість\nОхолодження",
"description": "Швидкість охолодження в кінці режиму профілів (градусів в секунду)"
"description": "Швидкість охолодження на кінці режиму профілів (у сек)"
},
"MotionSensitivity": {
"displayText": "Чутливість\nсенсору руху",
"description": "Акселерометр (1=мін. чутливості | ... | 9=макс. чутливості)"
"displayText": "Чутливість\nдатчику руху",
"description": "Акселерометр (1=мін. чутливості | ... | 9=макс. чутливість)"
},
"SleepTemperature": {
"displayText": "Темпер.\nсну",
"description": "Температура режиму очікування (C° | F°)"
"description": "Температура режиму сну (C° | F°)"
},
"SleepTimeout": {
"displayText": "Тайм-аут\nсну",
"description": "Час до переходу в режим очікування (Хвилини | Секунди)"
"description": "Час до переходу до сну (Хв | Сек)"
},
"ShutdownTimeout": {
"displayText": "Часу до\nвимкнення",
"description": "Час до вимкнення (Хвилини)"
"description": "Час до вимкнення (Хв)"
},
"HallEffSensitivity": {
"displayText": "Чутливість\nЕфекту Холла",
"description": "Чутливість датчика ефекту Холла при виявленні сну (1=мін. чутливості | ... | 9=макс. чутливості)"
"displayText": "Чутливість\nДатчику Холла",
"description": "Чутливість датчика Холла при виявленні сну (1=мін. чутливість | ... | 9=макс. чутливість)"
},
"HallEffSleepTimeout": {
"displayText": "Сенсор Холла\nЧас очікування",
"description": "Проміжок часу до \"часу очікування\" за умови спрацювання датчику ефекту Холла"
"displayText": "Датчик Холла\nЧас сну",
"description": "Проміжок часу до \"часу сну\" за умови спрацювання датчику Холла"
},
"TemperatureUnit": {
"displayText": "Формат темпе-\nратури(C°/F°)",
"description": "Одиниця виміру температури (C=Цельсій | F=Фаренгейт)"
},
"DisplayRotation": {
"displayText": "Автоповорот\nекрану",
"description": "Орієнтація дисплея (П=Правша | Л=Лівша | A=Автоповорот)"
"displayText": "Обертання\nекрану",
"description": "Орієнтація екрану (П=Правша | Л=Лівша | A=Автооберт.)"
},
"CooldownBlink": {
"displayText": "Показ t° при\nохолодженні",
"description": "Показувати температуру на екрані охолодження, поки жало залишається гарячим, при цьому екран моргає"
"description": "Показувати температуру на екрані охолодження, поки жало залишається гарячим, при цьому екран мерехтить"
},
"ScrollingSpeed": {
"displayText": "Швидкість\nтексту",
@@ -277,11 +277,11 @@
},
"AnimSpeed": {
"displayText": "Швидкість\nанімації",
"description": "Швидкість анімації іконок у головному меню (Н=Низькa | С=Середня | М=Максимальна)"
"description": "Швидкість анімації іконок у меню (Н=Низькa | С=Середня | М=Максимальна)"
},
"AnimLoop": {
"displayText": "Циклічна\nанімація",
"description": "Циклічна анімація іконок в головному меню"
"description": "Циклічна анімація іконок у меню"
},
"Brightness": {
"displayText": "Яскравість\nекрану",
@@ -292,8 +292,8 @@
"description": "Інвертувати кольори на OLED екрані"
},
"LOGOTime": {
"displayText": "Тривалість\nлоготипу завантаження",
"description": "Встановити тривалість показу лого при завантаженні (с=секунд)"
"displayText": "Тривалість\nлоготипу при запуску",
"description": "Поточна тривалість показу лого при запуску (сек)"
},
"AdvancedIdle": {
"displayText": "Детальний ре-\nжим очікуван.",
@@ -309,11 +309,11 @@
},
"PowerLimit": {
"displayText": "Макс.\nпотуж.",
"description": "Макс. потужність, яку може використовувати паяльник (Ват)"
"description": "Макс. потужність, яку може використовувати паяльник (Ватт)"
},
"CalibrateCJC": {
"displayText": "Калібрувати КХС\nпри наступному завантаженні",
"description": "При наступному завантаження буде відкалібровано Компенсацію Холодного Спаю жала (непотрібне при різниці температур < 5°C)"
"displayText": "Калібрувати КХС\nпри наступному запуску",
"description": "При наступному запуску буде відкалібровано Компенсацію Холодного Спаю жала (непотрібне при різниці температур < 5°C)"
},
"VoltageCalibration": {
"displayText": "Калібрування\nнапруги",
@@ -340,8 +340,8 @@
"description": ""
},
"SolderingTipType": {
"displayText": "Soldering\nTip Type",
"description": "Select the tip type fitted"
"displayText": "Тип Жала",
"description": "Оберіть відповідний тип жала"
}
}
}

View File

@@ -137,7 +137,7 @@
"menuOptions": {
"DCInCutoff": {
"displayText": "Quvvat\nmanbai",
"description": "Batareya haddan tashqari zaryadsizlanishini oldini olish uchun kuchlanish chegarasini o'rnatish (DC 10V) (S=3.3V har bir yacheyka uchun, quvvat PWR chegarasini o'chirish)"
"description": "Batareya haddan tashqari zaryadsizlanishini oldini olish uchun kuchlanish chegarasini o'rnatish (DC 10V) (S=3.3V har bir yacheyka uchun, quvvat PWR chegarasini o'chirish)"
},
"MinVolCell": {
"displayText": "Minimal\nkuchlanish",

View File

@@ -95,9 +95,10 @@ docs_links()
{
ver_git="$(git tag -l | sort | grep -e "^v" | grep -v "rc" | tail -1)"
md="README.md"
test -f "${md}" || (echo "deploy.sh: docs_links: ERROR with the project directory structure!" && exit 1)
ver_md="$(grep -c "${ver_git}" "${md}")"
ret=0
if [ "${ver_md}" -ne 0 ]; then
if [ "${ver_md}" -eq 0 ]; then
ret=1
echo "Please, update mention & links in ${md} inside Builds section for release builds with version ${ver_git}."
fi;
@@ -108,16 +109,38 @@ docs_links()
build_langs()
{
mk="../source/Makefile"
cd Translations/ || exit 1
cd Translations/ || (echo "deploy.sh: build_langs: ERROR with the project directory structure!" && exit 1)
langs="$(echo "$(find ./*.json | sed -ne 's,^\./translation_,,; s,\.json$,,; /[A-Z]/p' ; sed -ne 's/^ALL_LANGUAGES=//p;' "${mk}")" | sed 's, ,\n,g; s,\r,,g' | sort | uniq -u)"
ret=0
if [ -n "${langs}" ]; then
ret=1
echo "It seems there is mismatch between supported languages and enabled builds."
echo "Please, check files in Translations/ and ALL_LANGUAGES variable in source/Makefile for:"
echo "${langs}"
return 1
fi;
return "${ret}"
cd ..
echo -ne "\n"
grep -nH $'\11' Translations/translation*.json
ret="${?}"
if [ "${ret}" -eq 0 ]; then
echo -ne "\t^^^^\t^^^^\n"
echo "Please, remove any tabs as indention from json file(s) in Translations/ directory (see the exact files & lines in the list above)."
echo "Use spaces only to indent in the future, please."
echo -ne "\n"
return 1
fi;
grep -nEH -e "^( {1}| {3}| {5}| {7}| {9}| {11})[^ ]" Translations/translation*.json
ret="${?}"
if [ "${ret}" -eq 0 ]; then
echo -ne "\t^^^^\t^^^^\n"
echo "Please, remove any odd amount of extra spaces as indention from json file(s) in Translations/ directory (see the exact files & lines in the list above)."
echo "Use even amount of spaces to indent in the future, please (two actual spaces per one indent, not tab)."
echo -ne "\n"
return 1
fi;
return 0
}
# Helper function to check code style using clang-format & grep/sed custom parsers:

View File

@@ -6,7 +6,7 @@
#include "Pins.h"
#include "Setup.h"
#include "TipThermoModel.h"
#include "Utils.h"
#include "Utils.hpp"
#include "WS2812.h"
#include "configuration.h"
#include "history.hpp"

View File

@@ -7,7 +7,7 @@
#include "Setup.h"
#include "TipThermoModel.h"
#include "Types.h"
#include "Utils.h"
#include "Utils.hpp"
#include "configuration.h"
extern uint16_t tipSenseResistancex10Ohms;

View File

@@ -5,7 +5,7 @@
* Author: Ralim
*/
#include "TipThermoModel.h"
#include "Utils.h"
#include "Utils.hpp"
#include "configuration.h"
#ifdef TEMP_uV_LOOKUP_HAKKO

View File

@@ -218,6 +218,7 @@
#define TEMP_NTC 1
#define ACCEL_I2CBB1 1
#define POW_EPR 1
#define TIP_TYPE_SUPPORT 1 // Support for tips of different types, i.e. resistance
#define AUTO_TIP_SELECTION 1 // Can auto-select the tip
#define TIPTYPE_T12 1 // Can manually pick a T12 tip
#define HAS_POWER_DEBUG_MENU

View File

@@ -5,7 +5,7 @@
* Author: Ralim
*/
#include "TipThermoModel.h"
#include "Utils.h"
#include "Utils.hpp"
#include "configuration.h"
#ifdef TEMP_uV_LOOKUP_HAKKO

View File

@@ -9,7 +9,7 @@
#include "Setup.h"
#include "TipThermoModel.h"
#include "USBPD.h"
#include "Utils.h"
#include "Utils.hpp"
#include "bl702_adc.h"
#include "configuration.h"
#include "crc32.h"
@@ -277,7 +277,7 @@ uint8_t getDeviceValidationStatus() {
}
void showBootLogo(void) {
uint8_t scratch[1024];
alignas(uint32_t) uint8_t scratch[1024];
flash_read(FLASH_LOGOADDR - 0x23000000, scratch, 1024);
BootLogo::handleShowingLogo(scratch);

View File

@@ -7,17 +7,125 @@
#include "BSP.h"
#include "IRQ.h"
#include "Setup.h"
#include "bl_mcu_sdk/drivers/bl702_driver/std_drv/inc/bl702_dma.h"
extern "C" {
#include "bflb_platform.h"
#include "bl702_dma.h"
#include "bl702_glb.h"
#include "bl702_i2c.h"
}
#include <I2C_Wrapper.hpp>
// Semaphore for locking users of I2C
SemaphoreHandle_t FRToSI2C::I2CSemaphore = nullptr;
StaticSemaphore_t FRToSI2C::xSemaphoreBuffer;
#define I2C_TIME_OUT (uint16_t)(12000)
void FRToSI2C::CpltCallback() {} // Not used
#define I2C_TIME_OUT (uint16_t)(12000)
#define I2C_TX_FIFO_ADDR (0x4000A300 + 0x88)
#define I2C_RX_FIFO_ADDR (0x4000A300 + 0x8C)
// Used by the irq handler
volatile uint8_t *IRQDataPointer;
volatile uint8_t IRQDataSizeLeft;
volatile bool IRQFailureMarker;
volatile TaskHandle_t IRQTaskWaitingHandle = NULL;
/****** IRQ Handlers ******/
void i2c_irq_tx_fifo_low() {
// Filling tx fifo
// Fifo is 32 bit, LSB sent first
// FiFo can store up to 2, 32-bit words
// So we fill it until it has no free room (or we run out of data)
while (IRQDataSizeLeft > 0 && I2C_GetTXFIFOAvailable() > 0) {
// Can put in at least 1 byte
// Build a 32-bit word from bytes
uint32_t value = 0;
int packing = IRQDataSizeLeft >= 4 ? 0 : 4 - IRQDataSizeLeft;
for (int i = 0; i < 4 && IRQDataSizeLeft > 0; i++) {
value >>= 8;
value |= (*IRQDataPointer) << 24; // Shift to the left, adding new data to the higher byte
IRQDataPointer++; // Shift to next byte
IRQDataSizeLeft--;
}
// Handle shunting remaining bytes if not a full 4 to send
for (int i = 0; i < packing; i++) {
value >>= 8;
}
// Push the new value to the fifo
*((volatile uint32_t *)I2C_TX_FIFO_ADDR) = value;
}
if (IRQDataSizeLeft == 0) {
// Disable IRQ, were done
I2C_IntMask(I2C0_ID, I2C_TX_FIFO_READY_INT, MASK);
}
}
void i2c_rx_pop_fifo() {
// Pop one word from the fifo and store it
uint32_t value = *((uint32_t *)I2C_RX_FIFO_ADDR);
for (int i = 0; i < 4 && IRQDataSizeLeft > 0; i++) {
*IRQDataPointer = value & 0xFF;
IRQDataPointer++;
IRQDataSizeLeft--;
value >>= 8;
}
}
void i2c_irq_rx_fifo_ready() {
// Draining the Rx FiFo
while (I2C_GetRXFIFOAvailable() > 0) {
i2c_rx_pop_fifo();
}
if (IRQDataSizeLeft == 0) {
// Disable IRQ, were done
I2C_IntMask(I2C0_ID, I2C_RX_FIFO_READY_INT, MASK);
}
}
void i2c_irq_done_read() {
IRQFailureMarker = false;
// If there was a non multiple of 4 bytes to be read, they are pushed to the fifo now (end of transfer interrupt)
// So we catch them here
while (I2C_GetRXFIFOAvailable() > 0) {
i2c_rx_pop_fifo();
}
// Mask IRQ's back off
FRToSI2C::CpltCallback(); // Causes the lock to be released
}
void i2c_irq_done() {
IRQFailureMarker = false;
// Mask IRQ's back off
FRToSI2C::CpltCallback(); // Causes the lock to be released
}
void i2c_irq_nack() {
IRQFailureMarker = true;
// Mask IRQ's back off
FRToSI2C::CpltCallback(); // Causes the lock to be released
}
/****** END IRQ Handlers ******/
void FRToSI2C::CpltCallback() {
// This is only triggered from IRQ context
I2C_IntMask(I2C0_ID, I2C_TX_FIFO_READY_INT, MASK);
I2C_IntMask(I2C0_ID, I2C_RX_FIFO_READY_INT, MASK);
I2C_IntMask(I2C0_ID, I2C_TRANS_END_INT, MASK);
I2C_IntMask(I2C0_ID, I2C_NACK_RECV_INT, MASK);
CPU_Interrupt_Disable(I2C_IRQn); // Disable IRQ's
I2C_Disable(I2C0_ID); // Disable I2C to tidy up
// Unlock the semaphore && allow task switch if desired by RTOS
BaseType_t xHigherPriorityTaskWoken = pdFALSE;
xSemaphoreGiveFromISR(I2CSemaphore, &xHigherPriorityTaskWoken);
xTaskNotifyFromISR(IRQTaskWaitingHandle, IRQFailureMarker ? 2 : 1, eSetValueWithOverwrite, &xHigherPriorityTaskWoken);
portYIELD_FROM_ISR(xHigherPriorityTaskWoken);
}
bool FRToSI2C::I2C_RegisterWrite(uint8_t address, uint8_t reg, uint8_t data) { return Mem_Write(address, reg, &data, 1); }
@@ -40,22 +148,37 @@ bool FRToSI2C::Mem_Read(uint16_t DevAddress, uint16_t read_address, uint8_t *p_b
i2cCfg.data = p_buffer;
i2cCfg.subAddrSize = 1; // one byte address
taskENTER_CRITICAL();
/* --------------- */
err = I2C_MasterReceiveBlocking(I2C0_ID, &i2cCfg);
taskEXIT_CRITICAL();
bool res = err == SUCCESS;
if (!res) {
I2C_Unstick();
}
unlock();
return res;
// Store handles for IRQ
IRQDataPointer = p_buffer;
IRQDataSizeLeft = number_of_byte;
IRQTaskWaitingHandle = xTaskGetCurrentTaskHandle();
IRQFailureMarker = false;
I2C_Disable(I2C0_ID);
// Setup and run
I2C_Init(I2C0_ID, I2C_READ, &i2cCfg); // Setup hardware for the I2C init header with the device address
I2C_IntMask(I2C0_ID, I2C_TRANS_END_INT, UNMASK);
I2C_IntMask(I2C0_ID, I2C_NACK_RECV_INT, UNMASK);
I2C_IntMask(I2C0_ID, I2C_RX_FIFO_READY_INT, UNMASK);
I2C_Int_Callback_Install(I2C0_ID, I2C_TRANS_END_INT, i2c_irq_done_read);
I2C_Int_Callback_Install(I2C0_ID, I2C_NACK_RECV_INT, i2c_irq_nack);
I2C_Int_Callback_Install(I2C0_ID, I2C_RX_FIFO_READY_INT, i2c_irq_rx_fifo_ready);
CPU_Interrupt_Enable(I2C_IRQn);
// Start
I2C_Enable(I2C0_ID);
// Wait for transfer in background
uint32_t result = 0;
xTaskNotifyWait(0xFFFFFFFF, 0xFFFFFFFF, &result, TICKS_100MS);
return result == 1;
}
bool FRToSI2C::Mem_Write(uint16_t DevAddress, uint16_t MemAddress, uint8_t *p_buffer, uint16_t number_of_byte) {
if (!lock()) {
return false;
}
I2C_Transfer_Cfg i2cCfg = {0, DISABLE, 0, 0, 0, 0};
BL_Err_Type err = ERROR;
i2cCfg.slaveAddr = DevAddress >> 1;
@@ -65,16 +188,31 @@ bool FRToSI2C::Mem_Write(uint16_t DevAddress, uint16_t MemAddress, uint8_t *p_bu
i2cCfg.data = p_buffer;
i2cCfg.subAddrSize = 1; // one byte address
taskENTER_CRITICAL();
/* --------------- */
err = I2C_MasterSendBlocking(I2C0_ID, &i2cCfg);
taskEXIT_CRITICAL();
bool res = err == SUCCESS;
if (!res) {
I2C_Unstick();
}
unlock();
return res;
// Store handles for IRQ
IRQDataPointer = p_buffer;
IRQDataSizeLeft = number_of_byte;
IRQTaskWaitingHandle = xTaskGetCurrentTaskHandle();
IRQFailureMarker = false;
// Setup and run
I2C_Init(I2C0_ID, I2C_WRITE, &i2cCfg); // Setup hardware for the I2C init header with the device address
I2C_IntMask(I2C0_ID, I2C_TRANS_END_INT, UNMASK);
I2C_IntMask(I2C0_ID, I2C_NACK_RECV_INT, UNMASK);
I2C_IntMask(I2C0_ID, I2C_TX_FIFO_READY_INT, UNMASK);
I2C_Int_Callback_Install(I2C0_ID, I2C_TRANS_END_INT, i2c_irq_done);
I2C_Int_Callback_Install(I2C0_ID, I2C_NACK_RECV_INT, i2c_irq_nack);
I2C_Int_Callback_Install(I2C0_ID, I2C_TX_FIFO_READY_INT, i2c_irq_tx_fifo_low);
CPU_Interrupt_Enable(I2C_IRQn);
i2c_irq_tx_fifo_low();
// Start
I2C_Enable(I2C0_ID);
// Wait for transfer in background
uint32_t result = 0;
xTaskNotifyWait(0xFFFFFFFF, 0xFFFFFFFF, &result, TICKS_100MS);
return result == 1;
}
bool FRToSI2C::Transmit(uint16_t DevAddress, uint8_t *pData, uint16_t Size) { return Mem_Write(DevAddress, pData[0], pData + 1, Size - 1); }

View File

@@ -10,6 +10,7 @@
#include "FreeRTOSConfig.h"
#include "IRQ.h"
#include "Pins.h"
#include "bl702_dma.h"
#include "bl702_sec_eng.h"
#include "history.hpp"
#include <string.h>
@@ -66,7 +67,9 @@ void hardware_init() {
I2C_SetDeglitchCount(I2C0_ID, 1); // Turn on de-glitch
// Note on I2C clock rate @ 100Khz the screen update == 20ms which is too long for USB-PD to work
// 200kHz and above works
I2C_ClockSet(I2C0_ID, 300000); // Sets clock to around 25 kHz less than set here
TIMER_SetCompValue(TIMER_CH0, TIMER_COMP_ID_0, 0);
}
void setup_pwm(void) {

View File

@@ -5,7 +5,7 @@
* Author: Ralim
*/
#include "TipThermoModel.h"
#include "Utils.h"
#include "Utils.hpp"
#include "configuration.h"
#ifdef TEMP_uV_LOOKUP_HAKKO

View File

@@ -10,7 +10,7 @@
#include <stdint.h>
#include <stdbool.h>
#include <string.h>
#include "types.h"
#include <zephyr/types.h>
#include "bl_port.h"
#define BT_UINT_MAX 0xffffffff

View File

@@ -92,8 +92,8 @@ int dma_open(struct device *dev, uint16_t oflag) {
chCfg.dstPeriph = dma_device->dst_req;
chCfg.srcAddrInc = dma_device->src_addr_inc;
chCfg.destAddrInc = dma_device->dst_addr_inc;
chCfg.srcBurstSzie = dma_device->src_burst_size;
chCfg.dstBurstSzie = dma_device->dst_burst_size;
chCfg.srcBurstSize = dma_device->src_burst_size;
chCfg.dstBurstSize = dma_device->dst_burst_size;
chCfg.srcTransfWidth = dma_device->src_width;
chCfg.dstTransfWidth = dma_device->dst_width;
DMA_Channel_Init(&chCfg);

View File

@@ -39,6 +39,10 @@
#include "dma_reg.h"
#include "bl702_common.h"
#ifdef __cplusplus
extern "C" {
#endif
/** @addtogroup BL702_Peripheral_Driver
* @{
*/
@@ -168,9 +172,9 @@ typedef struct
DMA_Chan_Type ch; /*!< Channel select 0-7 */
DMA_Trans_Width_Type srcTransfWidth; /*!< Transfer width. 0: 8 bits, 1: 16 bits, 2: 32 bits */
DMA_Trans_Width_Type dstTransfWidth; /*!< Transfer width. 0: 8 bits, 1: 16 bits, 2: 32 bits */
DMA_Burst_Size_Type srcBurstSzie; /*!< Number of data items for burst transaction length. Each item width is as same as tansfer width.
DMA_Burst_Size_Type srcBurstSize; /*!< Number of data items for burst transaction length. Each item width is as same as tansfer width.
0: 1 item, 1: 4 items, 2: 8 items, 3: 16 items */
DMA_Burst_Size_Type dstBurstSzie; /*!< Number of data items for burst transaction length. Each item width is as same as tansfer width.
DMA_Burst_Size_Type dstBurstSize; /*!< Number of data items for burst transaction length. Each item width is as same as tansfer width.
0: 1 item, 1: 4 items, 2: 8 items, 3: 16 items */
BL_Fun_Type dstAddMode; /*!< */
BL_Fun_Type dstMinMode; /*!< */
@@ -181,16 +185,6 @@ typedef struct
DMA_Periph_Req_Type dstPeriph; /*!< Destination peripheral select */
} DMA_Channel_Cfg_Type;
/**
* @brief DMA LLI control structure type definition
*/
typedef struct
{
uint32_t srcDmaAddr; /*!< Source address of DMA transfer */
uint32_t destDmaAddr; /*!< Destination address of DMA transfer */
uint32_t nextLLI; /*!< Next LLI address */
struct DMA_Control_Reg dmaCtrl; /*!< DMA transaction control */
} DMA_LLI_Ctrl_Type;
/**
* @brief DMA LLI configuration structure type definition
@@ -202,31 +196,6 @@ typedef struct
DMA_Periph_Req_Type dstPeriph; /*!< Destination peripheral select */
} DMA_LLI_Cfg_Type;
/**
* @brief DMA LLI Ping-Pong Buf definition
*/
typedef struct
{
uint8_t idleIndex; /*!< Index Idle lliListHeader */
uint8_t dmaChan; /*!< DMA LLI Channel used */
DMA_LLI_Ctrl_Type *lliListHeader[2]; /*!< Ping-Pong BUf List Header */
void (*onTransCompleted)(DMA_LLI_Ctrl_Type *); /*!< Completed Transmit One List Callback Function */
} DMA_LLI_PP_Buf;
/**
* @brief DMA LLI Ping-Pong Structure definition
*/
typedef struct
{
uint8_t trans_index; /*!< Ping or Pong Trigger TC */
uint8_t dmaChan; /*!< DMA LLI Channel used */
struct DMA_Control_Reg dmaCtrlRegVal; /*!< DMA Basic Pararmeter */
DMA_LLI_Cfg_Type *DMA_LLI_Cfg; /*!< LLI Config parameter */
uint32_t operatePeriphAddr; /*!< Operate Peripheral register address */
uint32_t chache_buf_addr[2]; /*!< Ping-Pong structure chache */
BL_Fun_Type is_single_mode; /*!< is Ping-pong running forever or single mode ,if is single mode ping-pong will run only once
after one start */
} DMA_LLI_PP_Struct;
/*@} end of group DMA_Public_Types */
@@ -346,16 +315,7 @@ void DMA_Channel_Disable(uint8_t ch);
void DMA_LLI_Init(uint8_t ch, DMA_LLI_Cfg_Type *lliCfg);
void DMA_LLI_Update(uint8_t ch, uint32_t LLI);
void DMA_IntMask(uint8_t ch, DMA_INT_Type intType, BL_Mask_Type intMask);
void DMA_LLI_PpBuf_Start_New_Transmit(DMA_LLI_PP_Buf *dmaPpBuf);
DMA_LLI_Ctrl_Type *DMA_LLI_PpBuf_Remove_Completed_List(DMA_LLI_PP_Buf *dmaPpBuf);
void DMA_LLI_PpBuf_Append(DMA_LLI_PP_Buf *dmaPpBuf, DMA_LLI_Ctrl_Type *dmaLliList);
void DMA_LLI_PpBuf_Destroy(DMA_LLI_PP_Buf *dmaPpBuf);
void DMA_Int_Callback_Install(DMA_Chan_Type dmaChan, DMA_INT_Type intType, intCallback_Type *cbFun);
void DMA_LLI_PpStruct_Start(DMA_LLI_PP_Struct *dmaPpStruct);
void DMA_LLI_PpStruct_Stop(DMA_LLI_PP_Struct *dmaPpStruct);
BL_Err_Type DMA_LLI_PpStruct_Init(DMA_LLI_PP_Struct *dmaPpStruct);
BL_Err_Type DMA_LLI_PpStruct_Set_Transfer_Len(DMA_LLI_PP_Struct *dmaPpStruct,
uint16_t Ping_Transfer_len, uint16_t Pong_Transfer_len);
/*@} end of group DMA_Public_Functions */
@@ -363,4 +323,8 @@ BL_Err_Type DMA_LLI_PpStruct_Set_Transfer_Len(DMA_LLI_PP_Struct *dmaPpStruct,
/*@} end of group BL702_Peripheral_Driver */
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __BL702_DMA_H__ */

View File

@@ -1,43 +1,43 @@
/**
******************************************************************************
* @file bl702_i2c.h
* @version V1.0
* @date
* @brief This file is the standard driver header file
******************************************************************************
* @attention
*
* <h2><center>&copy; COPYRIGHT(c) 2020 Bouffalo Lab</center></h2>
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of Bouffalo Lab nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
******************************************************************************
*/
******************************************************************************
* @file bl702_i2c.h
* @version V1.0
* @date
* @brief This file is the standard driver header file
******************************************************************************
* @attention
*
* <h2><center>&copy; COPYRIGHT(c) 2020 Bouffalo Lab</center></h2>
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of Bouffalo Lab nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
******************************************************************************
*/
#ifndef __BL702_I2C_H__
#define __BL702_I2C_H__
#include "i2c_reg.h"
#include "bl702_common.h"
#include "i2c_reg.h"
/** @addtogroup BL702_Peripheral_Driver
* @{
@@ -55,75 +55,71 @@
* @brief I2C No. type definition
*/
typedef enum {
I2C0_ID = 0, /*!< I2C0 define */
I2C_ID_MAX, /*!< I2C max define */
I2C0_ID = 0, /*!< I2C0 define */
I2C_ID_MAX, /*!< I2C max define */
} I2C_ID_Type;
/**
* @brief I2C read/write type definition
*/
typedef enum {
I2C_WRITE = 0, /*!< I2C write direction */
I2C_READ, /*!< I2C read direction */
I2C_WRITE = 0, /*!< I2C write direction */
I2C_READ, /*!< I2C read direction */
} I2C_Direction_Type;
/**
* @brief I2C interrupt type definition
*/
typedef enum {
I2C_TRANS_END_INT, /*!< I2C transfer end interrupt */
I2C_TX_FIFO_READY_INT, /*!< I2C TX fifo ready interrupt */
I2C_RX_FIFO_READY_INT, /*!< I2C RX fifo ready interrupt */
I2C_NACK_RECV_INT, /*!< I2C nack received interrupt */
I2C_ARB_LOST_INT, /*!< I2C arbitration lost interrupt */
I2C_FIFO_ERR_INT, /*!< I2C TX/RX FIFO error interrupt */
I2C_INT_ALL, /*!< I2C interrupt all type */
I2C_TRANS_END_INT, /*!< I2C transfer end interrupt */
I2C_TX_FIFO_READY_INT, /*!< I2C TX fifo ready interrupt */
I2C_RX_FIFO_READY_INT, /*!< I2C RX fifo ready interrupt */
I2C_NACK_RECV_INT, /*!< I2C nack received interrupt */
I2C_ARB_LOST_INT, /*!< I2C arbitration lost interrupt */
I2C_FIFO_ERR_INT, /*!< I2C TX/RX FIFO error interrupt */
I2C_INT_ALL, /*!< I2C interrupt all type */
} I2C_INT_Type;
/**
* @brief I2S start condition phase structure type definition
*/
typedef struct
{
uint8_t len0; /*!< Length of START condition phase 0 */
uint8_t len1; /*!< Length of START condition phase 1 */
uint8_t len2; /*!< Length of START condition phase 2 */
uint8_t len3; /*!< Length of START condition phase 3 */
typedef struct {
uint8_t len0; /*!< Length of START condition phase 0 */
uint8_t len1; /*!< Length of START condition phase 1 */
uint8_t len2; /*!< Length of START condition phase 2 */
uint8_t len3; /*!< Length of START condition phase 3 */
} I2C_Start_Condition_Phase_Type;
/**
* @brief I2S stop condition phase structure type definition
*/
typedef struct
{
uint8_t len0; /*!< Length of STOP condition phase 0 */
uint8_t len1; /*!< Length of STOP condition phase 1 */
uint8_t len2; /*!< Length of STOP condition phase 2 */
uint8_t len3; /*!< Length of STOP condition phase 3 */
typedef struct {
uint8_t len0; /*!< Length of STOP condition phase 0 */
uint8_t len1; /*!< Length of STOP condition phase 1 */
uint8_t len2; /*!< Length of STOP condition phase 2 */
uint8_t len3; /*!< Length of STOP condition phase 3 */
} I2C_Stop_Condition_Phase_Type;
/**
* @brief I2S data phase structure type definition
*/
typedef struct
{
uint8_t len0; /*!< Length of DATA phase 0 */
uint8_t len1; /*!< Length of DATA phase 1 */
uint8_t len2; /*!< Length of DATA phase 2 */
uint8_t len3; /*!< Length of DATA phase 3 */
typedef struct {
uint8_t len0; /*!< Length of DATA phase 0 */
uint8_t len1; /*!< Length of DATA phase 1 */
uint8_t len2; /*!< Length of DATA phase 2 */
uint8_t len3; /*!< Length of DATA phase 3 */
} I2C_Data_Phase_Type;
/**
* @brief I2S transfer structure type definition
*/
typedef struct
{
uint8_t slaveAddr; /*!< I2C slave address */
BL_Fun_Type stopEveryByte; /*!< I2C all data byte with stop bit */
uint8_t subAddrSize; /*!< Specifies the size of I2C sub address section */
uint32_t subAddr; /*!< I2C sub address */
uint16_t dataSize; /*!< Specifies the size of I2C data section */
uint8_t *data; /*!< Specifies the pointer of I2C R/W data */
typedef struct {
uint8_t slaveAddr; /*!< I2C slave address */
BL_Fun_Type stopEveryByte; /*!< I2C all data byte with stop bit */
uint8_t subAddrSize; /*!< Specifies the size of I2C sub address section */
uint32_t subAddr; /*!< I2C sub address */
uint16_t dataSize; /*!< Specifies the size of I2C data section */
uint8_t *data; /*!< Specifies the pointer of I2C R/W data */
} I2C_Transfer_Cfg;
/*@} end of group I2C_Public_Types */
@@ -135,25 +131,19 @@ typedef struct
/** @defgroup I2C_ID_TYPE
* @{
*/
#define IS_I2C_ID_TYPE(type) (((type) == I2C0_ID) || \
((type) == I2C_ID_MAX))
#define IS_I2C_ID_TYPE(type) (((type) == I2C0_ID) || ((type) == I2C_ID_MAX))
/** @defgroup I2C_DIRECTION_TYPE
* @{
*/
#define IS_I2C_DIRECTION_TYPE(type) (((type) == I2C_WRITE) || \
((type) == I2C_READ))
#define IS_I2C_DIRECTION_TYPE(type) (((type) == I2C_WRITE) || ((type) == I2C_READ))
/** @defgroup I2C_INT_TYPE
* @{
*/
#define IS_I2C_INT_TYPE(type) (((type) == I2C_TRANS_END_INT) || \
((type) == I2C_TX_FIFO_READY_INT) || \
((type) == I2C_RX_FIFO_READY_INT) || \
((type) == I2C_NACK_RECV_INT) || \
((type) == I2C_ARB_LOST_INT) || \
((type) == I2C_FIFO_ERR_INT) || \
((type) == I2C_INT_ALL))
#define IS_I2C_INT_TYPE(type) \
(((type) == I2C_TRANS_END_INT) || ((type) == I2C_TX_FIFO_READY_INT) || ((type) == I2C_RX_FIFO_READY_INT) || ((type) == I2C_NACK_RECV_INT) || ((type) == I2C_ARB_LOST_INT) || \
((type) == I2C_FIFO_ERR_INT) || ((type) == I2C_INT_ALL))
/*@} end of group I2C_Public_Constants */
@@ -173,22 +163,26 @@ typedef struct
#ifndef BFLB_USE_HAL_DRIVER
void I2C_IRQHandler(void);
#endif
void I2C_SendWord(I2C_ID_Type i2cNo, uint32_t data);
uint32_t I2C_RecieveWord(I2C_ID_Type i2cNo);
void I2C_Enable(I2C_ID_Type i2cNo);
void I2C_Disable(I2C_ID_Type i2cNo);
void I2C_SendWord(I2C_ID_Type i2cNo, uint32_t data);
uint32_t I2C_RecieveWord(I2C_ID_Type i2cNo);
void I2C_Enable(I2C_ID_Type i2cNo);
void I2C_Disable(I2C_ID_Type i2cNo);
BL_Err_Type I2C_SetDeglitchCount(I2C_ID_Type i2cNo, uint8_t cnt);
BL_Err_Type I2C_Reset(I2C_ID_Type i2cNo);
void I2C_SetPrd(I2C_ID_Type i2cNo, uint8_t phase);
void I2C_ClockSet(I2C_ID_Type i2cNo, uint32_t clk);
void I2C_SetSclSync(I2C_ID_Type i2cNo, uint8_t enable);
void I2C_Init(I2C_ID_Type i2cNo, I2C_Direction_Type direct, I2C_Transfer_Cfg *cfg);
uint8_t I2C_GetTXFIFOAvailable();
uint8_t I2C_GetRXFIFOAvailable();
void I2C_DMATxEnable();
void I2C_DMATxDisable();
void I2C_SetPrd(I2C_ID_Type i2cNo, uint8_t phase);
void I2C_ClockSet(I2C_ID_Type i2cNo, uint32_t clk);
void I2C_SetSclSync(I2C_ID_Type i2cNo, uint8_t enable);
void I2C_Init(I2C_ID_Type i2cNo, I2C_Direction_Type direct, I2C_Transfer_Cfg *cfg);
BL_Sts_Type I2C_IsBusy(I2C_ID_Type i2cNo);
BL_Sts_Type I2C_TransferEndStatus(I2C_ID_Type i2cNo);
BL_Err_Type I2C_MasterSendBlocking(I2C_ID_Type i2cNo, I2C_Transfer_Cfg *cfg);
BL_Err_Type I2C_MasterReceiveBlocking(I2C_ID_Type i2cNo, I2C_Transfer_Cfg *cfg);
void I2C_IntMask(I2C_ID_Type i2cNo, I2C_INT_Type intType, BL_Mask_Type intMask);
void I2C_Int_Callback_Install(I2C_ID_Type i2cNo, I2C_INT_Type intType, intCallback_Type *cbFun);
void I2C_IntMask(I2C_ID_Type i2cNo, I2C_INT_Type intType, BL_Mask_Type intMask);
void I2C_Int_Callback_Install(I2C_ID_Type i2cNo, I2C_INT_Type intType, intCallback_Type *cbFun);
/*@} end of group I2C_Public_Functions */

View File

@@ -58,7 +58,7 @@ static intCallback_Type *dmaIntCbfArra[DMA_CH_MAX][DMA_INT_ALL] = {
{NULL, NULL},
{NULL, NULL}
};
static DMA_LLI_Ctrl_Type PingPongListArra[DMA_CH_MAX][2];
// static DMA_LLI_Ctrl_Type PingPongListArra[DMA_CH_MAX][2];
/*@} end of group DMA_Private_Macros */
@@ -90,14 +90,14 @@ static DMA_LLI_Ctrl_Type PingPongListArra[DMA_CH_MAX][2];
* @{
*/
/****************************************************************************/ /**
* @brief DMA interrupt handler
*
* @param None
*
* @return None
*
*******************************************************************************/
/**
* @brief DMA interrupt handler
*
* @param None
*
* @return None
*
*******************************************************************************/
#ifndef BFLB_USE_HAL_DRIVER
void DMA_ALL_IRQHandler(void) {
uint32_t tmpVal;
@@ -150,14 +150,14 @@ void DMA_ALL_IRQHandler(void) {
* @{
*/
/****************************************************************************/ /**
* @brief DMA enable
*
* @param None
*
* @return None
*
*******************************************************************************/
/**
* @brief DMA enable
*
* @param None
*
* @return None
*
*******************************************************************************/
void DMA_Enable(void) {
uint32_t tmpVal;
/* Get DMA register */
@@ -171,14 +171,14 @@ void DMA_Enable(void) {
#endif
}
/****************************************************************************/ /**
* @brief DMA disable
*
* @param None
*
* @return None
*
*******************************************************************************/
/**
* @brief DMA disable
*
* @param None
*
* @return None
*
*******************************************************************************/
void DMA_Disable(void) {
uint32_t tmpVal;
/* Get DMA register */
@@ -189,14 +189,14 @@ void DMA_Disable(void) {
BL_WR_REG(DMAChs, DMA_TOP_CONFIG, tmpVal);
}
/****************************************************************************/ /**
* @brief DMA channel init
*
* @param chCfg: DMA configuration
*
* @return None
*
*******************************************************************************/
/**
* @brief DMA channel init
*
* @param chCfg: DMA configuration
*
* @return None
*
*******************************************************************************/
void DMA_Channel_Init(DMA_Channel_Cfg_Type *chCfg) {
uint32_t tmpVal;
/* Get channel register */
@@ -206,13 +206,14 @@ void DMA_Channel_Init(DMA_Channel_Cfg_Type *chCfg) {
CHECK_PARAM(IS_DMA_CHAN_TYPE(chCfg->ch));
CHECK_PARAM(IS_DMA_TRANS_WIDTH_TYPE(chCfg->srcTransfWidth));
CHECK_PARAM(IS_DMA_TRANS_WIDTH_TYPE(chCfg->dstTransfWidth));
CHECK_PARAM(IS_DMA_BURST_SIZE_TYPE(chCfg->srcBurstSzie));
CHECK_PARAM(IS_DMA_BURST_SIZE_TYPE(chCfg->dstBurstSzie));
CHECK_PARAM(IS_DMA_BURST_SIZE_TYPE(chCfg->srcBurstSize));
CHECK_PARAM(IS_DMA_BURST_SIZE_TYPE(chCfg->dstBurstSize));
CHECK_PARAM(IS_DMA_TRANS_DIR_TYPE(chCfg->dir));
CHECK_PARAM(IS_DMA_PERIPH_REQ_TYPE(chCfg->dstPeriph));
CHECK_PARAM(IS_DMA_PERIPH_REQ_TYPE(chCfg->srcPeriph));
/* Disable clock gate */
// Turns on clock
GLB_AHB_Slave1_Clock_Gate(DISABLE, BL_AHB_SLAVE1_DMA);
/* Config channel config */
@@ -223,15 +224,15 @@ void DMA_Channel_Init(DMA_Channel_Cfg_Type *chCfg) {
tmpVal = BL_SET_REG_BITS_VAL(tmpVal, DMA_TRANSFERSIZE, chCfg->transfLength);
tmpVal = BL_SET_REG_BITS_VAL(tmpVal, DMA_SWIDTH, chCfg->srcTransfWidth);
tmpVal = BL_SET_REG_BITS_VAL(tmpVal, DMA_DWIDTH, chCfg->dstTransfWidth);
tmpVal = BL_SET_REG_BITS_VAL(tmpVal, DMA_SBSIZE, chCfg->srcBurstSzie);
tmpVal = BL_SET_REG_BITS_VAL(tmpVal, DMA_DBSIZE, chCfg->dstBurstSzie);
tmpVal = BL_SET_REG_BITS_VAL(tmpVal, DMA_SBSIZE, chCfg->srcBurstSize);
tmpVal = BL_SET_REG_BITS_VAL(tmpVal, DMA_DBSIZE, chCfg->dstBurstSize);
tmpVal = BL_SET_REG_BITS_VAL(tmpVal, DMA_DST_ADD_MODE, chCfg->dstAddMode);
tmpVal = BL_SET_REG_BITS_VAL(tmpVal, DMA_DST_MIN_MODE, chCfg->dstMinMode);
tmpVal = BL_SET_REG_BITS_VAL(tmpVal, DMA_FIX_CNT, chCfg->fixCnt);
/* FIXME: how to deal with SLargerD */
tmpVal = BL_CLR_REG_BIT(tmpVal, DMA_SLARGERD);
tmpVal = BL_CLR_REG_BIT(tmpVal, DMA_SLARGERD); // Reserved bit 25
tmpVal = BL_SET_REG_BITS_VAL(tmpVal, DMA_SI, chCfg->srcAddrInc);
tmpVal = BL_SET_REG_BITS_VAL(tmpVal, DMA_DI, chCfg->destAddrInc);
BL_WR_REG(DMAChs, DMA_CONTROL, tmpVal);
@@ -241,18 +242,21 @@ void DMA_Channel_Init(DMA_Channel_Cfg_Type *chCfg) {
tmpVal = BL_SET_REG_BITS_VAL(tmpVal, DMA_DSTPERIPHERAL, chCfg->dstPeriph);
tmpVal = BL_SET_REG_BITS_VAL(tmpVal, DMA_SRCPERIPHERAL, chCfg->srcPeriph);
BL_WR_REG(DMAChs, DMA_CONFIG, tmpVal);
// Clear interrupts
*((uint32_t *)0x4000c008) = 1 << (chCfg->ch); // Clear transfer complete
*((uint32_t *)0x4000c010) = 1 << (chCfg->ch); // Clear Error
}
/****************************************************************************/ /**
* @brief DMA channel update source memory address and len
*
* @param ch: DMA channel
* @param memAddr: source memoty address
* @param len: source memory data length
*
* @return None
*
*******************************************************************************/
/**
* @brief DMA channel update source memory address and len
*
* @param ch: DMA channel
* @param memAddr: source memoty address
* @param len: source memory data length
*
* @return None
*
*******************************************************************************/
void DMA_Channel_Update_SrcMemcfg(uint8_t ch, uint32_t memAddr, uint32_t len) {
uint32_t tmpVal;
/* Get channel register */
@@ -268,16 +272,16 @@ void DMA_Channel_Update_SrcMemcfg(uint8_t ch, uint32_t memAddr, uint32_t len) {
BL_WR_REG(DMAChs, DMA_CONTROL, tmpVal);
}
/****************************************************************************/ /**
* @brief DMA channel update destination memory address and len
*
* @param ch: DMA channel
* @param memAddr: destination memoty address
* @param len: destination memory data length
*
* @return None
*
*******************************************************************************/
/**
* @brief DMA channel update destination memory address and len
*
* @param ch: DMA channel
* @param memAddr: destination memoty address
* @param len: destination memory data length
*
* @return None
*
*******************************************************************************/
void DMA_Channel_Update_DstMemcfg(uint8_t ch, uint32_t memAddr, uint32_t len) {
uint32_t tmpVal;
/* Get channel register */
@@ -293,14 +297,14 @@ void DMA_Channel_Update_DstMemcfg(uint8_t ch, uint32_t memAddr, uint32_t len) {
BL_WR_REG(DMAChs, DMA_CONTROL, tmpVal);
}
/****************************************************************************/ /**
* @brief Get DMA channel tranfersize
*
* @param ch: DMA channel
*
* @return tranfersize size
*
*******************************************************************************/
/**
* @brief Get DMA channel tranfersize
*
* @param ch: DMA channel
*
* @return tranfersize size
*
*******************************************************************************/
uint32_t DMA_Channel_TranferSize(uint8_t ch) {
/* Get channel register */
uint32_t DMAChs = DMA_Get_Channel(ch);
@@ -311,14 +315,14 @@ uint32_t DMA_Channel_TranferSize(uint8_t ch) {
return BL_GET_REG_BITS_VAL(BL_RD_REG(DMAChs, DMA_CONTROL), DMA_TRANSFERSIZE);
}
/****************************************************************************/ /**
* @brief Get DMA channel busy status
*
* @param ch: DMA channel
*
* @return SET or RESET
*
*******************************************************************************/
/**
* @brief Get DMA channel busy status
*
* @param ch: DMA channel
*
* @return SET or RESET
*
*******************************************************************************/
BL_Sts_Type DMA_Channel_Is_Busy(uint8_t ch) {
/* Get channel register */
uint32_t DMAChs = DMA_Get_Channel(ch);
@@ -329,14 +333,14 @@ BL_Sts_Type DMA_Channel_Is_Busy(uint8_t ch) {
return BL_IS_REG_BIT_SET(BL_RD_REG(DMAChs, DMA_CONFIG), DMA_E) == 1 ? SET : RESET;
}
/****************************************************************************/ /**
* @brief DMA enable
*
* @param ch: DMA channel number
*
* @return None
*
*******************************************************************************/
/**
* @brief DMA enable
*
* @param ch: DMA channel number
*
* @return None
*
*******************************************************************************/
void DMA_Channel_Enable(uint8_t ch) {
uint32_t tmpVal;
/* Get channel register */
@@ -350,14 +354,14 @@ void DMA_Channel_Enable(uint8_t ch) {
BL_WR_REG(DMAChs, DMA_CONFIG, tmpVal);
}
/****************************************************************************/ /**
* @brief DMA disable
*
* @param ch: DMA channel number
*
* @return None
*
*******************************************************************************/
/**
* @brief DMA disable
*
* @param ch: DMA channel number
*
* @return None
*
*******************************************************************************/
void DMA_Channel_Disable(uint8_t ch) {
uint32_t tmpVal;
/* Get channel register */
@@ -371,15 +375,15 @@ void DMA_Channel_Disable(uint8_t ch) {
BL_WR_REG(DMAChs, DMA_CONFIG, tmpVal);
}
/****************************************************************************/ /**
* @brief DMA init LLI transfer
*
* @param ch: DMA channel number
* @param lliCfg: LLI configuration
*
* @return None
*
*******************************************************************************/
/**
* @brief DMA init LLI transfer
*
* @param ch: DMA channel number
* @param lliCfg: LLI configuration
*
* @return None
*
*******************************************************************************/
void DMA_LLI_Init(uint8_t ch, DMA_LLI_Cfg_Type *lliCfg) {
uint32_t tmpVal;
/* Get channel register */
@@ -401,15 +405,15 @@ void DMA_LLI_Init(uint8_t ch, DMA_LLI_Cfg_Type *lliCfg) {
BL_WR_REG(DMAChs, DMA_CONFIG, tmpVal);
}
/****************************************************************************/ /**
* @brief DMA channel update LLI
*
* @param ch: DMA channel number
* @param LLI: LLI addr
*
* @return None
*
*******************************************************************************/
/**
* @brief DMA channel update LLI
*
* @param ch: DMA channel number
* @param LLI: LLI addr
*
* @return None
*
*******************************************************************************/
void DMA_LLI_Update(uint8_t ch, uint32_t LLI) {
/* Get channel register */
uint32_t DMAChs = DMA_Get_Channel(ch);
@@ -422,152 +426,16 @@ void DMA_LLI_Update(uint8_t ch, uint32_t LLI) {
BL702_MemCpy4((uint32_t *)DMAChs, (uint32_t *)LLI, 4);
}
/****************************************************************************/ /**
* @brief DMA LLI PingPong Structure Start
*
* @param dmaPpStruct: dma pp struct pointer
* @param Ping_Transfer_len: ping len
* @param Pong_Transfer_len: pong len
*
* @return Succrss or not
*
*******************************************************************************/
BL_Err_Type DMA_LLI_PpStruct_Set_Transfer_Len(DMA_LLI_PP_Struct *dmaPpStruct, uint16_t Ping_Transfer_len, uint16_t Pong_Transfer_len) {
struct DMA_Control_Reg dmaCtrlRegVal_temp;
if (Ping_Transfer_len > 4096 || Pong_Transfer_len > 4096) {
return ERROR;
}
dmaCtrlRegVal_temp = PingPongListArra[dmaPpStruct->dmaChan][PING_INDEX].dmaCtrl;
dmaCtrlRegVal_temp.TransferSize = Ping_Transfer_len;
PingPongListArra[dmaPpStruct->dmaChan][PING_INDEX].dmaCtrl = dmaCtrlRegVal_temp;
dmaCtrlRegVal_temp = PingPongListArra[dmaPpStruct->dmaChan][PONG_INDEX].dmaCtrl;
dmaCtrlRegVal_temp.TransferSize = Pong_Transfer_len;
PingPongListArra[dmaPpStruct->dmaChan][PONG_INDEX].dmaCtrl = dmaCtrlRegVal_temp;
DMA_LLI_Init(dmaPpStruct->dmaChan, dmaPpStruct->DMA_LLI_Cfg);
DMA_LLI_Update(dmaPpStruct->dmaChan, (uint32_t)&PingPongListArra[dmaPpStruct->dmaChan][PING_INDEX]);
return SUCCESS;
}
/****************************************************************************/ /**
* @brief DMA LLI Start New Transmit for Ping-Pong Buf
*
* @param dmaPpBuf: DMA LLI Ping-Pong Buf
*
* @return None
*
*******************************************************************************/
void DMA_LLI_PpBuf_Start_New_Transmit(DMA_LLI_PP_Buf *dmaPpBuf) {
CPU_Interrupt_Disable(DMA_ALL_IRQn);
if (dmaPpBuf->lliListHeader[dmaPpBuf->idleIndex] != NULL) {
DMA_LLI_Update(dmaPpBuf->dmaChan, (uint32_t)dmaPpBuf->lliListHeader[dmaPpBuf->idleIndex]);
DMA_Channel_Enable(dmaPpBuf->dmaChan);
dmaPpBuf->idleIndex = (dmaPpBuf->idleIndex == 0) ? 1 : 0;
}
CPU_Interrupt_Enable(DMA_ALL_IRQn);
}
/****************************************************************************/ /**
* @brief DMA LLI Remove Completed Ping-Pong Buf List
*
* @param dmaPpBuf: DMA LLI Ping-Pong Buf
*
* @return Next Ping-Pong Buf List Header
*
*******************************************************************************/
DMA_LLI_Ctrl_Type *DMA_LLI_PpBuf_Remove_Completed_List(DMA_LLI_PP_Buf *dmaPpBuf) {
CPU_Interrupt_Disable(DMA_ALL_IRQn);
dmaPpBuf->lliListHeader[!dmaPpBuf->idleIndex] = NULL;
CPU_Interrupt_Enable(DMA_ALL_IRQn);
return dmaPpBuf->lliListHeader[!dmaPpBuf->idleIndex];
}
/****************************************************************************/ /**
* @brief DMA LLI Append Buf to List
*
* @param dmaPpBuf: DMA LLI Ping-Pong Buf
* @param dmaLliList: New LLI Buf to Append
*
* @return None
*
*******************************************************************************/
void DMA_LLI_PpBuf_Append(DMA_LLI_PP_Buf *dmaPpBuf, DMA_LLI_Ctrl_Type *dmaLliList) {
DMA_LLI_Ctrl_Type *pLliList = NULL;
CPU_Interrupt_Disable(DMA_ALL_IRQn);
pLliList = dmaPpBuf->lliListHeader[dmaPpBuf->idleIndex];
if (pLliList == NULL) {
dmaLliList->nextLLI = 0;
dmaLliList->dmaCtrl.I = 1;
dmaPpBuf->lliListHeader[dmaPpBuf->idleIndex] = dmaLliList;
} else {
/*Append to last */
while (pLliList->nextLLI != 0) {
pLliList = (DMA_LLI_Ctrl_Type *)pLliList->nextLLI;
}
pLliList->nextLLI = (uint32_t)dmaLliList;
pLliList->dmaCtrl.I = 0;
dmaLliList->nextLLI = 0;
dmaLliList->dmaCtrl.I = 1;
}
if (DMA_Channel_Is_Busy(dmaPpBuf->dmaChan) == RESET) {
/* DMA stopped: maybe stop just a few minutes ago(not enter INT due to CPU_Interrupt_Disable)
or has already stopped before this function is called */
if (dmaPpBuf->lliListHeader[!dmaPpBuf->idleIndex] == NULL) {
/* DMA has already stopped before this function is called */
DMA_LLI_PpBuf_Start_New_Transmit(dmaPpBuf);
}
}
CPU_Interrupt_Enable(DMA_ALL_IRQn);
}
/****************************************************************************/ /**
* @brief DMA LLi Destroy Ping-Pong Buf
*
* @param dmaPpBuf: DMA LLI Ping-Pong Buf
*
* @return None
*
*******************************************************************************/
void DMA_LLI_PpBuf_Destroy(DMA_LLI_PP_Buf *dmaPpBuf) {
/* DMA LLI Disable */
DMA_Channel_Disable(dmaPpBuf->dmaChan);
if (dmaPpBuf->lliListHeader[0] != NULL && dmaPpBuf->onTransCompleted != NULL) {
dmaPpBuf->onTransCompleted(dmaPpBuf->lliListHeader[0]);
}
dmaPpBuf->lliListHeader[0] = NULL;
if (dmaPpBuf->lliListHeader[1] != NULL && dmaPpBuf->onTransCompleted != NULL) {
dmaPpBuf->onTransCompleted(dmaPpBuf->lliListHeader[1]);
}
dmaPpBuf->lliListHeader[1] = NULL;
dmaPpBuf->idleIndex = 0;
}
/****************************************************************************/ /**
* @brief Mask/Unmask the DMA interrupt
*
* @param ch: DMA channel number
* @param intType: Specifies the interrupt type
* @param intMask: Enable/Disable Specified interrupt type
*
* @return None
*
*******************************************************************************/
/**
* @brief Mask/Unmask the DMA interrupt
*
* @param ch: DMA channel number
* @param intType: Specifies the interrupt type
* @param intMask: Enable/Disable Specified interrupt type
*
* @return None
*
*******************************************************************************/
void DMA_IntMask(uint8_t ch, DMA_INT_Type intType, BL_Mask_Type intMask) {
uint32_t tmpVal;
/* Get channel register */
@@ -636,16 +504,16 @@ void DMA_IntMask(uint8_t ch, DMA_INT_Type intType, BL_Mask_Type intMask) {
}
}
/****************************************************************************/ /**
* @brief Install DMA interrupt callback function
*
* @param dmaChan: DMA Channel type
* @param intType: DMA interrupt type
* @param cbFun: Pointer to interrupt callback function. The type should be void (*fn)(void)
*
* @return None
*
*******************************************************************************/
/**
* @brief Install DMA interrupt callback function
*
* @param dmaChan: DMA Channel type
* @param intType: DMA interrupt type
* @param cbFun: Pointer to interrupt callback function. The type should be void (*fn)(void)
*
* @return None
*
*******************************************************************************/
void DMA_Int_Callback_Install(DMA_Chan_Type dmaChan, DMA_INT_Type intType, intCallback_Type *cbFun) {
/* Check the parameters */
CHECK_PARAM(IS_DMA_CHAN_TYPE(dmaChan));
@@ -654,69 +522,6 @@ void DMA_Int_Callback_Install(DMA_Chan_Type dmaChan, DMA_INT_Type intType, intCa
dmaIntCbfArra[dmaChan][intType] = cbFun;
}
/****************************************************************************/ /**
* @brief DMA LLI PingPong Structure Initial
*
* @param dmaPpStruct: DMA LLI PingPong Config Parameter
*
* @return start success or not
*
*******************************************************************************/
BL_Err_Type DMA_LLI_PpStruct_Init(DMA_LLI_PP_Struct *dmaPpStruct) {
// setup lliList
dmaPpStruct->dmaCtrlRegVal.I = 1;
dmaPpStruct->trans_index = 0;
if (dmaPpStruct->DMA_LLI_Cfg->dir == DMA_TRNS_M2P) {
PingPongListArra[dmaPpStruct->dmaChan][PING_INDEX].srcDmaAddr = dmaPpStruct->chache_buf_addr[0];
PingPongListArra[dmaPpStruct->dmaChan][PING_INDEX].destDmaAddr = dmaPpStruct->operatePeriphAddr;
PingPongListArra[dmaPpStruct->dmaChan][PONG_INDEX].srcDmaAddr = dmaPpStruct->chache_buf_addr[1];
PingPongListArra[dmaPpStruct->dmaChan][PONG_INDEX].destDmaAddr = dmaPpStruct->operatePeriphAddr;
} else if (dmaPpStruct->DMA_LLI_Cfg->dir == DMA_TRNS_P2M) {
PingPongListArra[dmaPpStruct->dmaChan][PING_INDEX].srcDmaAddr = dmaPpStruct->operatePeriphAddr;
PingPongListArra[dmaPpStruct->dmaChan][PING_INDEX].destDmaAddr = dmaPpStruct->chache_buf_addr[0];
PingPongListArra[dmaPpStruct->dmaChan][PONG_INDEX].srcDmaAddr = dmaPpStruct->operatePeriphAddr;
PingPongListArra[dmaPpStruct->dmaChan][PONG_INDEX].destDmaAddr = dmaPpStruct->chache_buf_addr[1];
} else {
return ERROR;
/*V1.0 version DMA LLI Ping-Pong structure not support P2P & M2M MODE*/
}
PingPongListArra[dmaPpStruct->dmaChan][PING_INDEX].nextLLI = (uint32_t)&PingPongListArra[dmaPpStruct->dmaChan][PONG_INDEX];
PingPongListArra[dmaPpStruct->dmaChan][PING_INDEX].dmaCtrl = dmaPpStruct->dmaCtrlRegVal;
PingPongListArra[dmaPpStruct->dmaChan][PONG_INDEX].nextLLI = (uint32_t)&PingPongListArra[dmaPpStruct->dmaChan][PING_INDEX];
PingPongListArra[dmaPpStruct->dmaChan][PONG_INDEX].dmaCtrl = dmaPpStruct->dmaCtrlRegVal;
DMA_LLI_Init(dmaPpStruct->dmaChan, dmaPpStruct->DMA_LLI_Cfg);
DMA_LLI_Update(dmaPpStruct->dmaChan, (uint32_t)&PingPongListArra[dmaPpStruct->dmaChan][PING_INDEX]);
return SUCCESS;
}
/****************************************************************************/ /**
* @brief DMA LLI PingPong Structure Start
*
* @param dmaPpStruct: None
*
* @return None
*
*******************************************************************************/
void DMA_LLI_PpStruct_Start(DMA_LLI_PP_Struct *dmaPpStruct) { DMA_Channel_Enable(dmaPpStruct->dmaChan); }
/****************************************************************************/ /**
* @brief DMA LLI PingPong Structure Stop
*
* @param dmaPpStruct: None
*
* @return None
*
*******************************************************************************/
void DMA_LLI_PpStruct_Stop(DMA_LLI_PP_Struct *dmaPpStruct) { DMA_Channel_Disable(dmaPpStruct->dmaChan); }
/*@} end of group DMA_Public_Functions */
/*@} end of group DMA */

View File

@@ -205,11 +205,67 @@ void I2C_Enable(I2C_ID_Type i2cNo) {
/* Check the parameters */
CHECK_PARAM(IS_I2C_ID_TYPE(i2cNo));
// Set the M_EN bit
tmpVal = BL_RD_REG(I2Cx, I2C_CONFIG);
tmpVal = BL_SET_REG_BIT(tmpVal, I2C_CR_I2C_M_EN);
BL_WR_REG(I2Cx, I2C_CONFIG, tmpVal);
}
uint8_t I2C_GetTXFIFOAvailable() {
volatile uint32_t tmpVal;
uint32_t I2Cx = I2C_BASE;
tmpVal = BL_RD_REG(I2Cx, I2C_FIFO_CONFIG_1);
return tmpVal & 0b11; // Lowest two bits
}
uint8_t I2C_GetRXFIFOAvailable() {
volatile uint32_t tmpVal;
uint32_t I2Cx = I2C_BASE;
tmpVal = BL_RD_REG(I2Cx, I2C_FIFO_CONFIG_1);
return (tmpVal >> 8) & 0b11; // Lowest two bits of byte 2
}
void I2C_DMATxEnable() {
uint32_t tmpVal;
uint32_t I2Cx = I2C_BASE;
tmpVal = BL_RD_REG(I2Cx, I2C_FIFO_CONFIG_0);
tmpVal = BL_SET_REG_BIT(tmpVal, I2C_DMA_TX_EN);
tmpVal = BL_SET_REG_BIT(tmpVal, I2C_TX_FIFO_CLR);
tmpVal = BL_SET_REG_BIT(tmpVal, I2C_RX_FIFO_CLR);
// tmpVal = BL_SET_REG_BIT(tmpVal, I2C_DMA_RX_EN);
BL_WR_REG(I2Cx, I2C_FIFO_CONFIG_0, tmpVal);
// Ensure fifo setpoint is as we expect
tmpVal = BL_RD_REG(I2Cx, I2C_FIFO_CONFIG_1);
tmpVal &= I2C_TX_FIFO_CNT_UMSK;
tmpVal |= 1;
BL_WR_REG(I2Cx, I2C_FIFO_CONFIG_1, tmpVal);
}
void I2C_DMATxDisable() {
uint32_t tmpVal;
uint32_t I2Cx = I2C_BASE;
tmpVal = BL_RD_REG(I2Cx, I2C_FIFO_CONFIG_0);
tmpVal = BL_CLR_REG_BIT(tmpVal, I2C_DMA_TX_EN);
// tmpVal = BL_CLR_REG_BIT(tmpVal, I2C_DMA_RX_EN);
BL_WR_REG(I2Cx, I2C_FIFO_CONFIG_0, tmpVal);
tmpVal = BL_RD_REG(I2Cx, I2C_FIFO_CONFIG_1);
tmpVal &= I2C_TX_FIFO_CNT_UMSK;
tmpVal |= 1;
BL_WR_REG(I2Cx, I2C_FIFO_CONFIG_1, tmpVal);
}
/**
* @brief I2C disable
*
@@ -297,15 +353,15 @@ void I2C_Init(I2C_ID_Type i2cNo, I2C_Direction_Type direct, I2C_Transfer_Cfg *cf
tmpVal = BL_CLR_REG_BIT(tmpVal, I2C_CR_I2C_SUB_ADDR_EN);
}
// Packet length <=256 bytes per transaction
tmpVal = BL_SET_REG_BITS_VAL(tmpVal, I2C_CR_I2C_PKT_LEN, cfg->dataSize - 1);
BL_WR_REG(I2Cx, I2C_CONFIG, tmpVal);
/* Set sub address */
BL_WR_REG(I2Cx, I2C_SUB_ADDR, cfg->subAddr);
#ifndef BFLB_USE_HAL_DRIVER
Interrupt_Handler_Register(I2C_IRQn, I2C_IRQHandler);
#endif
}
/**
@@ -491,6 +547,8 @@ BL_Err_Type I2C_MasterSendBlocking(I2C_ID_Type i2cNo, I2C_Transfer_Cfg *cfg) {
uint32_t timeOut = 0;
uint32_t temp = 0;
uint32_t I2Cx = I2C_BASE;
I2C_IntMask(I2C0_ID, I2C_TRANS_END_INT, UNMASK); // This function needs to be able to use the irq status bits
I2C_IntMask(I2C0_ID, I2C_NACK_RECV_INT, UNMASK); // This function needs to be able to use the irq status bits
/* Check the parameters */
CHECK_PARAM(IS_I2C_ID_TYPE(i2cNo));
@@ -571,6 +629,9 @@ BL_Err_Type I2C_MasterReceiveBlocking(I2C_ID_Type i2cNo, I2C_Transfer_Cfg *cfg)
I2C_Disable(i2cNo);
I2C_Init(i2cNo, I2C_READ, cfg);
I2C_Enable(i2cNo);
I2C_IntMask(I2C0_ID, I2C_TRANS_END_INT, UNMASK); // This function needs to be able to use the irq status bits
I2C_IntMask(I2C0_ID, I2C_NACK_RECV_INT, UNMASK); // This function needs to be able to use the irq status bits
timeOut = I2C_FIFO_STATUS_TIMEOUT;
if (cfg->dataSize == 0 && cfg->subAddrSize == 0) {
while (BL_RD_REG(I2C_BASE, I2C_BUS_BUSY)) {
@@ -589,6 +650,7 @@ BL_Err_Type I2C_MasterReceiveBlocking(I2C_ID_Type i2cNo, I2C_Transfer_Cfg *cfg)
return TIMEOUT;
}
}
/* Read I2C data */
while (cfg->dataSize - i >= 4) {
timeOut = I2C_FIFO_STATUS_TIMEOUT;

View File

@@ -10,7 +10,7 @@ NOTES
#ifndef _BLE_TP_SVC_H_
#define _BLE_TP_SVC_H_
#include "types.h"
#include <zephyr/types.h>
#include "ble_config.h"
// read value handle offset 2

View File

@@ -154,6 +154,7 @@
#define POW_EPR 1
#define ENABLE_QC2 1
#define MAG_SLEEP_SUPPORT 1
#define TIP_TYPE_SUPPORT 1 // Support for tips of different types, i.e. resistance
#define AUTO_TIP_SELECTION 1 // Can auto-select the tip
#define TIPTYPE_T12 1 // Can manually pick a T12 tip
#define DEVICE_HAS_VALIDATION_SUPPORT

View File

@@ -5,7 +5,7 @@
* Author: Ralim
*/
#include "TipThermoModel.h"
#include "Utils.h"
#include "Utils.hpp"
#include "configuration.h"
#ifdef TEMP_uV_LOOKUP_PT1000

View File

@@ -1,6 +1,6 @@
#include "HUB238.hpp"
#include "I2CBB2.hpp"
#include "Utils.h"
#include "Utils.hpp"
#include "configuration.h"
#if POW_PD_EXT == 1

View File

@@ -11,6 +11,7 @@
#include "cmsis_os.h"
#include "configuration.h"
#include <OLED.hpp>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
@@ -23,9 +24,9 @@ OLED::DisplayState OLED::displayState;
int16_t OLED::cursor_x, OLED::cursor_y;
bool OLED::initDone = false;
uint8_t OLED::displayOffset;
uint8_t OLED::screenBuffer[16 + (OLED_WIDTH * (OLED_HEIGHT / 8)) + 10]; // The data buffer
uint8_t OLED::secondFrameBuffer[16 + (OLED_WIDTH * (OLED_HEIGHT / 8)) + 10];
uint32_t OLED::displayChecksum;
alignas(uint32_t) uint8_t OLED::screenBuffer[16 + (OLED_WIDTH * (OLED_HEIGHT / 8)) + 10]; // The data buffer
alignas(uint32_t) uint8_t OLED::secondFrameBuffer[16 + (OLED_WIDTH * (OLED_HEIGHT / 8)) + 10];
uint32_t OLED::displayChecksum;
/*
* Setup params for the OLED screen
* http://www.displayfuture.com/Display/datasheet/controller/SSD1307.pdf
@@ -209,21 +210,18 @@ void OLED::drawChar(const uint16_t charCode, const FontStyle fontStyle, const ui
* of the indicator in pixels (0..<16).
*/
void OLED::drawScrollIndicator(uint8_t y, uint8_t height) {
union u_type {
uint32_t whole;
uint8_t strips[4];
} column;
column.whole = (1 << height) - 1; // preload a set of set bits of height
column.whole <<= y; // Shift down by the y value
const uint32_t whole = ((1 << height) - 1) << y; // preload a set of set bits of height
// Shift down by the y value
const uint8_t strips[4] = {static_cast<uint8_t>(whole & 0xff), static_cast<uint8_t>((whole & 0xff00) >> 8 * 1), static_cast<uint8_t>((whole & 0xff0000) >> 8 * 2),
static_cast<uint8_t>((whole & 0xff000000) >> 8 * 3)};
// Draw a one pixel wide bar to the left with a single pixel as
// the scroll indicator.
fillArea(OLED_WIDTH - 1, 0, 1, 8, column.strips[0]);
fillArea(OLED_WIDTH - 1, 8, 1, 8, column.strips[1]);
fillArea(OLED_WIDTH - 1, 0, 1, 8, strips[0]);
fillArea(OLED_WIDTH - 1, 8, 1, 8, strips[1]);
#if OLED_HEIGHT == 32
fillArea(OLED_WIDTH - 1, 16, 1, 8, column.strips[2]);
fillArea(OLED_WIDTH - 1, 24, 1, 8, column.strips[3]);
fillArea(OLED_WIDTH - 1, 16, 1, 8, strips[2]);
fillArea(OLED_WIDTH - 1, 24, 1, 8, strips[3]);
#endif
}

View File

@@ -9,7 +9,7 @@
#include "BSP.h"
#include "Settings.h"
#include "Types.h"
#include "Utils.h"
#include "Utils.hpp"
#include "configuration.h"
#include "main.hpp"
#include "power.hpp"

View File

@@ -337,68 +337,51 @@ bool pdbs_dpm_evaluate_capability(const pd_msg *capabilities, pd_msg *request) {
return true;
}
void add_v_record(pd_msg *cap, uint16_t voltage_mv, int numobj) {
uint16_t current = (voltage_mv) / getTipResistanceX10(); // In centi-amps
/* Add a PDO for the desired power. */
cap->obj[numobj] = PD_PDO_TYPE_FIXED | PD_PDO_SNK_FIXED_VOLTAGE_SET(PD_MV2PDV(voltage_mv)) | PD_PDO_SNK_FIXED_CURRENT_SET(current);
}
void pdbs_dpm_get_sink_capability(pd_msg *cap, const bool isPD3) {
/* Keep track of how many PDOs we've added */
// int numobj = 0;
int numobj = 0;
// /* If we have no configuration or want something other than 5 V, add a PDO
// * for vSafe5V */
// /* Minimum current, 5 V, and higher capability. */
// cap->obj[numobj++] = PD_PDO_TYPE_FIXED | PD_PDO_SNK_FIXED_VOLTAGE_SET(PD_MV2PDV(5000)) | PD_PDO_SNK_FIXED_CURRENT_SET(DPM_MIN_CURRENT);
/* If we have no configuration or want something other than 5 V, add a PDO
* for vSafe5V */
/* Minimum current, 5 V, and higher capability. */
cap->obj[numobj++] = PD_PDO_TYPE_FIXED | PD_PDO_SNK_FIXED_VOLTAGE_SET(PD_MV2PDV(5000)) | PD_PDO_SNK_FIXED_CURRENT_SET(DPM_MIN_CURRENT);
// Voltages must be in order of lowest -> highest
#if USB_PD_VMAX >= 20
add_v_record(cap, 9000, numobj);
numobj++;
add_v_record(cap, 15000, numobj);
numobj++;
add_v_record(cap, 20000, numobj);
numobj++;
#elif USB_PD_VMAX >= 15
add_v_record(cap, 9000, numobj);
numobj++;
add_v_record(cap, 12000, numobj);
numobj++;
add_v_record(cap, 15000, numobj);
numobj++;
#elif USB_PD_VMAX >= 12
add_v_record(cap, 9000, numobj);
numobj++;
add_v_record(cap, 12000, numobj);
numobj++;
#elif USB_PD_VMAX >= 9
add_v_record(cap, 9000, numobj);
numobj++;
#endif
// /* Get the current we want */
// uint16_t voltage = USB_PD_VMAX * 1000; // in mv
// if (requested_voltage_mv != 5000) {
// voltage = requested_voltage_mv;
// }
// uint16_t current = (voltage) / getTipResistanceX10(); // In centi-amps
/* Set the USB communications capable flag. */
cap->obj[0] |= PD_PDO_SNK_FIXED_USB_COMMS;
// /* Add a PDO for the desired power. */
// cap->obj[numobj++] = PD_PDO_TYPE_FIXED | PD_PDO_SNK_FIXED_VOLTAGE_SET(PD_MV2PDV(voltage)) | PD_PDO_SNK_FIXED_CURRENT_SET(current);
// /* Get the PDO from the voltage range */
// int8_t i = dpm_get_range_fixed_pdo_index(cap);
// /* If it's vSafe5V, set our vSafe5V's current to what we want */
// if (i == 0) {
// cap->obj[0] &= ~PD_PDO_SNK_FIXED_CURRENT;
// cap->obj[0] |= PD_PDO_SNK_FIXED_CURRENT_SET(current);
// } else {
// /* If we want more than 5 V, set the Higher Capability flag */
// if (PD_MV2PDV(voltage) != PD_MV2PDV(5000)) {
// cap->obj[0] |= PD_PDO_SNK_FIXED_HIGHER_CAP;
// }
// /* If the range PDO is a different voltage than the preferred
// * voltage, add it to the array. */
// if (i > 0 && PD_PDO_SRC_FIXED_VOLTAGE_GET(cap->obj[i]) != PD_MV2PDV(voltage)) {
// cap->obj[numobj++] = PD_PDO_TYPE_FIXED | PD_PDO_SNK_FIXED_VOLTAGE_SET(PD_PDO_SRC_FIXED_VOLTAGE_GET(cap->obj[i])) | PD_PDO_SNK_FIXED_CURRENT_SET(PD_PDO_SRC_FIXED_CURRENT_GET(cap->obj[i]));
// }
// /* If we have three PDOs at this point, make sure the last two are
// * sorted by voltage. */
// if (numobj == 3 && (cap->obj[1] & PD_PDO_SNK_FIXED_VOLTAGE) > (cap->obj[2] & PD_PDO_SNK_FIXED_VOLTAGE)) {
// cap->obj[1] ^= cap->obj[2];
// cap->obj[2] ^= cap->obj[1];
// cap->obj[1] ^= cap->obj[2];
// }
// /* If we're using PD 3.0, add a PPS APDO for our desired voltage */
// if ((hdr_template & PD_HDR_SPECREV) >= PD_SPECREV_3_0) {
// cap->obj[numobj++]
// = PD_PDO_TYPE_AUGMENTED | PD_APDO_TYPE_PPS | PD_APDO_PPS_MAX_VOLTAGE_SET(PD_MV2PAV(voltage)) | PD_APDO_PPS_MIN_VOLTAGE_SET(PD_MV2PAV(voltage)) |
// PD_APDO_PPS_CURRENT_SET(PD_CA2PAI(current));
// }
// }
// /* Set the unconstrained power flag. */
// if (_unconstrained_power) {
// cap->obj[0] |= PD_PDO_SNK_FIXED_UNCONSTRAINED;
// }
// /* Set the USB communications capable flag. */
// cap->obj[0] |= PD_PDO_SNK_FIXED_USB_COMMS;
// /* Set the Sink_Capabilities message header */
// cap->hdr = hdr_template | PD_MSGTYPE_SINK_CAPABILITIES | PD_NUMOBJ(numobj);
/* Set the Sink_Capabilities message header */
cap->hdr = PD_DATAROLE_UFP | PD_SPECREV_3_0 | PD_POWERROLE_SINK | PD_MSGTYPE_SINK_CAPABILITIES | PD_NUMOBJ(numobj);
}
#endif

View File

@@ -8,7 +8,7 @@
#include "BSP_Power.h"
#include "Settings.h"
#include "configuration.h"
#include <Utils.h>
#include <Utils.hpp>
int32_t Utils::InterpolateLookupTable(const int32_t *lookupTable, const int noItems, const int32_t value) {
for (int i = 1; i < (noItems - 1); i++) {

View File

@@ -1,12 +1,12 @@
/*
* Utils.h
* Utils.hpp
*
* Created on: 28 Apr 2021
* Author: Ralim
*/
#ifndef CORE_DRIVERS_UTILS_H_
#define CORE_DRIVERS_UTILS_H_
#ifndef CORE_DRIVERS_UTILS_HPP_
#define CORE_DRIVERS_UTILS_HPP_
#include <stdint.h>
class Utils {
public:
@@ -18,4 +18,4 @@ public:
};
#endif /* CORE_DRIVERS_UTILS_H_ */
#endif /* CORE_DRIVERS_UTILS_HPP_ */

View File

@@ -123,6 +123,7 @@ typedef enum {
* Some devices allow multiple types of tips to be fitted, this allows selecting them or overriding the logic
* The first type will be the default (gets value of 0)
*/
#ifdef TIP_TYPE_SUPPORT
typedef enum {
#ifdef AUTO_TIP_SELECTION
TIP_TYPE_AUTO, // If the hardware supports automatic detection
@@ -142,7 +143,15 @@ typedef enum {
// #endif
TIP_TYPE_MAX, // Max value marker
} tipType_t;
uint8_t getUserSelectedTipResistance(); // returns the resistance matching the selected tip type or 0 for auto
#else
typedef enum {
TIP_TYPE_AUTO = 0, // value for the default case
TIP_TYPE_MAX = 0, // marker for settings when not supported
} tipType_t;
#endif /* TIP_TYPE_SUPPORT */
// returns the resistance matching the selected tip type or 0 for auto and when not supported
uint8_t getUserSelectedTipResistance();
// Settings wide operations
void saveSettings();
@@ -162,5 +171,7 @@ void setSettingValue(const enum SettingsOptions option, const uint16_t newValue)
// Special access helpers, to reduce logic duplication
uint8_t lookupVoltageLevel();
uint16_t lookupHallEffectThreshold();
#ifdef TIP_TYPE_SUPPORT
const char *lookupTipName(); // Get the name string for the current soldering tip
#endif /* TIP_TYPE_SUPPORT */
#endif /* SETTINGS_H_ */

View File

@@ -7,4 +7,4 @@
typedef int32_t TemperatureType_t;
#endif
#endif

View File

@@ -93,7 +93,7 @@ static const SettingConstants settingsConstants[(int)SettingsOptions::SettingsOp
{ 0, 6, 1, 1}, // LOGOTime
{ 0, 1, 1, 0}, // CalibrateCJC
{ 0, 1, 1, 0}, // BluetoothLE
{ 0, 2, 1, 1}, // USBPDMode
{ 0, 2, 1, 0}, // USBPDMode
{ 1, 5, 1, 4}, // ProfilePhases
{ MIN_TEMP_C, MAX_TEMP_F, 5, 90}, // ProfilePreheatTemp
{ 1, 10, 1, 1}, // ProfilePreheatSpeed
@@ -298,16 +298,12 @@ uint8_t lookupVoltageLevel() {
}
}
#ifdef TIP_TYPE_SUPPORT
const char *lookupTipName() {
// Get the name string for the current soldering tip
tipType_t value = (tipType_t)getSettingValue(SettingsOptions::SolderingTipType);
switch (value) {
#ifdef AUTO_TIP_SELECTION
case tipType_t::TIP_TYPE_AUTO:
return translatedString(Tr->TipTypeAuto);
break;
#endif
#ifdef TIPTYPE_T12
case tipType_t::T12_8_OHM:
return translatedString(Tr->TipTypeT12Long);
@@ -319,7 +315,7 @@ const char *lookupTipName() {
return translatedString(Tr->TipTypeT12PTS);
break;
#endif
#ifdef TIPTYE_TS80
#ifdef TIPTYPE_TS80
case tipType_t::TS80_4_5_OHM:
return translatedString(Tr->TipTypeTS80);
break;
@@ -328,13 +324,19 @@ const char *lookupTipName() {
case tipType_t::JBC_210_2_5_OHM:
return translatedString(Tr->TipTypeJBCC210);
break;
#endif
#ifdef AUTO_TIP_SELECTION
case tipType_t::TIP_TYPE_AUTO:
#endif
default:
return nullptr;
return translatedString(Tr->TipTypeAuto);
break;
}
}
#endif /* TIP_TYPE_SUPPORT */
// Returns the resistance for the current tip selected by the user or 0 for auto
#ifdef TIP_TYPE_SUPPORT
uint8_t getUserSelectedTipResistance() {
tipType_t value = (tipType_t)getSettingValue(SettingsOptions::SolderingTipType);
@@ -370,3 +372,6 @@ uint8_t getUserSelectedTipResistance() {
break;
}
}
#else
uint8_t getUserSelectedTipResistance() { return tipType_t::TIP_TYPE_AUTO; }
#endif /* TIP_TYPE_SUPPORT */

View File

@@ -116,8 +116,10 @@ static bool showHallEffect(void);
#endif /* HALL_SENSOR */
// Tip type selection
#ifdef TIP_TYPE_SUPPORT
static void displaySolderingTipType(void);
static bool showSolderingTipType(void);
#endif /* TIP_TYPE_SUPPORT */
// Menu functions
@@ -267,12 +269,12 @@ const menuitem powerMenu[] = {
const menuitem solderingMenu[] = {
/*
* Tip Type
* Boost Mode Temp
* Auto Start
* Temp Change Short Step
* Temp Change Long Step
* Locking Mode
* Tip Type
* Profile Phases
* Profile Preheat Temperature
* Profile Preheat Max Temperature Change Per Second
@@ -288,8 +290,6 @@ const menuitem solderingMenu[] = {
* Profile Phase 5 Duration (s)
* Profile Cooldown Max Temperature Change Per Second
*/
/* Tip Type */
{SETTINGS_DESC(SettingsItemIndex::SolderingTipType), nullptr, displaySolderingTipType, showSolderingTipType, SettingsOptions::SolderingTipType, SettingsItemIndex::SolderingTipType, 5},
/* Boost Temp */
{SETTINGS_DESC(SettingsItemIndex::BoostTemperature), setBoostTemp, displayBoostTemp, nullptr, SettingsOptions::BoostTemp, SettingsItemIndex::BoostTemperature, 5},
/* Auto start */
@@ -300,6 +300,10 @@ const menuitem solderingMenu[] = {
{SETTINGS_DESC(SettingsItemIndex::TempChangeLongStep), nullptr, displayTempChangeLongStep, nullptr, SettingsOptions::TempChangeLongStep, SettingsItemIndex::TempChangeLongStep, 6},
/* Locking Mode */
{SETTINGS_DESC(SettingsItemIndex::LockingMode), nullptr, displayLockingMode, nullptr, SettingsOptions::LockingMode, SettingsItemIndex::LockingMode, 7},
#ifdef TIP_TYPE_SUPPORT
/* Tip Type */
{SETTINGS_DESC(SettingsItemIndex::SolderingTipType), nullptr, displaySolderingTipType, showSolderingTipType, SettingsOptions::SolderingTipType, SettingsItemIndex::SolderingTipType, 5},
#endif /* TIP_TYPE_SUPPORT */
#ifdef PROFILE_SUPPORT
/* Profile Phases */
{SETTINGS_DESC(SettingsItemIndex::ProfilePhases), nullptr, displayProfilePhases, nullptr, SettingsOptions::ProfilePhases, SettingsItemIndex::ProfilePhases, 7},
@@ -575,7 +579,6 @@ static void setBoostTemp(void) {
if (value >= MAX_TEMP_F) {
value = 0; // jump to off
}
setSettingValue(SettingsOptions::BoostTemp, value);
} else {
if (value == 0) {
value = MIN_BOOST_TEMP_C; // loop back at 250
@@ -650,14 +653,13 @@ static void setProfileTemp(const enum SettingsOptions option) {
if (temp > MAX_TEMP_F) {
temp = MIN_TEMP_F;
}
setSettingValue(option, temp);
} else {
temp += 5;
if (temp > MAX_TEMP_C) {
temp = MIN_TEMP_C;
}
setSettingValue(option, temp);
}
setSettingValue(option, temp);
}
static void setProfilePreheatTemp(void) { return setProfileTemp(SettingsOptions::ProfilePreheatTemp); }
@@ -708,14 +710,13 @@ static void setSleepTemp(void) {
if (temp > 580) {
temp = 60;
}
setSettingValue(SettingsOptions::SleepTemp, temp);
} else {
temp += 10;
if (temp > 300) {
temp = 10;
}
setSettingValue(SettingsOptions::SleepTemp, temp);
}
setSettingValue(SettingsOptions::SleepTemp, temp);
}
static void displaySleepTemp(void) { OLED::printNumber(getSettingValue(SettingsOptions::SleepTemp), 3, FontStyle::LARGE); }
@@ -755,20 +756,23 @@ static bool showHallEffect(void) { return getHallSensorFitted(); }
static void displayHallEffectSleepTime(void) {
if (getSettingValue(SettingsOptions::HallEffectSleepTime)) {
OLED::printNumber(getSettingValue(SettingsOptions::HallEffectSleepTime) * 5, 2, FontStyle::LARGE, false);
OLED::print(LargeSymbolSeconds, FontStyle::LARGE);
} else {
// When sleep time is set to zero, we sleep for 1 second anyways. This is the default.
OLED::printNumber(1, 2, FontStyle::LARGE, false);
OLED::print(LargeSymbolSeconds, FontStyle::LARGE);
}
OLED::print(LargeSymbolSeconds, FontStyle::LARGE);
}
#endif /* HALL_SENSOR */
#ifdef TIP_TYPE_SUPPORT
static void displaySolderingTipType(void) {
// TODO wrapping X value
OLED::print(lookupTipName(), FontStyle::SMALL, 255, OLED::getCursorX());
}
// If there is no detection, and no options, max is 0
static bool showSolderingTipType(void) { return tipType_t::TIP_TYPE_MAX != 0; }
#endif /* TIP_TYPE_SUPPORT */
static void setTempF(const enum SettingsOptions option) {
uint16_t Temp = getSettingValue(option);
if (getSettingValue(SettingsOptions::TemperatureInF)) {

View File

@@ -186,6 +186,7 @@ void guiRenderLoop(void) {
}
// Render done, draw it out
OLED::refresh();
osDelay(10);
}
OperatingMode handle_post_init_state() {

View File

@@ -22,12 +22,12 @@
#endif
#endif
static TickType_t powerPulseWaitUnit = 25 * TICKS_100MS; // 2.5 s
static TickType_t powerPulseDurationUnit = (5 * TICKS_100MS) / 2; // 250 ms
TaskHandle_t pidTaskNotification = NULL;
volatile TemperatureType_t currentTempTargetDegC = 0; // Current temperature target in C
int32_t powerSupplyWattageLimit = 0;
bool heaterThermalRunaway = false;
static TickType_t powerPulseWaitUnit = 25 * TICKS_100MS; // 2.5 s
static TickType_t powerPulseDurationUnit = (5 * TICKS_100MS) / 2; // 250 ms
TaskHandle_t pidTaskNotification = NULL;
volatile TemperatureType_t currentTempTargetDegC = 0; // Current temperature target in C
int32_t powerSupplyWattageLimit = 0;
uint8_t heaterThermalRunawayCounter = 0;
static int32_t getPIDResultX10Watts(TemperatureType_t set_point, TemperatureType_t current_value);
static void detectThermalRunaway(const TemperatureType_t currentTipTempInC, const uint32_t x10WattsOut);
@@ -71,7 +71,8 @@ void startPIDTask(void const *argument __unused) {
#endif
#endif
int32_t x10WattsOut = 0;
int32_t x10WattsOut = 0;
TickType_t lastThermalRunawayDecay = xTaskGetTickCount();
for (;;) {
x10WattsOut = 0;
@@ -105,6 +106,12 @@ void startPIDTask(void const *argument __unused) {
#ifdef DEBUG_UART_OUTPUT
log_system_state(x10WattsOut);
#endif
if (xTaskGetTickCount() - lastThermalRunawayDecay > TICKS_SECOND) {
lastThermalRunawayDecay = xTaskGetTickCount();
if (heaterThermalRunawayCounter > 0) {
heaterThermalRunawayCounter--;
}
}
}
}
@@ -249,8 +256,8 @@ void detectThermalRunaway(const TemperatureType_t currentTipTempInC, const uint3
static bool haveSeenDelta = false;
// Check for readings being pegged at the top of the ADC while the heater is off
if (!thisCycleIsHeating && (getTipRawTemp(0) > (0x7FFF - 16))) {
heaterThermalRunaway = true;
if (!thisCycleIsHeating && (getTipRawTemp(0) > (ADC_MAX_READING - 8)) && heaterThermalRunawayCounter < 255) {
heaterThermalRunawayCounter++;
}
if (haveSeenDelta) {
@@ -277,8 +284,8 @@ void detectThermalRunaway(const TemperatureType_t currentTipTempInC, const uint3
TemperatureType_t delta = tipTempMax - tiptempMin;
haveSeenDelta = true;
if (delta < THERMAL_RUNAWAY_TEMP_C) {
heaterThermalRunaway = true;
if (delta < THERMAL_RUNAWAY_TEMP_C && heaterThermalRunawayCounter < 255) {
heaterThermalRunawayCounter++;
}
}
}
@@ -322,7 +329,7 @@ void setOutputx10WattsViaFilters(int32_t x10WattsOut) {
if (getTipRawTemp(0) > (0x7FFF - 32)) {
x10WattsOut = 0;
}
if (heaterThermalRunaway) {
if (heaterThermalRunawayCounter > 8) {
x10WattsOut = 0;
}
#ifdef SLEW_LIMIT

View File

@@ -25,20 +25,20 @@ extern "C" {
#endif
enum class OperatingMode {
StartupLogo = 0, // Showing the startup logo
CJCCalibration, // Cold Junction Calibration
StartupWarnings, // Startup checks and warnings
InitialisationDone, // Special state we use just before we to home screen at first startup. Allows jumping to extra startup states
HomeScreen, // Home/Idle screen that is the main launchpad to other modes
Soldering, // Main soldering operating mode
SolderingProfile, // Soldering by following a profile, used for reflow for example
Sleeping, // Sleep state holds iron at lower sleep temp
Hibernating, // Like sleeping but keeps heater fully off until woken
SettingsMenu, // Settings Menu
DebugMenuReadout, // Debug metrics
TemperatureAdjust, // Set point temperature adjustment
UsbPDDebug, // USB PD debugging information
ThermalRunaway, // Thermal Runaway warning state.
StartupLogo=10, // Showing the startup logo
CJCCalibration=11, // Cold Junction Calibration
StartupWarnings=12, // Startup checks and warnings
InitialisationDone=13, // Special state we use just before we to home screen at first startup. Allows jumping to extra startup states
HomeScreen=0, // Home/Idle screen that is the main launchpad to other modes
Soldering=1, // Main soldering operating mode
SolderingProfile=6, // Soldering by following a profile, used for reflow for example
Sleeping=3, // Sleep state holds iron at lower sleep temp
Hibernating=14, // Like sleeping but keeps heater fully off until woken
SettingsMenu=4, // Settings Menu
DebugMenuReadout=5, // Debug metrics
TemperatureAdjust=7, // Set point temperature adjustment
UsbPDDebug=8, // USB PD debugging information
ThermalRunaway=9, // Thermal Runaway warning state.
};
enum class TransitionAnimation {
@@ -83,5 +83,5 @@ OperatingMode showWarnings(const ButtonState buttons, guiContext *cxt);
// Common helpers
int8_t getPowerSourceNumber(void); // Returns number ID of power source
extern bool heaterThermalRunaway;
extern uint8_t heaterThermalRunawayCounter;
#endif

View File

@@ -161,10 +161,10 @@ OperatingMode gui_solderingMode(const ButtonState buttons, guiContext *cxt) {
return OperatingMode::Sleeping;
}
if (heaterThermalRunaway) {
currentTempTargetDegC = 0; // heater control off
heaterThermalRunaway = false;
cxt->transitionMode = TransitionAnimation::Right;
if (heaterThermalRunawayCounter > 8) {
currentTempTargetDegC = 0; // heater control off
heaterThermalRunawayCounter = 0;
cxt->transitionMode = TransitionAnimation::Right;
return OperatingMode::ThermalRunaway;
}
return handleSolderingButtons(buttons, cxt);

View File

@@ -159,9 +159,9 @@ OperatingMode gui_solderingProfileMode(const ButtonState buttons, guiContext *cx
setBuzzer(false);
return OperatingMode::HomeScreen;
}
if (heaterThermalRunaway) {
currentTempTargetDegC = 0; // heater control off
heaterThermalRunaway = false;
if (heaterThermalRunawayCounter > 8) {
currentTempTargetDegC = 0; // heater control off
heaterThermalRunawayCounter = 0;
return OperatingMode::ThermalRunaway;
}

View File

@@ -9,7 +9,7 @@
#include "history.hpp"
#include "ui_drawing.hpp"
extern bool heaterThermalRunaway;
extern uint8_t heaterThermalRunawayCounter;
bool checkExitSoldering(void) {
#ifdef POW_DC

View File

@@ -287,7 +287,7 @@ DEV_GLOBAL_DEFS=-DCFG_FREERTOS \
# -DCONFIG_BT_SMP
# Required to be turned off due to their drivers tripping warnings
DEV_CFLAGS=-Wno-error=enum-conversion -Wno-type-limits -Wno-implicit-fallthrough
DEV_CFLAGS=-Wno-error=enum-conversion -Wno-type-limits -Wno-implicit-fallthrough -Wno-error=implicit-function-declaration -Wno-error=incompatible-pointer-types
DEV_CXXFLAGS=$(DEV_CFLAGS)
flash_size=128k
bootldr_size=0x0