1
0
forked from me/IronOS

Compare commits

...

43 Commits

Author SHA1 Message Date
Ben V. Brown
e3bad2adae Migrate all Miniware devices to use Bit-Bang I2C (#1838)
* MHP30 move to I2C Bit Banging

* Fixup Accelerometer drivers so all can use I2CBB

* No STM32 I2C driver anymore

* TS100 on I2CBB

* Miniware on BB

* Fixup S60 build

* format

format
2023-11-16 21:32:56 +11:00
Ben V. Brown
c308fe8cc2 Pinecil v2 tune via PID (#1827)
* Start PWM after adc irq fully done

* Filter len 4

* Use comparitor 2 on timer for wrap around

* Update IRQ.cpp

* Tip measurements are uint16_t

Update BSP.cpp

Update BSP.cpp

* WiP PID

move pid tuning to config

Update PIDThread.cpp

* Handle PWM Timer gitchy comparitor

* Tuning

* Dampen with Kd

* Cleaning up

* Use TemperatureType_t for getTipTemp()

* Add small rolling average to user GUI temp to reduce flicker

* Trigger PID when adc is skipped (will use old values)
2023-10-21 08:21:08 +11:00
Marek Kraus
9c7ad43a76 Merge pull request #1822 from OndroNR/patch-4
Update Slovak translation
2023-09-28 21:58:58 +02:00
Ondrej Galbavy
8c582e6cb0 Update translation_SK.json 2023-09-28 20:08:55 +02:00
Ondrej Galbavy
4a8f483d30 Update translation_SK.json 2023-09-28 20:03:55 +02:00
discip
b489601883 Merge pull request #1818 from dogtopus/add-missing-chinese-translation
Add missing Chinese translation
2023-09-22 21:37:09 +02:00
dogtopus
e56060ab4a Add missing Chinese translation
I'm not very good at zh_TW so some of the terms might sound strange.
2023-09-22 00:47:46 -03:00
Ben V. Brown
c0a5e244b9 Temperature code updates (#1814)
* Create a typedef for temperatures

* Quick parse replace temp types

* Fixup for fast/slow PWM on PinecilV2

* Update PIDThread.cpp

* Pinecil small tips need less smoothing

* Remove incorrect comment

* Remove unused function

* Update PinecilV2 Tune as well
2023-09-22 10:19:50 +10:00
discip
f99aed5785 Merge pull request #1786 from Ralim/discip-patch-2
Update translation_DE.json
2023-09-06 00:41:07 +02:00
discip
64ccbd4334 Merge branch 'dev' into discip-patch-2 2023-09-05 21:37:49 +02:00
dependabot[bot]
0a5b84fea9 chore(deps): bump actions/checkout from 3 to 4 (#1811)
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-05 08:32:55 +10:00
discip
c2229f096b Merge branch 'dev' into discip-patch-2 2023-08-21 21:01:58 +02:00
Ivan Zorin
53bb8355f8 docs/History.md: add info for 2.20 & 2.21 (#1804)
docs/changelog: update info for 2.20 & 2.21
2023-08-20 09:55:38 +10:00
discip
95160b7afd Merge branch 'dev' into discip-patch-2 2023-08-16 02:12:05 +02:00
Ivan Zorin
5754622fea Include History.md to online docs as Changelog (#1799)
docs/changelog: include History.md to read-the-docs site generating as Changelog, update titles formatting & unify style between sections
2023-08-16 10:06:55 +10:00
discip
2b0bd00603 Merge branch 'dev' into discip-patch-2 2023-08-15 01:02:31 +02:00
Ivan Zorin
20e085487e Add python packages required by mkdocs into docker container (#1796)
Add PIP python packages required by mkdocs into docker container
2023-08-14 11:13:34 +10:00
Ivan Zorin
4cb47cf1a2 Add detailed OLED replacement info to Troubleshooting document (#1797)
* Add OLED replacement info to HardwareIssues document

* Update formatting & text

* Move OLED replacement detailed info from HardwareIssues to Troubleshooting inside the related section
2023-08-14 11:12:52 +10:00
Ivan Zorin
33439aaa22 Include Bluetooth document to read-the-docs site generating (#1798) 2023-08-14 11:11:54 +10:00
Marek Kraus
6111b58e04 Merge pull request #1795 from gamelaster/patch/update-sk-lang
Update Slovak translation
2023-08-13 04:31:57 +02:00
Marek Kraus
d6286b9e2b Update translation_SK.json 2023-08-12 18:30:23 +02:00
Ben V. Brown
f69c37c4aa Revert "Remove 0.5 ohm increase to resistance" (#1794) 2023-08-12 15:31:02 +10:00
discip
230e42b614 Merge branch 'dev' into discip-patch-2 2023-08-12 01:30:24 +02:00
discip
caedce0300 Merge pull request #1793 from ia/translation_RU
Update & translate for Russian language
2023-08-12 01:29:05 +02:00
Ivan Zorin
748ab1c354 Merge branch 'translation_RU' of ssh.github.com:ia/IronOS-plus into translation_RU 2023-08-12 02:22:58 +03:00
Ivan Zorin
33a2958203 translation_RU: fix ResetOKMessage 2023-08-12 02:22:14 +03:00
discip
8430a114fa Merge branch 'dev' into translation_RU 2023-08-11 22:17:32 +02:00
discip
9cc0a56057 Merge pull request #1792 from ia/translation_BG
Update & translate for Bulgarian language
2023-08-11 22:17:17 +02:00
Ivan Zorin
db3d8a2de0 Update & translate for Russian language 2023-08-11 23:07:41 +03:00
Ivan Zorin
4460782dd4 Update & translate for Bulgarian language 2023-08-11 23:06:00 +03:00
discip
d1e03c34be Merge branch 'dev' into discip-patch-2 2023-08-11 21:54:42 +02:00
discip
b493f4d0e1 Merge pull request #1791 from davidrothb/cz_complete
Update translation_CS.json
2023-08-11 21:47:04 +02:00
discip
fb48ff8b91 Merge branch 'dev' into discip-patch-2 2023-08-11 21:46:10 +02:00
David Rothbauer
3f8f60f4c7 Update translation_CS.json
completed czech translation
2023-08-11 11:38:23 +02:00
Ivan Zorin
130e73c1fe Make make docker-clean to remove docker build cache (#1790)
Makefile: add docker-clean sub-targets to remove not only image but cache (eats lot of space sometimes) & update help output / add clean-up of docker cache to deploy.sh as well

Co-authored-by: Ben V. Brown <5425387+Ralim@users.noreply.github.com>
2023-08-09 05:38:45 +00:00
discip
26197f6ed7 Merge branch 'dev' into discip-patch-2 2023-08-09 01:42:35 +02:00
Ivan Zorin
d5035bb956 Update build.sh to pass shellcheck checks (#1789)
source/build.sh: update according to shellcheck recommendations
2023-08-09 08:47:25 +10:00
Ben V. Brown
c0f1c35ba5 Update logo flashing information (#1787)
* Update logo information

* Update Documentation/Logo.md

---------

Co-authored-by: discip <53649486+discip@users.noreply.github.com>
2023-08-08 09:45:54 +10:00
discip
477fdc489c Update translation_DE.json 2023-08-07 21:38:10 +02:00
Federico Di Lorenzo
4f2fb2083d Update translation_IT.json (#1784) 2023-08-07 21:17:59 +10:00
Ivan Zorin
15ab87f3bc Update tagging for detached commit case & update docs (#1783)
make_translation.py: update tagging for detached commit case & update docs
2023-08-07 09:05:56 +10:00
Ivan Zorin
8b90666f30 metadata.py: update tagging considering github CI builds (#1782) 2023-08-07 09:05:04 +10:00
TheMoo96
c03e1842aa Swedish translation update to include new strings (#1779)
* update swedish translation

* Add linebreak char
2023-08-05 10:29:44 +00:00
100 changed files with 1100 additions and 8776 deletions

View File

@@ -23,7 +23,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
with: with:
fetch-depth: 0 fetch-depth: 0
- uses: actions/setup-python@v4 - uses: actions/setup-python@v4

View File

@@ -21,7 +21,7 @@ jobs:
- name: Install dependencies (python) - name: Install dependencies (python)
run: python3 -m pip install bdflib run: python3 -m pip install bdflib
- uses: actions/checkout@v3 - uses: actions/checkout@v4
with: with:
submodules: true submodules: true
@@ -74,7 +74,7 @@ jobs:
- name: Install dependencies (python) - name: Install dependencies (python)
run: python3 -m pip install bdflib run: python3 -m pip install bdflib
- uses: actions/checkout@v3 - uses: actions/checkout@v4
with: with:
submodules: true submodules: true
@@ -121,7 +121,7 @@ jobs:
- name: Install dependencies (apk) - name: Install dependencies (apk)
run: apk add --no-cache python3 py3-pip make git bash findutils gcc musl-dev run: apk add --no-cache python3 py3-pip make git bash findutils gcc musl-dev
- uses: actions/checkout@v3 - uses: actions/checkout@v4
with: with:
submodules: true submodules: true
@@ -144,7 +144,7 @@ jobs:
- name: Install dependencies (apk) - name: Install dependencies (apk)
run: apk add --no-cache make git diffutils findutils clang-extra-tools bash run: apk add --no-cache make git diffutils findutils clang-extra-tools bash
- uses: actions/checkout@v3 - uses: actions/checkout@v4
with: with:
submodules: true submodules: true
@@ -161,7 +161,7 @@ jobs:
- name: Install dependencies (apk) - name: Install dependencies (apk)
run: apk add --no-cache python3 py3-pip make git black run: apk add --no-cache python3 py3-pip make git black
- uses: actions/checkout@v3 - uses: actions/checkout@v4
with: with:
submodules: true submodules: true
@@ -179,7 +179,7 @@ jobs:
name: check_shell name: check_shell
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- name: shellcheck - name: shellcheck
uses: reviewdog/action-shellcheck@v1 uses: reviewdog/action-shellcheck@v1
with: with:
@@ -198,7 +198,7 @@ jobs:
- name: Install dependencies (apk) - name: Install dependencies (apk)
run: apk add --no-cache git run: apk add --no-cache git
- uses: actions/checkout@v3 - uses: actions/checkout@v4
with: with:
submodules: true submodules: true

View File

@@ -22,6 +22,7 @@ There is a static line on top which is presented on every sub-screen and reflect
- T - git-related release **t**ag but version is not vXX.YY ! - T - git-related release **t**ag but version is not vXX.YY !
- D - git-related **d**ev branch - D - git-related **d**ev branch
- B - git-related custom **b**ranch - B - git-related custom **b**ranch
- E - git-related from d**e**tached commit
- G - neither above but **g**it-related - G - neither above but **g**it-related
- C - build from github **C**I during _pull request_ - C - build from github **C**I during _pull request_
- H - build outside of a git tree (i.e. release tarball or **h**omebrew customization without git) - H - build outside of a git tree (i.e. release tarball or **h**omebrew customization without git)

View File

@@ -1,6 +1,36 @@
# Version Changes # Version Changes
## V2.19
# V2.21
### Features & changes
- Bluetooth Low Energy support for PinecilV2
- Large cleanup of translation files; and refactor of how we handle fonts for translations
- Fixes for I2C corruption on PinecilV2
- Option for using adjustable profiles on USB-PD or not
- Cleanups and improvements to the generated [documents website](https://ralim.github.io/IronOS)
### PinecilV2 notes
For Pinecil V2 users blisp is currently my recommended CLI tool for updating the device. It is built for all main OS's automatically. This does not apply to V1 devices. If your iron came with a blue grip, its a V1 and update the same as always. If your device came with a green silicone grip its a V2 device.
Alternatively you can use Spagett1's PineFlash tool that should provide a GUI interface for PinecilV1 & PinecilV2.
For a small number of V2 Pinecil devices there appears to be an interference issue between the Bluetooth Low Energy and some devices; more information here. If this occurs to you, please let us know in the issue and rollback to 2.20 for now.
# V2.20
- First "full" release for PinecilV2
- Loots of documentation updates
- Documentation is [now nicely readable as a site](https://ralim.github.io/IronOS/GettingStarted)
- A fair collection of bugfixes for PinecilV2
- Cold Junction Calibration was reworked and now occurs _at next boot_ to make it easier to perform when the device is cold
# V2.19
- Bug-fix Infinite Boot Logo - Bug-fix Infinite Boot Logo
- Shutdown settings for MHP30 - Shutdown settings for MHP30
- Accelerometer sensitivity for MHP30 - Accelerometer sensitivity for MHP30
@@ -9,7 +39,9 @@
- Updated translations - Updated translations
- Improved documents, added features table - Improved documents, added features table
## V2.18
# V2.18
- Support for animated bootup logo's - Support for animated bootup logo's
- Bootup logo's moved to their own IronOS-Meta repo - Bootup logo's moved to their own IronOS-Meta repo
- New Vietnamese translation (limited due to screen size) - New Vietnamese translation (limited due to screen size)
@@ -17,8 +49,11 @@
- Updated translations - Updated translations
- Better Instructions/documents - Better Instructions/documents
## V2.17
### Big changes # V2.17
### Features & changes
- Indicate status of VBus for modding Pinecil (debug menu) - Indicate status of VBus for modding Pinecil (debug menu)
- Better hall effect sensor sensitivity adjustment (larger range with more steps) - Better hall effect sensor sensitivity adjustment (larger range with more steps)
- Temperature increment will "round" to nearest multiple of increase amount - Temperature increment will "round" to nearest multiple of increase amount
@@ -32,7 +67,9 @@
- Fixed automatic orientation for newer TS80P's with the SC7 accelerometer - Fixed automatic orientation for newer TS80P's with the SC7 accelerometer
- User interface slight changes - User interface slight changes
- New `metadata.zip` file to allow the Pine Updater to automatically fetch information on releases - New `metadata.zip` file to allow the Pine Updater to automatically fetch information on releases
### Notes ### Notes
- VBus mod detection may not play well with all PPS chargers. If your iron reboots when you view this in the debug menu its not a fault. ([#1226](https://github.com/Ralim/IronOS/issues/1226)) - VBus mod detection may not play well with all PPS chargers. If your iron reboots when you view this in the debug menu its not a fault. ([#1226](https://github.com/Ralim/IronOS/issues/1226))
- `metadata.zip` is only designed for use by automatic software, ignore it for normal use - `metadata.zip` is only designed for use by automatic software, ignore it for normal use
- More details on Pinecil VBus mod coming via other channels. - More details on Pinecil VBus mod coming via other channels.
@@ -41,39 +78,38 @@
- -> Release has been updated to build `e065be3` after one bug with the BMA223 was found. - -> Release has been updated to build `e065be3` after one bug with the BMA223 was found.
## V2.16 # V2.16
* Overhaul of the Timer+ADC setup with help from @sandmanRO - Overhaul of the Timer+ADC setup with help from @sandmanRO
* Overhaul of the PID with help from @sandmanRO - Overhaul of the PID with help from @sandmanRO
* Settings _should_ now upgrade in place to future versions, with resets only happening to new/changed settings - Settings _should_ now upgrade in place to future versions, with resets only happening to new/changed settings
* Shows error if tip runaway (failed temperature sensor) is detected - Shows error if tip runaway (failed temperature sensor) is detected
* USB-PD now has a timeout, to allow forcing QC3 negotiation to start faster - USB-PD now has a timeout, to allow forcing QC3 negotiation to start faster
* QC3 Voltages are now adjustable to user desired setpoint - QC3 Voltages are now adjustable to user desired setpoint
* Added a small tolerance to allow "overvoltage" on QC3 above unit specifications. - Added a small tolerance to allow "overvoltage" on QC3 above unit specifications.
* * Please note: Doing this is entirely at your own risk! - Please note: Doing this is entirely at your own risk!
* New Advanced view that is much nicer to use and a very good daily driver option from @Mel-kior - New Advanced view that is much nicer to use and a very good daily driver option from @Mel-kior
* OLED brightness and contrast thanks to @alvinhochun - OLED brightness and contrast thanks to @alvinhochun
* Scrollbar is fixed so it doesnt jump around when menus are shown/hidden - Scrollbar is fixed so it doesnt jump around when menus are shown/hidden
* Moved to `.dfu` files from `.bin` to make flashing commands easier - Moved to `.dfu` files from `.bin` to make flashing commands easier
* Every language had translation updates I believe - Every language had translation updates I believe
* Romanian language added - Romanian language added
## V2.15 # V2.15
### Features & changes
## Feature upgrades: - MHP30 support
- Multi-lingual firmware combinations now exist for Pinecil
- More fine grained voltage controlled options
- USB-PD improvements (version one and two)
- More configuration options for power pulse
- All font / character encoding has been very reworked
- More translation updates than one can count
- More languages 😱
* MHP30 support ### MHP30 support
* Multi-lingual firmware combinations now exist for Pinecil
* More fine grained voltage controlled options
* USB-PD improvements (version one and two)
* More configuration options for power pulse
* All font / character encoding has been very reworked
* More translation updates than one can count
* More languages 😱
### MHP30
The MHP30 is a small reflow station from Miniware. The MHP30 is a small reflow station from Miniware.
Thanks to a massive amount of help from @g3gg0 this firmware brings the beginnings of support for this unit. Thanks to a massive amount of help from @g3gg0 this firmware brings the beginnings of support for this unit.
@@ -84,7 +120,8 @@ Programs the same as any one Miniware unit using drag and drop.
The flood doors are now open for feature requests for this unit :) The flood doors are now open for feature requests for this unit :)
## V2.14
# V2.14
- Fixing auto rotation bug in the LIS accelerometer in the TS80/TS80P - Fixing auto rotation bug in the LIS accelerometer in the TS80/TS80P
- Adds support for two new accelerometers - Adds support for two new accelerometers
@@ -101,7 +138,8 @@ The flood doors are now open for feature requests for this unit :)
- Cleanup the folder name of the source code #800 - Cleanup the folder name of the source code #800
- clang-format spec setup #801 - clang-format spec setup #801
## V2.13
# V2.13
- First _official_ Pinecil release - First _official_ Pinecil release
- All of the wire for Pinecil releases added - All of the wire for Pinecil releases added
@@ -118,7 +156,8 @@ The flood doors are now open for feature requests for this unit :)
- Fixed bug with accelerometer model on Pinecil - Fixed bug with accelerometer model on Pinecil
- Rework of all of the temperature curves for better accuracy - Rework of all of the temperature curves for better accuracy
## V2.12
# V2.12
- Only released as pre-release - Only released as pre-release
- [TS80P] Improvements to the PD negotiation to handle a few more adapters cleanly - [TS80P] Improvements to the PD negotiation to handle a few more adapters cleanly
@@ -126,36 +165,42 @@ The flood doors are now open for feature requests for this unit :)
- Clean up the menu (removed both enables and settings, so that you can turn things off easier) - Clean up the menu (removed both enables and settings, so that you can turn things off easier)
- Removing the very old single line menu style. - Removing the very old single line menu style.
## V2.11
# V2.11
- First TS80P support - First TS80P support
- Added in a USB-PD driver stack for the FUSB302 - Added in a USB-PD driver stack for the FUSB302
- Fixed some graphical glitches - Fixed some graphical glitches
## V2.10
# V2.10
- GUI polish (animations and scroll bars) - GUI polish (animations and scroll bars)
- Power pulse to keep power supplies alive - Power pulse to keep power supplies alive
- Adjustable tip response gain - Adjustable tip response gain
## V2.09
# V2.09
- Adjustable steps in temperature adjustment - Adjustable steps in temperature adjustment
- Git hash now in build string - Git hash now in build string
- Adjustable language to set if US units are available or not - Adjustable language to set if US units are available or not
- Some minor QC3 improvements - Some minor QC3 improvements
## V2.08
# V2.08
- Fixes auto start in sleep mode - Fixes auto start in sleep mode
- Power limiters - Power limiters
## V2.07
# V2.07
- QC fixes - QC fixes
- Cosmetic fixes for leading 0's - Cosmetic fixes for leading 0's
## V2.06
# V2.06
- Warning on settings reset - Warning on settings reset
- Temp temp re-write - Temp temp re-write
@@ -163,27 +208,33 @@ The flood doors are now open for feature requests for this unit :)
- Hide some leading 0's - Hide some leading 0's
- Menu timeouts - Menu timeouts
## V2.05
# V2.05
- Language updates - Language updates
## V2.04
# V2.04
- GUI updates - GUI updates
## V2.03
# V2.03
- Support for new accelerometers - Support for new accelerometers
## V2.02
# V2.02
- Adds small font - Adds small font
## V2.01
# V2.01
- Newer settings menu - Newer settings menu
## V2.00
# V2.00
- Complete re-write of the low layer system to use the STM32 HAL for easier development - Complete re-write of the low layer system to use the STM32 HAL for easier development
- This allowed easier setup for the new ADC auto measuring system - This allowed easier setup for the new ADC auto measuring system
@@ -193,80 +244,96 @@ The flood doors are now open for feature requests for this unit :)
- Added detailed screen views - Added detailed screen views
- Added smaller font for said screen views - Added smaller font for said screen views
## V1.17
# V1.17
- Added blinking cooldown display - Added blinking cooldown display
- Allowed smaller sleep timeout values - Allowed smaller sleep timeout values
- New font! - New font!
- Automatic startup option - Automatic startup option
## V1.16
# V1.16
- Added automatic rotation support - Added automatic rotation support
- Added power display graph - Added power display graph
## V1.15
# V1.15
- Added support for a custom bootup logo to be programmed via the DFU bootloader - Added support for a custom bootup logo to be programmed via the DFU bootloader
## V1.14
# V1.14
- Changed input voltage cutoff to be based on cell count rather than voltage - Changed input voltage cutoff to be based on cell count rather than voltage
## V1.13
# V1.13
- Swapped buttons for menu to prevent accidentally changing first menu item - Swapped buttons for menu to prevent accidentally changing first menu item
- Added auto key repeat - Added auto key repeat
## V1.12
# V1.12
- Increases sensitivity options to be 1\*9 with 0 off state - Increases sensitivity options to be 1\*9 with 0 off state
- Fixes issue where going from COOL \*> soldering can leave screen off - Fixes issue where going from COOL \*> soldering can leave screen off
## V1.11
# V1.11
- Boost mode - Boost mode
- Change sensitivity options to be 1\*8 - Change sensitivity options to be 1\*8
## V1.10
# V1.10
- Adds help text to settings - Adds help text to settings
- Improves settings for the display update rate - Improves settings for the display update rate
## V1.09
# V1.09
- Adds display modes, for slowing down or simplifying the display - Adds display modes, for slowing down or simplifying the display
## V1.08
# V1.08
- Fix settings menu not showing flip display - Fix settings menu not showing flip display
## V1.07
# V1.07
- Adds shutdown time to automatically shutdown the iron after inactivity - Adds shutdown time to automatically shutdown the iron after inactivity
## V1.06
# V1.06
- Changes H and C when the iron is heating to the minidso chevron like images - Changes H and C when the iron is heating to the minidso chevron like images
## V1.05
# V1.05
- Adds ability to calibrate the input voltage measurement - Adds ability to calibrate the input voltage measurement
## V1.04
# V1.04
- Increased accuracy of the temperature control - Increased accuracy of the temperature control
- Improved PID response slightly - Improved PID response slightly
- Allows temperature offset calibration - Allows temperature offset calibration
- Nicer idle screen - Nicer idle screen
## V1.03
# V1.03
- Improved Button handling - Improved Button handling
- Ability to set motion sensitivity - Ability to set motion sensitivity
- DC voltmeter page shows input voltage - DC voltmeter page shows input voltage
## V1.02
# V1.02
- Adds hold both buttons on IDLE to access the therometer mode - Adds hold both buttons on IDLE to access the therometer mode
- Changes the exit soldering mode to be holding both buttons (Like original firmware) - Changes the exit soldering mode to be holding both buttons (Like original firmware)

View File

@@ -1,56 +1,79 @@
# Startup Logos # Startup Logo / Animation
This firmware supports a user created bootup logo. When the device starts, you can have it optionally show either a static image or an animation. You can also set if these should stay on the screen or dismiss after some amount of time.
By default, there is _not_ one included in the firmware. This means that once flashed they generally stay. If you want no logo again, you would have to flash a blank image to the bootup logo. These can be an elegant way to personalise your device or just mark it as your one at a meetup where there may be multiple.
All devices supported by IronOS support this logo, and follow a similar process for setting one up. Please read the below general information as well as any model specific notes.
Bootup logos are stored at the end of the flash storage in the Iron; next to the user settings. By locating them at the end of storage they are not erased during the normal firmware upgrade process. Once a logo is set it should stay (unless we need to change things in the main firmware); so to erase your logo you will also find that we generate an erase file. Alternatively your method of flashing _may_ support doing a full erase flash which will also work for this.
## Generating the Logo files ## Generating the Logo files
There are community logo's already converted and ready to use in [IronOS-Meta/releases](https://github.com/Ralim/IronOS-Meta/releases). Because logos are stored at a fixed location in the device's internal flash; we can use the same method to flash these as you would normal firmware.
This does also mean that we need to convert the image/animation file into the format that IronOS understands.
IronOS uses a pre-processed file format to dramatically reduce the amount of space required to store the image; allowing for animations and saving space.
In the [IronOS-Meta](https://github.com/Ralim/IronOS-Meta) repository is a `python` script to convert images into this pre-processed file format.
Additionally, memebers of the community have contributed back their logo images as well. We provide these pre-converted for all models and ready to use in [IronOS-Meta/releases](https://github.com/Ralim/IronOS-Meta/releases).
Download the zip for Pinecil or Miniware and then install using the instructions in the Flashing section below. Download the zip for Pinecil or Miniware and then install using the instructions in the Flashing section below.
If you want to make custom art then it needs to be converted with a Python script. The script and other needed files are in [IronOS-Meta](https://github.com/Ralim/IronOS-Meta/). Go to that folder, then it is easiest to select the green Code button (upper right), then Download Zip. This way you get all the files you need and some extras. You only need what is inside Boot Logos. Put your custom image inside the Boot Logos folder with all python script files already there. If you want to make custom art then it needs to be converted with the Python script.
You can checkout the repository or use the download-as-zip button in the Github web interface to download the code.
The Python script converts an image passed into it on the command line into both a `.hex` file and a `.dfu` to be uploaded to the iron in DFU mode. The image can be in color and any size, but it will be resized and converted to 1-bit color. However, it looks best if you create a 96x16 image (Png or Bmp) in any image editor and color the pixels black & white manually. Inside the download code is a `Boot Logos` folder, inside here is the python script required for logo conversion.
It is easiest if you copy your logo file to be converted into this folder too, in order to keep commands shorter.
The converter requires at least Python3 and Pillow apps. Follow online instructions for installing Python and Pillow. The image can be in color and any size, but it will be resized and converted to 1-bit color. However, it looks best if you create a 96x16 image (`png` or `bmp`) in any image editor and color the pixels black & white manually. The thresholding used for converting colour to B&W may not always work as well as one would hope.
For Windows, it is recommended to use Windows PowerShell instead of Command. The converter requires at least Python3 and Pillow apps. Follow online instructions for installing Python and Pillow on your machine. Any reasonably recent version should work well.
Open Powershell (run as administrator), type python to install it, it will open microsoft store where you can install it free.
Go back to Powershell and install Pillow. What works can vary, but this command may work:
python -m pip install Pillow When running the script on the Windows operating system; it is recommended to use `Powershell` rather than the old `Command Prompt`.
or
python3 -m pip install pillow
If the above does not work, see [this page](https://stackoverflow.com/a/20061019/6705343) on StackOverflow about installing Pillow. For installing pillow; you can install it via your package manager (Debian and similar distros) or via pip. To install via pip the command should be `python -m pip install pillow`.
Now that Python and Pillow are successfuly installed, you can convert an image.
Go back to Powershell and type this command (change infile.png to the name of your image): In your shell you can now execute `python img2logo.py input.png out -m ${model}` to convert the file `input.png` and create output files in the folder `out`.
The model should be replaced by one of the following options:
- `python img2logo.py infile.png out -m` for Miniware - `miniware` for older Miniware Irons -> TS100, TS80, TS80P
- `python img2logo.py infile.png out -p` for Pinecil - `pinecilv1` for the Pinecil V1
- `pinecilv2` for the Pinecil V2
- `ts101` for the Miniware TS101 [^1]
- `s60` for the Squire S60 [^1]
- `mhp30` for the Miniware MHP30
Run `python img2logo.py --help` to see available options. Replace the word python with python3 if you have multiple versions of python installed. Different models are used for different flash locations for the image storage.
This means that files are **not** interchangeable between devices. If you are flashing multiple devices you will need to create a different file for different models.
After processing its expected to have a `.hex` and `.dfu` file created to be used. Which one to use will depend on your device.
Note: make sure your image file is in the same folder as script files (img2logo.py, output_dfu.py, output_hex.py). Note: make sure your image file is in the same folder as script files (img2logo.py, output_dfu.py, output_hex.py).
[^1] Note that these devices have larger resolution screens that the logo system supports right now. Fixes are coming for this soon, roughly scheduled for 2.23.
## Flashing the Logo ## Flashing the Logo
### Miniware (TS100/TS80/TS80P) ### Upload via virtual disk (TS100,TS101,TS80,TS80P,S60,MHP30)
Upload the HEX file to the iron in DFU mode and, if the file's extension changes to .RDY, your custom splash screen should show up on startup. If you normally update your firmware by having your device show up as a flash drive this is the method for you.
You perform this the same way as if you were flashing a new firmware, and all the existing notes around this apply. This applies to all Miniware + S60 devices running the stock DFU bootloader.
If you have flashed the `IronOS-dfu` alternative bootloader, you should use the `.dfu` files instead Place your device into update mode (usually by holding the B button when connecting your device to your pc via USB).
Upload the `.hex` file you created earlier as if it was a firmware update. Do any normal tricks required for firmware flashing if any are required.
Afterwards the firmware should indicate that it has worked (often by creating a `.rdy` file).
### Pinecil V1 At this point unplug your iron and re-connect it to power to start normally and the logo should welcome you.
For Pinecil V1, we require using dfu-util to flash the logo art (Pinecil does not use hex). ### Upload via GUI flash tool (PinecilV1/V2)
[Pine64 Updater](https://github.com/pine64/pine64_updater/releases) is the easiest way to load the Bootup logo onto Pinecil as it already includes the necessary DFU library. Connect Pinecil to a PC, and open the Updater the same as updating firmware.
Select Custom > Browse to the DFU image file you just made > Update to install.
The bootup logo is stored in a separate location than the IronOS firmware and you do not have to worry about it changing or breaking the IronOS. If you normally upload your firmware using a helper application, they should accept the files from the bootlogo the same as the normal firmware.
Try the `.dfu` file first and then the `.hex`. If neither work then the application may not be updated to be able to handle boot logos. And you may need to use a different/newer tool.
You could also use dfu-util and use Command line to install it. ### Upload via dfu-util (PinecilV1/IronOS-DFU)
- `dfu-util -D logo_file.dfu` For the PinecilV1 and for any devices that have been converted to use `IronOS-DFU` as the bootloader you can flash these via the `dfu-util` command line tool.
For these flash as per usual using the `.dfu` file. Afterwards power cycle and the logo should show up.
### Upload via blisp (PinecilV2)
For the PinecilV2 we suggest `blisp` as the command line tool to use if you are not using a GUI tool. `blsip` has been updated to accept `.dfu` files as well as the `.bin` files it historically used. As such you use the `.dfu` file for the logo and flash as per normal otherwise and it will work and reboot at the end. It should show you your new logo after flashing.

View File

@@ -22,9 +22,11 @@
- [Startup Logo](../Documentation/Logo.md) - [Startup Logo](../Documentation/Logo.md)
- Hardware - Hardware
- [Hall Sensor (Pinecil)](../Documentation/HallSensor.md) - [Hall Sensor (Pinecil)](../Documentation/HallSensor.md)
- [Bluetooth (Pinecil V2)](../Documentation/Bluetooth.md)
- [Hardware Notes](../Documentation/Hardware.md) - [Hardware Notes](../Documentation/Hardware.md)
- [Troubleshooting](../Documentation/Troubleshooting.md) - [Troubleshooting](../Documentation/Troubleshooting.md)
- [Known Hardware Issues](../Documentation/HardwareIssues.md) - [Known Hardware Issues](../Documentation/HardwareIssues.md)
- [Power sources](../Documentation/PowerSources.md) - [Power sources](../Documentation/PowerSources.md)
- [Translations](../Documentation/Translation.md) - [Translations](../Documentation/Translation.md)
- [Development](../Documentation/Development.md) - [Development](../Documentation/Development.md)
- [Changelog](../Documentation/History.md)

View File

@@ -75,10 +75,23 @@ If the tip does not heat up, it is worth trying to reflash the firmware first in
The main failure mode of the OLED display module is usually poor soldering on the OLED display cable to the main PCB. The main failure mode of the OLED display module is usually poor soldering on the OLED display cable to the main PCB.
As this is soldered by hand generally, it's the most prone to failures. As this is soldered by hand generally, it's the most prone to failures.
If you have a poor connection or a floating pin, you can end up with a state where the screen works _sometimes_ and then freezes or only works on some power cycles. It might work on very old versions of IronOS but not the newest ones. You could try to reflow the pins for the OLED. On 96x16 screens, carefully peel it back from the adhesive and reflow the solder on the pins. If needed, replacement Oled screens are common and low cost. If you have a poor connection or a floating pin, you can end up with a state where the screen works _sometimes_ and then freezes or only works on some power cycles. It might work on very old versions of IronOS but not the newest ones. You could try to reflow the pins for the OLED. On 96x16 screens, carefully peel it back from the adhesive and reflow the solder on the pins.
As the OLED runs on an I2C bus, there are pull up resistors on the SDA and SCL pins. It is worth checking these as well, while they don't often fail, issues with these can cause _weird_ display issues. As the OLED runs on an I2C bus, there are pull up resistors on the SDA and SCL pins. It is worth checking these as well, while they don't often fail, issues with these can cause _weird_ display issues.
If after all of the checks OLED is still blank, or screen works but pixels are barely visible, although soldering iron itself is working (i.e., you can safely check that it's turning on, heating up & melting solder successfully), then it means that _most likely_ OLED is dead. But it can be relatively easily replaced. Models like `TS100`, `TS80`, and `TS80P` share the same OLED screen which can be bought online and used for replacement. To do so:
- find & buy at electronics shop [of your choice] display with the following spec line:
```OLED 0.69 inch / 14 pins / 96 x 16 pixels / **9616TSWC** / I2C IIC```
- disassemble your soldering iron;
- desolder old OLED and solder back new one;
- assemble your soldering iron back.
There are a few youtube videos how to do it like [this one for `TS100`](https://www.youtube.com/watch?v=HlWAY0oYPFI).
Unfortunately, this is a well-known issue of screens with OLED technology: sooner or later the brightness is starting to _"fade out"_ until complete off. Usually common recommendations to prolong its lifetime are: reduce brightness & reduce too often updates (i.e., disable animations). But your results may vary since there were reports when users couldn't see anything after turning on soldering irons which were just laying in a box for a few months after buying. And there are users with first `TS100` models not having any issues with display at all.
## Tip heats when not in heating mode ## Tip heats when not in heating mode
⚠️ DISCONNECT YOUR TIP ⚠️ ⚠️ DISCONNECT YOUR TIP ⚠️

View File

@@ -79,16 +79,18 @@ help:
list: list:
@echo @echo
@echo "Supported top-level targets:" @echo "Supported top-level targets:"
@echo " * help - shows short basic help" @echo " * help - shows short basic help"
@echo " * list - this output" @echo " * list - this output"
@echo " * docker-shell - start docker container with shell inside to work on IronOS with all tools needed" @echo " * docker-shell - start docker container with shell inside to work on IronOS with all tools needed"
@echo " * docker-build - compile builds of IronOS for supported models inside docker container and place them to \"scripts/ci/artefacts/\"" @echo " * docker-build - compile builds of IronOS for supported models inside docker container and place them to $(OUT_DIR) (set OUT env var to override: OUT=/path/to/dir make ...)"
@echo " * docker-clean - delete created docker container (but not pre-downloaded data for it)" @echo " * docker-clean - delete created docker image for IronOS & its build cache objects (to free a lot of space)"
@echo " * docs - generate \"site\"/ directory with documentation in a form of static html files using ReadTheDocs framework and $(MKDOCS_YML) local config file" @echo " * docker-clean-cache - delete build cache objects of IronOS docker image EXCEPT the image itself"
@echo " * docs-deploy - generate & deploy docs online to gh-pages branch of current github repo" @echo " * docker-clean-image - delete docker image for IronOS EXCEPT its build cache objects"
@echo " * tests - run set of checks, linters & tests (equivalent of github CI IronOS project settings for push trigger)" @echo " * docs - generate \"site\"/ directory with documentation in a form of static html files using ReadTheDocs framework and $(MKDOCS_YML) local config file"
@echo " * clean-build - delete generated files & dirs produced during builds EXCEPT generated docker container image" @echo " * docs-deploy - generate & deploy docs online to gh-pages branch of current github repo"
@echo " * clean-full - delete generated files & dirs produced during builds INCLUDING generated docker container image" @echo " * tests - run set of checks, linters & tests (equivalent of github CI IronOS project settings for push trigger)"
@echo " * clean-build - delete generated files & dirs produced during builds EXCEPT docker image & its build cache"
@echo " * clean-full - delete generated files & dirs produced during builds INCLUDING docker image & its build cache"
@echo "" @echo ""
@echo "NOTES on supported pass-trough targets:" @echo "NOTES on supported pass-trough targets:"
@echo " * main Makefile is located in source/ directory and used to build the firmware itself;" @echo " * main Makefile is located in source/ directory and used to build the firmware itself;"
@@ -123,10 +125,17 @@ docker-shell: docker-check $(DOCKER_DEPS)
docker-build: docker-check $(DOCKER_DEPS) docker-build: docker-check $(DOCKER_DEPS)
$(DOCKER_CMD) make build-all $(DOCKER_CMD) make build-all
# delete container # delete docker image
docker-clean: docker-check docker-clean-image:
-docker rmi ironos-builder:latest -docker rmi ironos-builder:latest
# delete docker build cache objects
docker-clean-cache:
-docker system prune --filter label=ironos-builder:latest --force
# delete docker image & cache related to IronOS container
docker-clean: docker-clean-image docker-clean-cache
# generate docs in site/ directory (DIR for -d is relative to mkdocs.yml file location, hence use default name/location site by setting up ../site) # generate docs in site/ directory (DIR for -d is relative to mkdocs.yml file location, hence use default name/location site by setting up ../site)
docs: $(MKDOCS_YML) Documentation/* Documentation/Flashing/* Documentation/images/* docs: $(MKDOCS_YML) Documentation/* Documentation/Flashing/* Documentation/images/*
$(MKDOCS) build -f $(MKDOCS_YML) -d ../site $(MKDOCS) build -f $(MKDOCS_YML) -d ../site
@@ -222,7 +231,6 @@ ci: tests build-all build-multilang
clean-build: clean-build:
$(MAKE) -C source/ clean-all $(MAKE) -C source/ clean-all
rm -Rf site rm -Rf site
rm -Rf scripts/ci/artefacts
rm -Rf $(OUT_DIR) rm -Rf $(OUT_DIR)
# global clean-up target # global clean-up target
@@ -230,7 +238,7 @@ clean-full: clean-build docker-clean
# phony targets # phony targets
.PHONY: help list .PHONY: help list
.PHONY: docker-check docker-shell docker-build docker-clean .PHONY: docker-check docker-shell docker-build docker-clean-image docker-clean-cache docker-clean
.PHONY: docs docs-deploy .PHONY: docs docs-deploy
.PHONY: test-md test-sh test-py test-ccpp tests .PHONY: test-md test-sh test-py test-ccpp tests
.PHONY: build-all build-multilang ci .PHONY: build-all build-multilang ci

View File

@@ -1278,8 +1278,14 @@ def get_version_suffix(ver) -> str:
sha_id = f"{subprocess.check_output(['git', 'rev-parse', '--short=8', 'HEAD']).strip().decode('ascii').upper()}" sha_id = f"{subprocess.check_output(['git', 'rev-parse', '--short=8', 'HEAD']).strip().decode('ascii').upper()}"
## - if the exact commit relates to tag, then this command should return one-line tag name: ## - if the exact commit relates to tag, then this command should return one-line tag name:
tag = f"{subprocess.check_output(['git', 'tag', '--points-at', '%s' % sha_id]).strip().decode('ascii')}" tag = f"{subprocess.check_output(['git', 'tag', '--points-at', '%s' % sha_id]).strip().decode('ascii')}"
## - get short "traditional" branch name (as in `git branch` for that one with asterisk): if (
branch = f"{subprocess.check_output(['git', 'symbolic-ref', '--short', 'HEAD']).strip().decode('ascii')}" f"{subprocess.check_output(['git', 'rev-parse', '--symbolic-full-name', '--short', 'HEAD']).strip().decode('ascii')}"
== "HEAD"
):
return "E" + "." + sha_id
else:
## - get short "traditional" branch name (as in `git branch` for that one with asterisk):
branch = f"{subprocess.check_output(['git', 'symbolic-ref', '--short', 'HEAD']).strip().decode('ascii')}"
if tag and "" != tag: if tag and "" != tag:
# _Speculate_ on tag that it's Release... # _Speculate_ on tag that it's Release...
if ver == tag: if ver == tag:

View File

@@ -4,7 +4,7 @@
"tempUnitFahrenheit": false, "tempUnitFahrenheit": false,
"messagesWarn": { "messagesWarn": {
"CalibrationDone": { "CalibrationDone": {
"message": "Calibration\ndone!" "message": "Калибрирането\nе завършено!"
}, },
"ResetOKMessage": { "ResetOKMessage": {
"message": "Нулиране" "message": "Нулиране"
@@ -13,267 +13,267 @@
"message": "Настройките бяха\nнулирани!" "message": "Настройките бяха\nнулирани!"
}, },
"NoAccelerometerMessage": { "NoAccelerometerMessage": {
"message": "No accelerometer\ndetected!" "message": "Не е открит\nакселерометър!"
}, },
"NoPowerDeliveryMessage": { "NoPowerDeliveryMessage": {
"message": "No USB-PD IC\ndetected!" "message": "Не е открито\nUSB-PD захранване!"
}, },
"LockingKeysString": { "LockingKeysString": {
"message": "LOCKED" "message": "ЗАКЛЮЧ"
}, },
"UnlockingKeysString": { "UnlockingKeysString": {
"message": "UNLOCKED" "message": "ОТКЛЮЧ"
}, },
"WarningKeysLockedString": { "WarningKeysLockedString": {
"message": "!LOCKED!" "message": "!ЗАКЛЮЧ!"
}, },
"WarningThermalRunaway": { "WarningThermalRunaway": {
"message": "Thermal\nRunaway" "message": "Неконтролируемо\nпрегряване"
}, },
"WarningTipShorted": { "WarningTipShorted": {
"message": "!Tip Shorted!" "message": "!КС на човка!"
}, },
"SettingsCalibrationWarning": { "SettingsCalibrationWarning": {
"message": "Before rebooting, make sure tip & handle are at room temperature!" "message": "Преди рестартиране се уверете, че човка и дръжката са на стайна температурата!"
}, },
"CJCCalibrating": { "CJCCalibrating": {
"message": "calibrating\n" "message": "калибриране\n"
}, },
"SettingsResetWarning": { "SettingsResetWarning": {
"message": "Сигурни ли сте, че искате да върнете фабричните настройки?" "message": "Сигурни ли сте, че искате да върнете фабричните настройки?"
}, },
"UVLOWarningString": { "UVLOWarningString": {
"message": "Ниско DC Напрежение" "message": "НИС.НАПР."
}, },
"UndervoltageString": { "UndervoltageString": {
"message": "Ниско Напрежение\n" "message": "Ниско напрежение\n"
}, },
"InputVoltageString": { "InputVoltageString": {
"message": "Входно V: \n" "message": "Входно V: \n"
}, },
"SleepingSimpleString": { "SleepingSimpleString": {
"message": "Сън" "message": "Хъррр"
}, },
"SleepingAdvancedString": { "SleepingAdvancedString": {
"message": "Хър Хър Хър...\n" "message": "Сън...\n"
}, },
"SleepingTipAdvancedString": { "SleepingTipAdvancedString": {
"message": "Връх: \n" "message": "Човка:\n"
}, },
"OffString": { "OffString": {
"message": "Изкл." "message": "Изкл."
}, },
"ProfilePreheatString": { "ProfilePreheatString": {
"message": "Preheat\n" "message": "Загряване\n"
}, },
"ProfileCooldownString": { "ProfileCooldownString": {
"message": "Cooldown\n" "message": "Охлаждане\n"
}, },
"DeviceFailedValidationWarning": { "DeviceFailedValidationWarning": {
"message": "Your device is most likely a counterfeit!" "message": "Вероятно, устройство е фалшификат!"
}, },
"TooHotToStartProfileWarning": { "TooHotToStartProfileWarning": {
"message": "Too hot to\nstart profile" "message": "Твърде горещо за\nстартиране на профила"
} }
}, },
"characters": { "characters": {
"SettingRightChar": "R", "SettingRightChar": "Д",
"SettingLeftChar": "L", "SettingLeftChar": "Л",
"SettingAutoChar": "A", "SettingAutoChar": "А",
"SettingOffChar": "O", "SettingOffChar": "И",
"SettingSlowChar": "S", "SettingSlowChar": "Н",
"SettingMediumChar": "M", "SettingMediumChar": "С",
"SettingFastChar": "F", "SettingFastChar": "В",
"SettingStartNoneChar": "И", "SettingStartNoneChar": "И",
"SettingStartSolderingChar": "Р", "SettingStartSolderingChar": "З",
"SettingStartSleepChar": "С", "SettingStartSleepChar": "С",
"SettingStartSleepOffChar": "П", "SettingStartSleepOffChar": "П",
"SettingLockDisableChar": "D", "SettingLockDisableChar": "И",
"SettingLockBoostChar": "B", "SettingLockBoostChar": "Т",
"SettingLockFullChar": "F" "SettingLockFullChar": "П"
}, },
"menuGroups": { "menuGroups": {
"PowerMenu": { "PowerMenu": {
"displayText": "Power\nsettings", "displayText": "Настройки на\nзахранването",
"description": "" "description": ""
}, },
"SolderingMenu": { "SolderingMenu": {
"displayText": "Поялник\nНастройки", "displayText": "Настройки на\nзапояване",
"description": "" "description": ""
}, },
"PowerSavingMenu": { "PowerSavingMenu": {
"displayText": "Режими\nНастройки", "displayText": "Авто\nизключване",
"description": "" "description": ""
}, },
"UIMenu": { "UIMenu": {
"displayText": "Интерфейс\nНастройки", "displayText": "Интерфейс\n",
"description": "" "description": ""
}, },
"AdvancedMenu": { "AdvancedMenu": {
"displayText": "Разширени\nНастройки", "displayText": "Допълнителни\nнастройки",
"description": "" "description": ""
} }
}, },
"menuOptions": { "menuOptions": {
"DCInCutoff": { "DCInCutoff": {
"displayText": "Източник\nзахранване", "displayText": "Гранично\nнапрежение",
"description": "Източник на захранване. Минимално напрежение. (DC 10V) (S 3,3V за клетка)" "description": "Минимално напрежение, за да не се изтощи батерията (DC 10V) (S 3,3V за клетка)"
}, },
"MinVolCell": { "MinVolCell": {
"displayText": "Minimum\nvoltage", "displayText": "Мин.\nнапрежение",
"description": "Minimum allowed voltage per battery cell (3S: 3 - 3,7V | 4-6S: 2,4 - 3,7V)" "description": "Минимално допустимо напрежение на акумулаторна клетка (3S: 3 - 3,7V | 4-6S: 2,4 - 3,7V)"
}, },
"QCMaxVoltage": { "QCMaxVoltage": {
"displayText": "Мощност на\nзахранване", "displayText": "Напреж.\nна QC",
"description": "Мощност на избраното захранване" "description": "Максимална напрежение с QC захранвания"
}, },
"PDNegTimeout": { "PDNegTimeout": {
"displayText": "PD\ntimeout", "displayText": "PD\nинтервал",
"description": "PD negotiation timeout in 100ms steps for compatibility with some QC chargers" "description": "PD интервал за договаряне на захранването на стъпки от 100 мс за съвместимост с някои QC захранвания (0=Изкл.)"
}, },
"PDVpdo": { "PDVpdo": {
"displayText": "PD\nVPDO", "displayText": "PD\nVPDO",
"description": "Enables PPS & EPR modes" "description": "Включи PPS & EPR"
}, },
"BoostTemperature": { "BoostTemperature": {
"displayText": "Турбо\nтемп.", "displayText": "Турбо\nтемп.",
"description": "Температура за \"турбо\" режим" "description": "Температурата за \"турбо\" режим"
}, },
"AutoStart": { "AutoStart": {
"displayText": "Автоматичен\nработен режим", "displayText": "Автоматичен\nработен режим",
"description": "Режим на поялника при включване на захранването. (И=Изключен | Р=Работен | С=Сън | П=Сън температура помещение)" "description": "Режим на поялника при включване на захранването (И=Изкл. | З=Запояване | С=Сън | П=Покой на стайна температурата)"
}, },
"TempChangeShortStep": { "TempChangeShortStep": {
"displayText": "Промяна T\nбързо?", "displayText": "Промяна T\nбързо",
"description": "Промяна на температура при бързо натискане на бутон!" "description": "Промяна на температурата при бързо натискане на бутон"
}, },
"TempChangeLongStep": { "TempChangeLongStep": {
"displayText": "Промяна Т\nзадържане?", "displayText": "Промяна Т\nзадържане",
"description": "Промяна на температура при задържане на бутон!" "description": "Промяна на температурата при задържане на бутон"
}, },
"LockingMode": { "LockingMode": {
"displayText": "Allow locking\nbuttons", "displayText": "Бутони за\nзаключване",
"description": "While soldering, hold down both buttons to toggle locking them (D=disable | B=boost mode only | F=full locking)" "description": "Докато запоявате, задръжте двата бутона, за да превключите заключването им (И=Изкл. | Т=Турбо режим | П=Пълно)"
}, },
"ProfilePhases": { "ProfilePhases": {
"displayText": "Profile\nPhases", "displayText": "Брой\nетапи",
"description": "Number of phases in profile mode" "description": "Броят на етапите в режим на термичен профил"
}, },
"ProfilePreheatTemp": { "ProfilePreheatTemp": {
"displayText": "Preheat\nTemp", "displayText": "Температурата\nна загряване",
"description": "Preheat to this temperature at the start of profile mode" "description": "Температурата на загряване в началото на режим на термичен профил"
}, },
"ProfilePreheatSpeed": { "ProfilePreheatSpeed": {
"displayText": "Preheat\nSpeed", "displayText": "Скорост на\nзагряване",
"description": "Preheat at this rate (degrees per second)" "description": "Скорост на предварително загряване (градуси в секунда)"
}, },
"ProfilePhase1Temp": { "ProfilePhase1Temp": {
"displayText": "Phase 1\nTemp", "displayText": "Етап 1\nТемпературата",
"description": "Target temperature for the end of this phase" "description": "Температурата в края на този етап"
}, },
"ProfilePhase1Duration": { "ProfilePhase1Duration": {
"displayText": "Phase 1\nDuration", "displayText": "Етап 1\nПродължителност",
"description": "Target duration of this phase (seconds)" "description": "Продължителност на този етап (в секунди)"
}, },
"ProfilePhase2Temp": { "ProfilePhase2Temp": {
"displayText": "Phase 2\nTemp", "displayText": "Етап 2\nТемпературата",
"description": "" "description": ""
}, },
"ProfilePhase2Duration": { "ProfilePhase2Duration": {
"displayText": "Phase 2\nDuration", "displayText": "Етап 2\nПродължителност",
"description": "" "description": ""
}, },
"ProfilePhase3Temp": { "ProfilePhase3Temp": {
"displayText": "Phase 3\nTemp", "displayText": "Етап 3\nТемпературата",
"description": "" "description": ""
}, },
"ProfilePhase3Duration": { "ProfilePhase3Duration": {
"displayText": "Phase 3\nDuration", "displayText": "Етап 3\nПродължителност",
"description": "" "description": ""
}, },
"ProfilePhase4Temp": { "ProfilePhase4Temp": {
"displayText": "Phase 4\nTemp", "displayText": "Етап 4\nТемпературата",
"description": "" "description": ""
}, },
"ProfilePhase4Duration": { "ProfilePhase4Duration": {
"displayText": "Phase 4\nDuration", "displayText": "Етап 4\nПродължителност",
"description": "" "description": ""
}, },
"ProfilePhase5Temp": { "ProfilePhase5Temp": {
"displayText": "Phase 5\nTemp", "displayText": "Етап 5\nТемпературата",
"description": "" "description": ""
}, },
"ProfilePhase5Duration": { "ProfilePhase5Duration": {
"displayText": "Phase 5\nDuration", "displayText": "Етап 5\nПродължителност",
"description": "" "description": ""
}, },
"ProfileCooldownSpeed": { "ProfileCooldownSpeed": {
"displayText": "Cooldown\nSpeed", "displayText": "Скорост на\nохлаждане",
"description": "Cooldown at this rate at the end of profile mode (degrees per second)" "description": "Скорост на охлаждане в края на режим на термичен профил (градуси в секунда)"
}, },
"MotionSensitivity": { "MotionSensitivity": {
"displayText": "Усещане\nза движение", "displayText": "Чувствител.\nна движение",
"description": "Усещане за движение (0=Изключено | 1=Слабо | ... | 9=Силно)" "description": "Чувствителност на движение на акселерометър (0=Изкл. | 1=Слабо | ... | 9=Силно)"
}, },
"SleepTemperature": { "SleepTemperature": {
"displayText": "Темп.\nсън", "displayText": "Темп.\nсън",
"description": "Температура при режим \"сън\" (C)" "description": "Температурата при режим \"сън\""
}, },
"SleepTimeout": { "SleepTimeout": {
"displayText": "Време\nсън", "displayText": "Време\nсън",
"description": "Включване в режим \"сън\" след: (Минути | Секунди)" "description": "Включване в режим \"сън\" (секунди | минути)"
}, },
"ShutdownTimeout": { "ShutdownTimeout": {
"displayText": "Време\nизкл.", "displayText": "Време\nизкл.",
"description": "Изключване след (Минути)" "description": "Изключване след (минути)"
}, },
"HallEffSensitivity": { "HallEffSensitivity": {
"displayText": "Hall sensor\nsensitivity", "displayText": "Датчик\nна Хол",
"description": "Sensitivity to magnets (0=Изключено | 1=Слабо | ... | 9=Силно)" "description": "Чувствителност на сензора към магнитно поле (0=Изкл. | 1=Слабо | ... | 9=Силно)"
}, },
"TemperatureUnit": { "TemperatureUnit": {
"displayText": "Единици за\nтемпература", "displayText": "Единици за\nтемпературата",
"description": "Единици за температура (C=Целзии | F=Фаренхайт)" "description": "Единици за температурата (C=Целзии | F=Фаренхайт)"
}, },
"DisplayRotation": { "DisplayRotation": {
"displayText": "Ориентация\nна дисплея", "displayText": "Ориентация\nна дисплея",
"description": "Ориентация на дисплея (R=Дясна Ръка | L=Лява Ръка | A=Автоматично)" "description": "Ориентация на дисплея (Д=Дясна ръка | Л=Лява ръка | А=Авто)"
}, },
"CooldownBlink": { "CooldownBlink": {
"displayText": "Мигай при\nтопъл поялник", "displayText": "Мигай при\nтопъл поялник",
"description": "След изключване от работен режим, индикатора за температура да мига докато човката на поялника все още е топла" "description": "След изключване от работен режим, индикатора за температурата да мига докато човката на поялника все още е топла"
}, },
"ScrollingSpeed": { "ScrollingSpeed": {
"displayText": "Скорост\nна текста", "displayText": "Скорост\nна текста",
"description": "Скорост на движение на този текст" "description": "Скорост на движение на този текст (Н=Ниска | B=Висока)"
}, },
"ReverseButtonTempChange": { "ReverseButtonTempChange": {
"displayText": "Размяна\nбутони +-?", "displayText": "Размяна\nбутони +/-",
"description": "Обръщане на бутоните \"+\" и \"-\" за промяна на температурата на върха на поялника" "description": "Обръщане на бутоните + и - за промяна на температурата на човка на поялника"
}, },
"AnimSpeed": { "AnimSpeed": {
"displayText": "Anim.\nspeed", "displayText": "Скорост на\nанимацията",
"description": "Pace of icon animations in menu (O=off | S=slow | M=medium | F=fast)" "description": "Скорост на анимация на иконата в главното меню (И=Изкл. | Н=Ниска | C=Средна | B=Висока)"
}, },
"AnimLoop": { "AnimLoop": {
"displayText": "Anim.\nloop", "displayText": "Анимац.\nцикъл",
"description": "Loop icon animations in main menu" "description": "Зациклена анимация на иконите в главното меню"
}, },
"Brightness": { "Brightness": {
"displayText": "Screen\nbrightness", "displayText": "Яркост\nна екрана",
"description": "Adjust the OLED screen brightness" "description": "Регулирайте яркостта на екрана"
}, },
"ColourInversion": { "ColourInversion": {
"displayText": "Invert\nscreen", "displayText": "Инвертиране\nна екрана",
"description": "Invert the OLED screen colors" "description": "Инверсия на пикселите на екрана"
}, },
"LOGOTime": { "LOGOTime": {
"displayText": "Boot logo\nduration", "displayText": "Продължит.\nлогото",
"description": "Set boot logo duration (s=seconds)" "description": "Продължителност на логото за стартиране (в секунди)"
}, },
"AdvancedIdle": { "AdvancedIdle": {
"displayText": "Детайлен\nекран в покой", "displayText": "Детайлен\nекран в покой",
"description": "Покажи детайлна информация със ситен шрифт на екрана в режим на покой." "description": "Покажи детайлна информация със ситен шрифт на екрана в режим на покой"
}, },
"AdvancedSoldering": { "AdvancedSoldering": {
"displayText": "Детайлен\nработен екран", "displayText": "Детайлен\nработен екран",
@@ -281,34 +281,34 @@
}, },
"BluetoothLE": { "BluetoothLE": {
"displayText": "Bluetooth\n", "displayText": "Bluetooth\n",
"description": "Enables BLE" "description": "Включи BLE"
}, },
"PowerLimit": { "PowerLimit": {
"displayText": "Лимит на\nмощност", "displayText": "Лимит на\nмощност",
"description": "Максимална мощност на поялника (Watt)" "description": "Максимална мощност на поялника (вати)"
}, },
"CalibrateCJC": { "CalibrateCJC": {
"displayText": "Calibrate CJC\nat next boot", "displayText": "Калибриране\nна темп.",
"description": "At next boot tip Cold Junction Compensation will be calibrated (not required if Delta T is < 5 C)" "description": "Калибриране на температурата (CJC) при следващо включване (не се изисква, ако разликата е по-малка от 5 °С)"
}, },
"VoltageCalibration": { "VoltageCalibration": {
"displayText": "Калибриране\nнапрежение?", "displayText": "Калибриране\nнапрежение",
"description": "Калибриране на входното напрежение. Задръжте бутонa за изход" "description": "Калибриране на входното напрежениеадръжте бутонa за изход)"
}, },
"PowerPulsePower": { "PowerPulsePower": {
"displayText": "Захранващ\nимпулс", "displayText": "Захранващ\nимпулс",
"description": "Поддържане на интензивност на захранващия импулс" "description": "Поддържане на интензивност на захранващия импулс (вати)"
}, },
"PowerPulseWait": { "PowerPulseWait": {
"displayText": "Power pulse\ndelay", "displayText": "Закъснение\nна импулса",
"description": "Delay before keep-awake-pulse is triggered (x 2,5с)" "description": "Пауза между импулсите, които предпазват захранването от автоматично изключване (x 2,5 с)"
}, },
"PowerPulseDuration": { "PowerPulseDuration": {
"displayText": "Power pulse\nduration", "displayText": "Продължит.\nна импулса",
"description": "Keep-awake-pulse duration (x 250мс)" "description": "Дължината на импулса, който предпазва захранването от автоматично изключване (x 250 мс)"
}, },
"SettingsReset": { "SettingsReset": {
"displayText": "Фабрични\nнастройки?", "displayText": "Фабрични\nнастройки",
"description": "Връщане на фабрични настройки" "description": "Връщане на фабрични настройки"
}, },
"LanguageSwitch": { "LanguageSwitch": {
@@ -316,4 +316,4 @@
"description": "" "description": ""
} }
} }
} }

View File

@@ -31,7 +31,7 @@
"message": "Teplotní\nOchrana" "message": "Teplotní\nOchrana"
}, },
"WarningTipShorted": { "WarningTipShorted": {
"message": "!Tip Shorted!" "message": "!Zkrat na hrotu!"
}, },
"SettingsCalibrationWarning": { "SettingsCalibrationWarning": {
"message": "Před restartem se ujistěte, že hrot a držák mají pokojovou teplotu!" "message": "Před restartem se ujistěte, že hrot a držák mají pokojovou teplotu!"
@@ -64,16 +64,16 @@
"message": "Vyp" "message": "Vyp"
}, },
"ProfilePreheatString": { "ProfilePreheatString": {
"message": "Preheat\n" "message": "Předehřívání\n"
}, },
"ProfileCooldownString": { "ProfileCooldownString": {
"message": "Cooldown\n" "message": "Zchlazování\n"
}, },
"DeviceFailedValidationWarning": { "DeviceFailedValidationWarning": {
"message": "Vaše zařízení je s nejvyšší pravděpodobností padělek!" "message": "Vaše zařízení je pravěpodobně padělek!"
}, },
"TooHotToStartProfileWarning": { "TooHotToStartProfileWarning": {
"message": "Too hot to\nstart profile" "message": "Teplota příliš vysoká pro start profilu"
} }
}, },
"characters": { "characters": {
@@ -156,60 +156,60 @@
"description": "Při pájení podržte obě tlačítka pro jejich zamčení (Z=zakázáno | B=pouze v režimu boost | U=úplné zamčení)" "description": "Při pájení podržte obě tlačítka pro jejich zamčení (Z=zakázáno | B=pouze v režimu boost | U=úplné zamčení)"
}, },
"ProfilePhases": { "ProfilePhases": {
"displayText": "Profile\nPhases", "displayText": "Profilové\nFáze",
"description": "Number of phases in profile mode" "description": "Počet fází v profilovém režimu"
}, },
"ProfilePreheatTemp": { "ProfilePreheatTemp": {
"displayText": "Preheat\nTemp", "displayText": "Teplota\nPředehřátí",
"description": "Preheat to this temperature at the start of profile mode" "description": "Teplota na kterou předehřát na začátku profilového režimu"
}, },
"ProfilePreheatSpeed": { "ProfilePreheatSpeed": {
"displayText": "Preheat\nSpeed", "displayText": "Rychlost\nPředehřívání",
"description": "Preheat at this rate (degrees per second)" "description": "Rychlost předehřívání (stupně za sekundu)"
}, },
"ProfilePhase1Temp": { "ProfilePhase1Temp": {
"displayText": "Phase 1\nTemp", "displayText": "Teplota\nFáze 1",
"description": "Target temperature for the end of this phase" "description": "Cílová teplota na konci této fáze"
}, },
"ProfilePhase1Duration": { "ProfilePhase1Duration": {
"displayText": "Phase 1\nDuration", "displayText": "Trvání\nFáze 1",
"description": "Target duration of this phase (seconds)" "description": "Doba trvání této fáze (sekundy)"
}, },
"ProfilePhase2Temp": { "ProfilePhase2Temp": {
"displayText": "Phase 2\nTemp", "displayText": "Teplota\nFáze 2",
"description": "" "description": ""
}, },
"ProfilePhase2Duration": { "ProfilePhase2Duration": {
"displayText": "Phase 2\nDuration", "displayText": "Trvání\nFáze 2",
"description": "" "description": ""
}, },
"ProfilePhase3Temp": { "ProfilePhase3Temp": {
"displayText": "Phase 3\nTemp", "displayText": "Teplota\nFáze 3",
"description": "" "description": ""
}, },
"ProfilePhase3Duration": { "ProfilePhase3Duration": {
"displayText": "Phase 3\nDuration", "displayText": "Trvání\nFáze 3",
"description": "" "description": ""
}, },
"ProfilePhase4Temp": { "ProfilePhase4Temp": {
"displayText": "Phase 4\nTemp", "displayText": "Teplota\nFáze 4",
"description": "" "description": ""
}, },
"ProfilePhase4Duration": { "ProfilePhase4Duration": {
"displayText": "Phase 4\nDuration", "displayText": "Trvání\nFáze 4",
"description": "" "description": ""
}, },
"ProfilePhase5Temp": { "ProfilePhase5Temp": {
"displayText": "Phase 5\nTemp", "displayText": "Teplota\nFáze 5",
"description": "" "description": ""
}, },
"ProfilePhase5Duration": { "ProfilePhase5Duration": {
"displayText": "Phase 5\nDuration", "displayText": "Trvání\nFáze 5",
"description": "" "description": ""
}, },
"ProfileCooldownSpeed": { "ProfileCooldownSpeed": {
"displayText": "Cooldown\nSpeed", "displayText": "Rychlost\nochlazování",
"description": "Cooldown at this rate at the end of profile mode (degrees per second)" "description": "Rychlost ochlazování na konci profilového režimu (stupně za sekundu)"
}, },
"MotionSensitivity": { "MotionSensitivity": {
"displayText": "Citlivost\nna pohyb", "displayText": "Citlivost\nna pohyb",
@@ -316,4 +316,4 @@
"description": "" "description": ""
} }
} }
} }

View File

@@ -31,7 +31,7 @@
"message": "Thermal\nRunaway" "message": "Thermal\nRunaway"
}, },
"WarningTipShorted": { "WarningTipShorted": {
"message": "!Tip Shorted!" "message": "!Lötspitze\nkurzgeschlossen!"
}, },
"SettingsCalibrationWarning": { "SettingsCalibrationWarning": {
"message": "Vor dem Neustart bitte sicherstellen, dass Lötspitze & Gerät Raumtemperatur haben!" "message": "Vor dem Neustart bitte sicherstellen, dass Lötspitze & Gerät Raumtemperatur haben!"
@@ -61,7 +61,7 @@
"message": "Temp: \n" "message": "Temp: \n"
}, },
"OffString": { "OffString": {
"message": "Aus" "message": "aus"
}, },
"ProfilePreheatString": { "ProfilePreheatString": {
"message": "Vorwärmen\n" "message": "Vorwärmen\n"
@@ -145,15 +145,15 @@
}, },
"TempChangeShortStep": { "TempChangeShortStep": {
"displayText": "Temp-Schritt\nDruck kurz", "displayText": "Temp-Schritt\nDruck kurz",
"description": "Schrittweite für Temperaturwechsel bei kurzem Tastendruck" "description": "Schrittweite für Temperaturänderung bei kurzem Tastendruck"
}, },
"TempChangeLongStep": { "TempChangeLongStep": {
"displayText": "Temp-Schritt\nDruck lang", "displayText": "Temp-Schritt\nDruck lang",
"description": "Schrittweite für Temperaturwechsel bei langem Tastendruck" "description": "Schrittweite für Temperaturänderung bei langem Tastendruck"
}, },
"LockingMode": { "LockingMode": {
"displayText": "Tasten-\nsperre", "displayText": "Tasten-\nsperre",
"description": "Langes drücken beider Tasten im Lötmodus sperrt diese (A=aus | B=nur Boost | V=vollständig)" "description": "Langes Drücken beider Tasten im Lötmodus sperrt diese (A=aus | B=nur Boost | V=vollständig)"
}, },
"ProfilePhases": { "ProfilePhases": {
"displayText": "Profile\nPhasen", "displayText": "Profile\nPhasen",
@@ -173,7 +173,7 @@
}, },
"ProfilePhase1Duration": { "ProfilePhase1Duration": {
"displayText": "Phase 1\nDauer", "displayText": "Phase 1\nDauer",
"description": "Zieldauer dieser Phase (Sekunden)" "description": "Dauer dieser Phase (Sekunden)"
}, },
"ProfilePhase2Temp": { "ProfilePhase2Temp": {
"displayText": "Phase 2\nTemperatur", "displayText": "Phase 2\nTemperatur",
@@ -217,7 +217,7 @@
}, },
"SleepTemperature": { "SleepTemperature": {
"displayText": "Ruhe-\ntemperatur", "displayText": "Ruhe-\ntemperatur",
"description": "Ruhetemperatur der Spitze" "description": "Ruhetemperatur der Lötspitze"
}, },
"SleepTimeout": { "SleepTimeout": {
"displayText": "Ruhever-\nzögerung", "displayText": "Ruhever-\nzögerung",

View File

@@ -31,7 +31,7 @@
"message": "Temperatura\nfuori controllo" "message": "Temperatura\nfuori controllo"
}, },
"WarningTipShorted": { "WarningTipShorted": {
"message": "!Tip Shorted!" "message": "Punta in cortocircuito!"
}, },
"SettingsCalibrationWarning": { "SettingsCalibrationWarning": {
"message": "Prima di riavviare assicurati che la punta e l'impugnatura siano a temperatura ambiente!" "message": "Prima di riavviare assicurati che la punta e l'impugnatura siano a temperatura ambiente!"

View File

@@ -7,16 +7,16 @@
"message": "Калибровка\nзавершена!" "message": "Калибровка\nзавершена!"
}, },
"ResetOKMessage": { "ResetOKMessage": {
"message": "Сброс OK" "message": "Готово!"
}, },
"SettingsResetMessage": { "SettingsResetMessage": {
"message": "Настройки\nсброшены!" "message": "Настройки\nсброшены!"
}, },
"NoAccelerometerMessage": { "NoAccelerometerMessage": {
"message": "Не определен\nакселерометр!" "message": "Акселерометр\nне обнаружен!"
}, },
"NoPowerDeliveryMessage": { "NoPowerDeliveryMessage": {
"message": "USB-PD питание\nне обнаружено" "message": "Питание по USB-PD\nне обнаружено"
}, },
"LockingKeysString": { "LockingKeysString": {
"message": "ЗАБЛОК" "message": "ЗАБЛОК"
@@ -28,10 +28,10 @@
"message": "!ЗАБЛОК!" "message": "!ЗАБЛОК!"
}, },
"WarningThermalRunaway": { "WarningThermalRunaway": {
"message": "Неуправляемый\nРазогрев" "message": "Неуправляемый\nразогрев"
}, },
"WarningTipShorted": { "WarningTipShorted": {
"message": "!Tip Shorted!" "message": "!КЗ на жале!"
}, },
"SettingsCalibrationWarning": { "SettingsCalibrationWarning": {
"message": "Пожалуйста, убедитесь, что жало и корпус имеют комнатную температуру при следующей загрузке!" "message": "Пожалуйста, убедитесь, что жало и корпус имеют комнатную температуру при следующей загрузке!"
@@ -43,25 +43,25 @@
"message": "Вы уверены, что хотите сбросить настройки к значениям по умолчанию?" "message": "Вы уверены, что хотите сбросить настройки к значениям по умолчанию?"
}, },
"UVLOWarningString": { "UVLOWarningString": {
"message": "НАПРЯЖ--" "message": "НИЗ.НАПР"
}, },
"UndervoltageString": { "UndervoltageString": {
"message": "Низ. напряжение\n" "message": "Низ. напряжение\n"
}, },
"InputVoltageString": { "InputVoltageString": {
"message": "Питание В: \n" "message": "Питание(В):\n"
}, },
"SleepingSimpleString": { "SleepingSimpleString": {
"message": "Zzzz" "message": "Хххррп"
}, },
"SleepingAdvancedString": { "SleepingAdvancedString": {
"message": "Ожидание...\n" "message": "Сон...\n"
}, },
"SleepingTipAdvancedString": { "SleepingTipAdvancedString": {
"message": "Жало: \n" "message": "Жало: \n"
}, },
"OffString": { "OffString": {
"message": "Вык" "message": "Выкл"
}, },
"ProfilePreheatString": { "ProfilePreheatString": {
"message": "Преднагрев\n" "message": "Преднагрев\n"
@@ -70,7 +70,7 @@
"message": "Остывание\n" "message": "Остывание\n"
}, },
"DeviceFailedValidationWarning": { "DeviceFailedValidationWarning": {
"message": "Вероятно, это устройство подделка!" "message": "Вероятно, это поддельное устройство!"
}, },
"TooHotToStartProfileWarning": { "TooHotToStartProfileWarning": {
"message": "Слишком горячо для\nстарта профиля" "message": "Слишком горячо для\nстарта профиля"
@@ -84,9 +84,9 @@
"SettingSlowChar": "М", "SettingSlowChar": "М",
"SettingMediumChar": "С", "SettingMediumChar": "С",
"SettingFastChar": "Б", "SettingFastChar": "Б",
"SettingStartNoneChar": "В", "SettingStartNoneChar": "О",
"SettingStartSolderingChar": "П", "SettingStartSolderingChar": "П",
"SettingStartSleepChar": "О", "SettingStartSleepChar": "С",
"SettingStartSleepOffChar": "К", "SettingStartSleepOffChar": "К",
"SettingLockDisableChar": "О", "SettingLockDisableChar": "О",
"SettingLockBoostChar": "Т", "SettingLockBoostChar": "Т",
@@ -94,166 +94,166 @@
}, },
"menuGroups": { "menuGroups": {
"PowerMenu": { "PowerMenu": {
"displayText": "Параметры\nпитания", "displayText": "Настройки\nпитания",
"description": "" "description": ""
}, },
"SolderingMenu": { "SolderingMenu": {
"displayText": "Параметры\nпайки", "displayText": "Настройки\nпайки",
"description": "" "description": ""
}, },
"PowerSavingMenu": { "PowerSavingMenu": {
"displayText": "Режимы\nсна", "displayText": "Авто\nвыключение",
"description": "" "description": ""
}, },
"UIMenu": { "UIMenu": {
"displayText": "Параметры\nинтерфейса", "displayText": "Интерфейс\n",
"description": "" "description": ""
}, },
"AdvancedMenu": { "AdvancedMenu": {
"displayText": "Дополнител.\nнастройки", "displayText": "Доп.\nнастройки",
"description": "" "description": ""
} }
}, },
"menuOptions": { "menuOptions": {
"DCInCutoff": { "DCInCutoff": {
"displayText": "Источник\nпитания", "displayText": "Предельное\nнапряжение",
"description": "Источник питания. Устанавливает напряжение отсечки. (DC 10В) (S 3,3В на ячейку, без лимита мощности)" "description": "Установка минимально предельного напряжения от аккумулятора для предотвращения глубокого разряда (DC 10В | S 3,3В на ячейку, без ограничения мощности)"
}, },
"MinVolCell": { "MinVolCell": {
"displayText": "Мин.\nнапр.", "displayText": "Мин.\nнапряжение",
"description": "Минимальное разрешенное напряжение на ячейку (3S: 3 - 3,7V | 4S-6S: 2,4 - 3,7V)" "description": "Минимально разрешённое напряжение на ячейку (3S: 3 - 3,7В | 4S-6S: 2,4 - 3,7В)"
}, },
"QCMaxVoltage": { "QCMaxVoltage": {
"displayText": "Ограничение\nнапряжения QC", "displayText": "Напр-е\nдля QC",
"description": "Максимальное напряжение для согласования с QC источником питания" "description": "Максимальное напряжение для согласования с источником питания по QC"
}, },
"PDNegTimeout": { "PDNegTimeout": {
"displayText": "PD\nтайм-аут", "displayText": "PD\nинтервал",
"description": "Power Delivery тайм-аут согласования с шагом 100 мс для совместимости с некоторыми быстрыми зарядными QC (0: отключено)" "description": "Интервал согласования питания по Power Delivery с шагом 100 мс для совместимости с некоторыми источниками питания по QC (0=Откл.)"
}, },
"PDVpdo": { "PDVpdo": {
"displayText": "PD\nVPDO", "displayText": "PD\nVPDO",
"description": "Включает режимы PPS & EPR." "description": "Включить режимы PPS & EPR"
}, },
"BoostTemperature": { "BoostTemperature": {
"displayText": "t° турбо\nрежима", "displayText": "t° турбо\nрежима",
"description": "Температура жала в турбо-режиме" "description": "Температура жала в турбо-режиме"
}, },
"AutoStart": { "AutoStart": {
"displayText": "Авто\nстарт", "displayText": "Режим при\nвключении",
"description": "Режим, в котором запускается паяльник при подаче питания (В=Выкл. | П=Пайка | О=Ожидание | К=Ожидание при комн. темп.)" "description": "Режим, в котором включается паяльник (О=Откл. | П=Пайка | С=Сон | К=Ожидание при комн. темп.)"
}, },
"TempChangeShortStep": { "TempChangeShortStep": {
"displayText": "Шаг темп.\nкор. наж.", "displayText": "Шаг t° при\nкор.наж-ии",
"description": "Шаг изменения температуры при коротком нажатии кнопок" "description": "Шаг изменения температуры при коротком нажатии кнопок"
}, },
"TempChangeLongStep": { "TempChangeLongStep": {
"displayText": "Шаг темп.\nдлин. наж.", "displayText": "Шаг t° при\nдол.наж-ии",
"description": "Шаг изменения температуры при длинном нажатии кнопок" "description": "Шаг изменения температуры при долгом нажатии кнопок"
}, },
"LockingMode": { "LockingMode": {
"displayText": "Разрешить\nблок. кнопок", "displayText": "Разрешить\nблок. кнопок",
"description": "При работе длинное нажатие обеих кнопок блокирует их (О=Отключено | Т=Только турбо | П=Полная блокировка)" "description": "Блокировать кнопки при их долгом нажатии в режиме пайки (О=Откл. | Т=Только турбо | П=Полная блокировка)"
}, },
"ProfilePhases": { "ProfilePhases": {
"displayText": "Профиль\nЭтапы", "displayText": "Этапы\nпрофиля",
"description": "Количество этапов в режиме профиля" "description": "Количество этапов в режиме профиля"
}, },
"ProfilePreheatTemp": { "ProfilePreheatTemp": {
"displayText": "Преднагрев\nТемпература", "displayText": "Температура\nпреднагрева",
"description": "Разогреть до этой температуры в начале режима профиля" "description": "Температура предварительного нагрева в начале режима термопрофиля"
}, },
"ProfilePreheatSpeed": { "ProfilePreheatSpeed": {
"displayText": "Преднагрев\nСкорость", "displayText": "Скорость\nпреднагрева",
"description": "Предварительный нагрев с этой скоростью (градусов в секунду)" "description": "Скорость предварительного нагрева в начале режима термопрофиля (в градусах в секунду)"
}, },
"ProfilePhase1Temp": { "ProfilePhase1Temp": {
"displayText": "Этап 1\nТемпература", "displayText": "Температура\n1-го этапа",
"description": "Целевая температура в конце этого эатпа" "description": "Необходимая температура в конце 1-го этапа"
}, },
"ProfilePhase1Duration": { "ProfilePhase1Duration": {
"displayText": "Этап 1\nДлительность", "displayText": "Длительность\n1-го этапа",
"description": "Целевая длительность этого этапа (секунды)" "description": "Необходимая длительность 1-го этапа (в секундах)"
}, },
"ProfilePhase2Temp": { "ProfilePhase2Temp": {
"displayText": "Этап 2\nТемпература", "displayText": "Температура\n2-го этапа",
"description": "" "description": ""
}, },
"ProfilePhase2Duration": { "ProfilePhase2Duration": {
"displayText": "Этап 2\nДлительность", "displayText": "Длительность\n2-го этапа",
"description": "" "description": ""
}, },
"ProfilePhase3Temp": { "ProfilePhase3Temp": {
"displayText": "Этап 3\nТемпература", "displayText": "Температура\n3-го этапа",
"description": "" "description": ""
}, },
"ProfilePhase3Duration": { "ProfilePhase3Duration": {
"displayText": "Этап 3\nДлительность", "displayText": "Длительность\n3-го этапа",
"description": "" "description": ""
}, },
"ProfilePhase4Temp": { "ProfilePhase4Temp": {
"displayText": "Этап 4\nТемпература", "displayText": "Температура\n4-го этапа",
"description": "" "description": ""
}, },
"ProfilePhase4Duration": { "ProfilePhase4Duration": {
"displayText": "Этап 4\nДлительность", "displayText": "Длительность\n4-го этапа",
"description": "" "description": ""
}, },
"ProfilePhase5Temp": { "ProfilePhase5Temp": {
"displayText": "Этап 5\nТемпература", "displayText": "Температура\n5-го этапа",
"description": "" "description": ""
}, },
"ProfilePhase5Duration": { "ProfilePhase5Duration": {
"displayText": "Этап 5\nДлительность", "displayText": "Длительность\n5-го этапа",
"description": "" "description": ""
}, },
"ProfileCooldownSpeed": { "ProfileCooldownSpeed": {
"displayText": "Остывание\nСкорость", "displayText": "Скорость\nостывания",
"description": "Остывать с такой скоростью в конце режима профиля (градусов в секунду)" "description": "Скорость остывания в конце режима термопрофиля (в градусах в секунду)"
}, },
"MotionSensitivity": { "MotionSensitivity": {
"displayText": "Чувствительн.\nакселерометра", "displayText": "Чувствительн.\nакселерометра",
"description": "Чувствительность акселерометра (0=Выкл. | 1=мин. | ... | 9=макс.)" "description": "Чувствительность акселерометра (0=Откл. | 1=мин. | ... | 9=макс.)"
}, },
"SleepTemperature": { "SleepTemperature": {
"displayText": "Темп.\nожидания", "displayText": "t° при\nсне",
"description": "Температура жала в режиме ожидания" "description": "Температура жала в режиме сна"
}, },
"SleepTimeout": { "SleepTimeout": {
"displayText": "Таймаут\nожидания", "displayText": "Интервал\nсна",
"description": "Время до перехода в режим ожидания (Минуты | Секунды)" "description": "Время до перехода в режим сна (секунды | минуты)"
}, },
"ShutdownTimeout": { "ShutdownTimeout": {
"displayText": "Таймаут\nвыключения", "displayText": "Интервал\nотключ-я",
"description": "Время до выключения паяльника (минуты)" "description": "Время до выключения паяльника (в минутах)"
}, },
"HallEffSensitivity": { "HallEffSensitivity": {
"displayText": "Датчик\nХолла", "displayText": "Датчик\nХолла",
"description": "Чувствительность датчика Холла к переходу в спящий режим (0=Выкл. | 1=мин. | ... | 9=макс.)" "description": "Чувствительность датчика Холла к магнитному полю (0=Откл. | 1=мин. | ... | 9=макс.)"
}, },
"TemperatureUnit": { "TemperatureUnit": {
"displayText": "Единицы\nтемпературы", "displayText": "Единицы\nизмерения",
"description": "Единицы измерения температуры (C=°Цельcия | F=°Фаренгейта)" "description": "Единицы измерения температуры (C=°Цельcия | F=°Фаренгейта)"
}, },
"DisplayRotation": { "DisplayRotation": {
"displayText": "Ориентация\nэкрана", "displayText": "Поворот\nэкрана",
"description": "Ориентация экрана (П=Правая рука | Л=Левая рука | А=Авто)" "description": "Поворот экрана (П=Правша | Л=Левша | А=Авто)"
}, },
"CooldownBlink": { "CooldownBlink": {
"displayText": "Мигание t°\nпри остывании", "displayText": "Мигание t°\nпри остывании",
"description": "Мигать температурой на экране охлаждения, пока жало еще горячее" "description": "Мигать температурой на экране при остывании, пока жало ещё горячее"
}, },
"ScrollingSpeed": { "ScrollingSpeed": {
"displayText": "Скорость\nтекста", "displayText": "Скорость\nтекста",
"description": "Скорость прокрутки текста (М=Медленная | Б=Быстрая)" "description": "Скорость прокрутки текста (М=Медленная | Б=Быстрая)"
}, },
"ReverseButtonTempChange": { "ReverseButtonTempChange": {
"displayText": "Поменять\nкнопки+-", "displayText": "Поменять\nкнопки +/-",
"description": "Поменять кнопки изменения температуры" "description": "Поменять кнопки изменения температуры"
}, },
"AnimSpeed": { "AnimSpeed": {
"displayText": "Скорость\nанимации", "displayText": "Скорость\nанимации",
"description": "Скорость анимации иконок в главном меню (О=Отключено | М=Медленная| С=Средняя | Б=Быстрая)" "description": "Скорость анимации иконок в главном меню (О=Откл. | М=Медленная| С=Средняя | Б=Быстрая)"
}, },
"AnimLoop": { "AnimLoop": {
"displayText": "Зацикленная\nанимация", "displayText": "Зацикленная\nанимация",
@@ -261,31 +261,31 @@
}, },
"Brightness": { "Brightness": {
"displayText": "Яркость\nэкрана", "displayText": "Яркость\nэкрана",
"description": "Настройки контраста/яркости OLED экрана" "description": "Уровень яркости пикселей на экране"
}, },
"ColourInversion": { "ColourInversion": {
"displayText": "Инверсия\nэкрана", "displayText": "Инверсия\nэкрана",
"description": "Инвертировать цвета на OLED экране" "description": "Инвертировать пиксели на экране"
}, },
"LOGOTime": { "LOGOTime": {
"displayText": "Длительность\nпоказа логотипа", "displayText": "Длит-ть\nлоготипа",
"description": "Длительность отображения логотипа (в секундах)" "description": "Длительность отображения логотипа (в секундах)"
}, },
"AdvancedIdle": { "AdvancedIdle": {
"displayText": "Подробный\nреж. ожидания", "displayText": "Подробный\nэкран ожидания",
"description": "Отображать детальную информацию уменьшенным шрифтом на экране ожидания" "description": "Показывать дополнительную информацию на экране ожидания уменьшенным шрифтом"
}, },
"AdvancedSoldering": { "AdvancedSoldering": {
"displayText": "Подробный\nэкран пайки", "displayText": "Подробный\nэкран пайки",
"description": "Показывать детальную информацию на экране пайки" "description": "Показывать дополнительную информацию на экране пайки уменьшенным шрифтом"
}, },
"BluetoothLE": { "BluetoothLE": {
"displayText": "Bluetooth\n", "displayText": "Bluetooth\n",
"description": "Активирует BLE" "description": "Включить BLE"
}, },
"PowerLimit": { "PowerLimit": {
"displayText": "Предел\nмощности", "displayText": "Предел\nмощ-ти",
"description": "Максимальная мощность, которую может использовать паяльник (Ватт)" "description": "Максимальная мощность, которую может использовать паяльник (в ваттах)"
}, },
"CalibrateCJC": { "CalibrateCJC": {
"displayText": "Калибровка\nтемпературы", "displayText": "Калибровка\nтемпературы",
@@ -296,20 +296,20 @@
"description": "Калибровка входного напряжения (долгое нажатие для выхода)" "description": "Калибровка входного напряжения (долгое нажатие для выхода)"
}, },
"PowerPulsePower": { "PowerPulsePower": {
"displayText": "Сила имп.\nпитания Вт", "displayText": "Сила имп.\nпитания",
"description": "Сила импульса удерживающего от сна повербанк или другой источник питания" "description": "Сила импульса, удерживающего от автовыключения источник питания (в ваттах)"
}, },
"PowerPulseWait": { "PowerPulseWait": {
"displayText": "Пауза имп.\nпитания с", "displayText": "Пауза имп.\nпитания (К)",
"description": "Пауза между импульсами удерживающими источник питания от сна (x 2,5с)" "description": "Коэффициент паузы между импульсами, удерживающими от автовыключения источник питания (К x 2,5 с)"
}, },
"PowerPulseDuration": { "PowerPulseDuration": {
"displayText": "Длина имп.\nпитания мс", "displayText": "Длина имп.\nпитания (К)",
"description": "Длина импульса удерживающего от сна источник питания (x 250мс)" "description": "Коэффициент длины импульса, удерживающего от автовыключения источник питания (К x 250 мс)"
}, },
"SettingsReset": { "SettingsReset": {
"displayText": "Сброс\nНастроек", "displayText": "Сброс\nнастроек",
"description": "Сброс настроек к значеням по умолчанию" "description": "Сброс настроек к значениям по умолчанию"
}, },
"LanguageSwitch": { "LanguageSwitch": {
"displayText": "Язык:\n RU Русский", "displayText": "Язык:\n RU Русский",

View File

@@ -4,7 +4,7 @@
"tempUnitFahrenheit": false, "tempUnitFahrenheit": false,
"messagesWarn": { "messagesWarn": {
"CalibrationDone": { "CalibrationDone": {
"message": "Calibration\ndone!" "message": "Kalibrácia\ndokončená!"
}, },
"ResetOKMessage": { "ResetOKMessage": {
"message": "Reset OK" "message": "Reset OK"
@@ -31,13 +31,13 @@
"message": "Únik\nTepla" "message": "Únik\nTepla"
}, },
"WarningTipShorted": { "WarningTipShorted": {
"message": "!Tip Shorted!" "message": "!Skrat hrotu!"
}, },
"SettingsCalibrationWarning": { "SettingsCalibrationWarning": {
"message": "Before rebooting, make sure tip & handle are at room temperature!" "message": "Pred reštartovaním sa uistite, že hrot a rúčka sú v izbovej teplote!"
}, },
"CJCCalibrating": { "CJCCalibrating": {
"message": "calibrating\n" "message": "kalibrovanie\n"
}, },
"SettingsResetWarning": { "SettingsResetWarning": {
"message": "Naozaj chcete obnoviť továrenské nastavenia?" "message": "Naozaj chcete obnoviť továrenské nastavenia?"
@@ -64,16 +64,16 @@
"message": "Vyp" "message": "Vyp"
}, },
"ProfilePreheatString": { "ProfilePreheatString": {
"message": "Preheat\n" "message": "Predhrievanie\n"
}, },
"ProfileCooldownString": { "ProfileCooldownString": {
"message": "Cooldown\n" "message": "Schladzovanie\n"
}, },
"DeviceFailedValidationWarning": { "DeviceFailedValidationWarning": {
"message": "Vaše zariadenie je pravdepodobne falzifikát!" "message": "Vaše zariadenie je pravdepodobne falzifikát!"
}, },
"TooHotToStartProfileWarning": { "TooHotToStartProfileWarning": {
"message": "Too hot to\nstart profile" "message": "Teplota príliš vysoká pre štart profilu"
} }
}, },
"characters": { "characters": {
@@ -133,7 +133,7 @@
}, },
"PDVpdo": { "PDVpdo": {
"displayText": "PD\nVPDO", "displayText": "PD\nVPDO",
"description": "Enables PPS & EPR modes" "description": "Zapína PPS & EPR režimy"
}, },
"BoostTemperature": { "BoostTemperature": {
"displayText": "Boost\nteplota", "displayText": "Boost\nteplota",
@@ -156,60 +156,60 @@
"description": "Zamknutie tlačidiel - dlhé stlačenie oboch naraz počas spájkovania (Z=Zakázať | B=Okrem boost | P=Plné zamknutie)" "description": "Zamknutie tlačidiel - dlhé stlačenie oboch naraz počas spájkovania (Z=Zakázať | B=Okrem boost | P=Plné zamknutie)"
}, },
"ProfilePhases": { "ProfilePhases": {
"displayText": "Profile\nPhases", "displayText": "Profilové\nFázy",
"description": "Number of phases in profile mode" "description": "Počet fáz v profilovóm režime"
}, },
"ProfilePreheatTemp": { "ProfilePreheatTemp": {
"displayText": "Preheat\nTemp", "displayText": "Teplota\nPredhriatia",
"description": "Preheat to this temperature at the start of profile mode" "description": "Teplota na ktorú sa má predohriať na začiatku profilového režimu"
}, },
"ProfilePreheatSpeed": { "ProfilePreheatSpeed": {
"displayText": "Preheat\nSpeed", "displayText": "Rýchlosť\nPredhriatia",
"description": "Preheat at this rate (degrees per second)" "description": "Rýchlosť predhrievania (stupňe za sekundu)"
}, },
"ProfilePhase1Temp": { "ProfilePhase1Temp": {
"displayText": "Phase 1\nTemp", "displayText": "Teplota\nFáza 1",
"description": "Target temperature for the end of this phase" "description": "Cieľová teplota na konci tejto fázy"
}, },
"ProfilePhase1Duration": { "ProfilePhase1Duration": {
"displayText": "Phase 1\nDuration", "displayText": "Trvanie\nFáza 1",
"description": "Target duration of this phase (seconds)" "description": "Doba trvania tejto fázy (sekundy)"
}, },
"ProfilePhase2Temp": { "ProfilePhase2Temp": {
"displayText": "Phase 2\nTemp", "displayText": "Teplota\nFáza 2",
"description": "" "description": ""
}, },
"ProfilePhase2Duration": { "ProfilePhase2Duration": {
"displayText": "Phase 2\nDuration", "displayText": "Trvanie\nFáza 2",
"description": "" "description": ""
}, },
"ProfilePhase3Temp": { "ProfilePhase3Temp": {
"displayText": "Phase 3\nTemp", "displayText": "Teplota\nFáza 3",
"description": "" "description": ""
}, },
"ProfilePhase3Duration": { "ProfilePhase3Duration": {
"displayText": "Phase 3\nDuration", "displayText": "Trvanie\nFáza 3",
"description": "" "description": ""
}, },
"ProfilePhase4Temp": { "ProfilePhase4Temp": {
"displayText": "Phase 4\nTemp", "displayText": "Teplota\nFáza 4",
"description": "" "description": ""
}, },
"ProfilePhase4Duration": { "ProfilePhase4Duration": {
"displayText": "Phase 4\nDuration", "displayText": "Trvanie\nFáza 4",
"description": "" "description": ""
}, },
"ProfilePhase5Temp": { "ProfilePhase5Temp": {
"displayText": "Phase 5\nTemp", "displayText": "Teplota\nFáza 5",
"description": "" "description": ""
}, },
"ProfilePhase5Duration": { "ProfilePhase5Duration": {
"displayText": "Phase 5\nDuration", "displayText": "Trvanie\nFáza 4",
"description": "" "description": ""
}, },
"ProfileCooldownSpeed": { "ProfileCooldownSpeed": {
"displayText": "Cooldown\nSpeed", "displayText": "Rýchlosť\nochladzovania",
"description": "Cooldown at this rate at the end of profile mode (degrees per second)" "description": "Rýchlosť ochladzovania na konci profilového režimu (stupne za sekundu)"
}, },
"MotionSensitivity": { "MotionSensitivity": {
"displayText": "Citlivosť\npohybu", "displayText": "Citlivosť\npohybu",
@@ -281,15 +281,15 @@
}, },
"BluetoothLE": { "BluetoothLE": {
"displayText": "Bluetooth\n", "displayText": "Bluetooth\n",
"description": "Enables BLE" "description": "Zapne BLE"
}, },
"PowerLimit": { "PowerLimit": {
"displayText": "Obmedzenie\nvýkonu", "displayText": "Obmedzenie\nvýkonu",
"description": "Obmedzenie výkonu podľa použitého zdroja (watt)" "description": "Obmedzenie výkonu podľa použitého zdroja (watt)"
}, },
"CalibrateCJC": { "CalibrateCJC": {
"displayText": "Calibrate CJC\nat next boot", "displayText": "Kalibrácia CJC\npri nasledujúcom štarte",
"description": "At next boot tip Cold Junction Compensation will be calibrated (not required if Delta T is < 5°C)" "description": "Pri nasledujúcom štarte bude kalibrovaná kompenzácia studeného spoja (nie je potrebné ak Delta T je < 5°C)"
}, },
"VoltageCalibration": { "VoltageCalibration": {
"displayText": "Kalibrácia\nnap. napätia", "displayText": "Kalibrácia\nnap. napätia",

View File

@@ -4,10 +4,10 @@
"tempUnitFahrenheit": false, "tempUnitFahrenheit": false,
"messagesWarn": { "messagesWarn": {
"CalibrationDone": { "CalibrationDone": {
"message": "Calibration\ndone!" "message": "Kalibrering\nfärdig!"
}, },
"ResetOKMessage": { "ResetOKMessage": {
"message": "Reset OK" "message": "Återställning\nOK"
}, },
"SettingsResetMessage": { "SettingsResetMessage": {
"message": "Inställningar\nåterställda" "message": "Inställningar\nåterställda"
@@ -28,16 +28,16 @@
"message": "!LÅST!" "message": "!LÅST!"
}, },
"WarningThermalRunaway": { "WarningThermalRunaway": {
"message": "Thermal\nRunaway" "message": "Termisk\nFlykt"
}, },
"WarningTipShorted": { "WarningTipShorted": {
"message": "!Tip Shorted!" "message": "!Spets Kortsluten!"
}, },
"SettingsCalibrationWarning": { "SettingsCalibrationWarning": {
"message": "Before rebooting, make sure tip & handle are at room temperature!" "message": "Före omstart, säkerställ att spetsen och handtaget är i rumstemperatur!"
}, },
"CJCCalibrating": { "CJCCalibrating": {
"message": "calibrating\n" "message": "kalibrerar\n"
}, },
"SettingsResetWarning": { "SettingsResetWarning": {
"message": "Är du säker på att du vill återställa inställningarna?" "message": "Är du säker på att du vill återställa inställningarna?"
@@ -64,16 +64,16 @@
"message": "Av" "message": "Av"
}, },
"ProfilePreheatString": { "ProfilePreheatString": {
"message": "Preheat\n" "message": "Förvärmning\n"
}, },
"ProfileCooldownString": { "ProfileCooldownString": {
"message": "Cooldown\n" "message": "Nedkyldning\n"
}, },
"DeviceFailedValidationWarning": { "DeviceFailedValidationWarning": {
"message": "Your device is most likely a counterfeit!" "message": "Din enhet är sannerligen oäkta!"
}, },
"TooHotToStartProfileWarning": { "TooHotToStartProfileWarning": {
"message": "Too hot to\nstart profile" "message": "För varm för att\nstarta profilen!"
} }
}, },
"characters": { "characters": {
@@ -128,12 +128,12 @@
"description": "Maximal QC-spänning enheten skall efterfråga" "description": "Maximal QC-spänning enheten skall efterfråga"
}, },
"PDNegTimeout": { "PDNegTimeout": {
"displayText": "PD\ntimeout", "displayText": "PD\npauser",
"description": "PD negotiation timeout in 100ms steps for compatibility with some QC chargers" "description": "PD förhandlings pauser i 100ms steg för kompatibilitet med vissa PD laddare"
}, },
"PDVpdo": { "PDVpdo": {
"displayText": "PD\nVPDO", "displayText": "PD\nVPDO",
"description": "Enables PPS & EPR modes" "description": "Slår på PPS & EPR lägen"
}, },
"BoostTemperature": { "BoostTemperature": {
"displayText": "Turbo-\ntemp", "displayText": "Turbo-\ntemp",
@@ -156,60 +156,60 @@
"description": "Vid lödning, håll nere bägge knappar för att slå på lås (A=Av | T=Bara turbo | F=Fullt lås)" "description": "Vid lödning, håll nere bägge knappar för att slå på lås (A=Av | T=Bara turbo | F=Fullt lås)"
}, },
"ProfilePhases": { "ProfilePhases": {
"displayText": "Profile\nPhases", "displayText": "Profil-\nfaser",
"description": "Number of phases in profile mode" "description": "Antal faser i profil läge"
}, },
"ProfilePreheatTemp": { "ProfilePreheatTemp": {
"displayText": "Preheat\nTemp", "displayText": "Förvärmnings-\ntemp",
"description": "Preheat to this temperature at the start of profile mode" "description": "Förvärm till denna temperatur i början av provil läget"
}, },
"ProfilePreheatSpeed": { "ProfilePreheatSpeed": {
"displayText": "Preheat\nSpeed", "displayText": "Förvärmnings-\nhastighet",
"description": "Preheat at this rate (degrees per second)" "description": "Förvärm enligt denna hastighet (grader per sekund)"
}, },
"ProfilePhase1Temp": { "ProfilePhase1Temp": {
"displayText": "Phase 1\nTemp", "displayText": "Fas 1\nTemp",
"description": "Target temperature for the end of this phase" "description": "Måltemperatur i slutet av denna fas"
}, },
"ProfilePhase1Duration": { "ProfilePhase1Duration": {
"displayText": "Phase 1\nDuration", "displayText": "Fas 1\nTidslängd",
"description": "Target duration of this phase (seconds)" "description": "Mållängd av denna fasen (sekunder)"
}, },
"ProfilePhase2Temp": { "ProfilePhase2Temp": {
"displayText": "Phase 2\nTemp", "displayText": "Fas 2\nTemp",
"description": "" "description": ""
}, },
"ProfilePhase2Duration": { "ProfilePhase2Duration": {
"displayText": "Phase 2\nDuration", "displayText": "Fas 2\nTidslängd",
"description": "" "description": ""
}, },
"ProfilePhase3Temp": { "ProfilePhase3Temp": {
"displayText": "Phase 3\nTemp", "displayText": "Fas 3\nTemp",
"description": "" "description": ""
}, },
"ProfilePhase3Duration": { "ProfilePhase3Duration": {
"displayText": "Phase 3\nDuration", "displayText": "Fas 3\nTidslängd",
"description": "" "description": ""
}, },
"ProfilePhase4Temp": { "ProfilePhase4Temp": {
"displayText": "Phase 4\nTemp", "displayText": "Fas 4\nTemp",
"description": "" "description": ""
}, },
"ProfilePhase4Duration": { "ProfilePhase4Duration": {
"displayText": "Phase 4\nDuration", "displayText": "Fas 4\nTidslängd",
"description": "" "description": ""
}, },
"ProfilePhase5Temp": { "ProfilePhase5Temp": {
"displayText": "Phase 5\nTemp", "displayText": "Fas 5\nTemp",
"description": "" "description": ""
}, },
"ProfilePhase5Duration": { "ProfilePhase5Duration": {
"displayText": "Phase 5\nDuration", "displayText": "Fas 5\nTidslängd",
"description": "" "description": ""
}, },
"ProfileCooldownSpeed": { "ProfileCooldownSpeed": {
"displayText": "Cooldown\nSpeed", "displayText": "Nedkylnings-\nhastighet",
"description": "Cooldown at this rate at the end of profile mode (degrees per second)" "description": "Kyl ned i denna hastighet i slutet av profilen (grader per sekund)"
}, },
"MotionSensitivity": { "MotionSensitivity": {
"displayText": "Rörelse-\nkänslighet", "displayText": "Rörelse-\nkänslighet",
@@ -260,16 +260,16 @@
"description": "Loopa animationer i huvudmeny" "description": "Loopa animationer i huvudmeny"
}, },
"Brightness": { "Brightness": {
"displayText": "Screen\nbrightness", "displayText": "Skärmens\nLjusstyrka",
"description": "Adjust the OLED screen brightness" "description": "Justera OLED skärmens ljusstyrka"
}, },
"ColourInversion": { "ColourInversion": {
"displayText": "Invert\nscreen", "displayText": "Invertera\nskärm",
"description": "Invert the OLED screen colors" "description": "Invertera OLED skärmens färger"
}, },
"LOGOTime": { "LOGOTime": {
"displayText": "Boot logo\nduration", "displayText": "Start logo\nTidslängd",
"description": "Set boot logo duration (s=seconds)" "description": "Sätt uppstartslogotypens tidslängd (s=sekunder)"
}, },
"AdvancedIdle": { "AdvancedIdle": {
"displayText": "Detaljerad\nvid inaktiv", "displayText": "Detaljerad\nvid inaktiv",
@@ -281,31 +281,31 @@
}, },
"BluetoothLE": { "BluetoothLE": {
"displayText": "Bluetooth\n", "displayText": "Bluetooth\n",
"description": "Enables BLE" "description": "Tillåter BLE"
}, },
"PowerLimit": { "PowerLimit": {
"displayText": "Max-\neffekt", "displayText": "Max-\neffekt",
"description": "Maximal effekt som enheten kan använda (Watt)" "description": "Maximal effekt som enheten kan använda (Watt)"
}, },
"CalibrateCJC": { "CalibrateCJC": {
"displayText": "Calibrate CJC\nat next boot", "displayText": "Kalibrera CJC\nnästa uppstart",
"description": "At next boot tip Cold Junction Compensation will be calibrated (not required if Delta T is < 5°C)" "description": "Vid nästa uppstart kommer spets Cold Junction Compensation kalibreras (ej nödvändigt om Delta T är < 5°C)"
}, },
"VoltageCalibration": { "VoltageCalibration": {
"displayText": "Kalibrera\ninspänning?", "displayText": "Kalibrera\ninspänning?",
"description": "Inspänningskalibrering. Knapparna justerar, håll inne för avslut" "description": "Inspänningskalibrering. Knapparna justerar, håll inne för avslut"
}, },
"PowerPulsePower": { "PowerPulsePower": {
"displayText": "Power\npulse", "displayText": "Effekt\npuls",
"description": "Intensity of power of keep-awake-pulse (W=watt)" "description": "Intensiteten av effekt för håll-vaken-puls (W=watt)"
}, },
"PowerPulseWait": { "PowerPulseWait": {
"displayText": "Power pulse\ndelay", "displayText": "Effekt puls\nfördröjning",
"description": "Delay before keep-awake-pulse is triggered (x 2.5s)" "description": "Fördröjning innan håll-vaken-pulsen skickas (x 2.5s)"
}, },
"PowerPulseDuration": { "PowerPulseDuration": {
"displayText": "Power pulse\nduration", "displayText": "Effekt puls\ntidsmängd",
"description": "Keep-awake-pulse duration (x 250ms)" "description": "Håll-vaken-puls varaktighet (x 250ms)"
}, },
"SettingsReset": { "SettingsReset": {
"displayText": "Fabriks-\ninställ?", "displayText": "Fabriks-\ninställ?",

View File

@@ -4,7 +4,7 @@
"tempUnitFahrenheit": true, "tempUnitFahrenheit": true,
"messagesWarn": { "messagesWarn": {
"CalibrationDone": { "CalibrationDone": {
"message": "Calibration done!" "message": "校正完成!"
}, },
"ResetOKMessage": { "ResetOKMessage": {
"message": "已重置!" "message": "已重置!"
@@ -31,13 +31,13 @@
"message": "加热失控" "message": "加热失控"
}, },
"WarningTipShorted": { "WarningTipShorted": {
"message": "!Tip Shorted!" "message": "!烙铁头短路!"
}, },
"SettingsCalibrationWarning": { "SettingsCalibrationWarning": {
"message": "Before rebooting, make sure tip & handle are at room temperature!" "message": "在重启前请确认烙铁头及本体已完全冷却!"
}, },
"CJCCalibrating": { "CJCCalibrating": {
"message": "calibrating" "message": "校正中"
}, },
"SettingsResetWarning": { "SettingsResetWarning": {
"message": "你是否确定要将全部设定重置为默认值?" "message": "你是否确定要将全部设定重置为默认值?"
@@ -133,7 +133,7 @@
}, },
"PDVpdo": { "PDVpdo": {
"displayText": "PD VPDO", "displayText": "PD VPDO",
"description": "Enables PPS & EPR modes" "description": "启用PPS和EPR快充支持"
}, },
"BoostTemperature": { "BoostTemperature": {
"displayText": "增热温度", "displayText": "增热温度",
@@ -280,8 +280,8 @@
"description": "焊接模式画面以英语小字体显示详请" "description": "焊接模式画面以英语小字体显示详请"
}, },
"BluetoothLE": { "BluetoothLE": {
"displayText": "Bluetooth", "displayText": "蓝牙",
"description": "Enables BLE" "description": "启用蓝牙支持"
}, },
"PowerLimit": { "PowerLimit": {
"displayText": "功率限制", "displayText": "功率限制",
@@ -289,7 +289,7 @@
}, },
"CalibrateCJC": { "CalibrateCJC": {
"displayText": "校正CJC", "displayText": "校正CJC",
"description": "At next boot tip Cold Junction Compensation will be calibrated (not required if Delta T is < 5 C)" "description": "在下次重启时校正烙铁头热电偶冷接点补偿值CJC温差小于5摄氏度时无需校正"
}, },
"VoltageCalibration": { "VoltageCalibration": {
"displayText": "输入电压校正?", "displayText": "输入电压校正?",
@@ -316,4 +316,4 @@
"description": "" "description": ""
} }
} }
} }

View File

@@ -4,7 +4,7 @@
"tempUnitFahrenheit": true, "tempUnitFahrenheit": true,
"messagesWarn": { "messagesWarn": {
"CalibrationDone": { "CalibrationDone": {
"message": "Calibration done!" "message": "校正完成!"
}, },
"ResetOKMessage": { "ResetOKMessage": {
"message": "已重設!" "message": "已重設!"
@@ -31,13 +31,13 @@
"message": "加熱失控" "message": "加熱失控"
}, },
"WarningTipShorted": { "WarningTipShorted": {
"message": "!Tip Shorted!" "message": "!烙鐵頭短路!"
}, },
"SettingsCalibrationWarning": { "SettingsCalibrationWarning": {
"message": "Before rebooting, make sure tip & handle are at room temperature!" "message": "在重啟前請確認烙鐵頭及本體已完全冷卻!"
}, },
"CJCCalibrating": { "CJCCalibrating": {
"message": "calibrating" "message": "校正中"
}, },
"SettingsResetWarning": { "SettingsResetWarning": {
"message": "你是否確定要將全部設定重設到預設值?" "message": "你是否確定要將全部設定重設到預設值?"
@@ -133,7 +133,7 @@
}, },
"PDVpdo": { "PDVpdo": {
"displayText": "PD VPDO", "displayText": "PD VPDO",
"description": "Enables PPS & EPR modes" "description": "開啟PPS及EPR支援"
}, },
"BoostTemperature": { "BoostTemperature": {
"displayText": "增熱溫度", "displayText": "增熱溫度",
@@ -280,8 +280,8 @@
"description": "於焊接模式畫面以英文小字型顯示詳細資料" "description": "於焊接模式畫面以英文小字型顯示詳細資料"
}, },
"BluetoothLE": { "BluetoothLE": {
"displayText": "Bluetooth", "displayText": "藍牙",
"description": "Enables BLE" "description": "開啟藍牙支援"
}, },
"PowerLimit": { "PowerLimit": {
"displayText": "功率限制", "displayText": "功率限制",
@@ -289,7 +289,7 @@
}, },
"CalibrateCJC": { "CalibrateCJC": {
"displayText": "校正CJC", "displayText": "校正CJC",
"description": "At next boot tip Cold Junction Compensation will be calibrated (not required if Delta T is < 5 C)" "description": "在下次重啟時校正烙鐵頭熱電偶冷接點補償值CJC溫差小於5攝氏度時無需校正"
}, },
"VoltageCalibration": { "VoltageCalibration": {
"displayText": "輸入電壓校正?", "displayText": "輸入電壓校正?",
@@ -316,4 +316,4 @@
"description": "" "description": ""
} }
} }
} }

View File

@@ -36,12 +36,14 @@ nav:
- Startup Logo: Logo.md - Startup Logo: Logo.md
- Hardware: - Hardware:
- Hall Sensor (Pinecil): HallSensor.md - Hall Sensor (Pinecil): HallSensor.md
- Bluetooth (Pinecil V2): Bluetooth.md
- Hardware Notes: Hardware.md - Hardware Notes: Hardware.md
- Troubleshooting: Troubleshooting.md - Troubleshooting: Troubleshooting.md
- Known Hardware Issues: HardwareIssues.md - Known Hardware Issues: HardwareIssues.md
- Power sources: PowerSources.md - Power sources: PowerSources.md
- Translations: Translation.md - Translations: Translation.md
- Development: Development.md - Development: Development.md
- Changelog: History.md
# Plugins # Plugins
plugins: plugins:

View File

@@ -14,14 +14,13 @@ WORKDIR /build/ironos
## - clang (required for clang-format to check C++ code formatting) ## - clang (required for clang-format to check C++ code formatting)
## - shellcheck (to check sh scripts) ## - shellcheck (to check sh scripts)
ARG APK_COMPS="gcc-riscv-none-elf gcc-arm-none-eabi newlib-riscv-none-elf \ ARG APK_COMPS="gcc-riscv-none-elf gcc-arm-none-eabi newlib-riscv-none-elf newlib-arm-none-eabi"
newlib-arm-none-eabi"
ARG APK_PYTHON="python3 py3-pip black" ARG APK_PYTHON="python3 py3-pip black"
ARG APK_MISC="findutils make git diffutils zip" ARG APK_MISC="findutils make git diffutils zip"
ARG APK_DEV="musl-dev clang bash clang-extra-tools shellcheck" ARG APK_DEV="musl-dev clang bash clang-extra-tools shellcheck"
# PIP packages to check & test Python code # PIP packages to check & test Python code, and generate docs
ARG PIP_PKGS='bdflib flake8' ARG PIP_PKGS='bdflib flake8 pymdown-extensions mkdocs mkdocs-autolinks-plugin mkdocs-awesome-pages-plugin mkdocs-git-revision-date-plugin'
# Install system packages using alpine package manager # Install system packages using alpine package manager
RUN apk add --no-cache ${APK_COMPS} ${APK_PYTHON} ${APK_MISC} ${APK_DEV} RUN apk add --no-cache ${APK_COMPS} ${APK_PYTHON} ${APK_MISC} ${APK_DEV}
@@ -32,4 +31,5 @@ RUN python3 -m pip install ${PIP_PKGS}
# Git trust to avoid related warning # Git trust to avoid related warning
RUN git config --global --add safe.directory /build/ironos RUN git config --global --add safe.directory /build/ironos
# Copy the whole source tree working dir into container
COPY . /build/ironos COPY . /build/ironos

View File

@@ -17,7 +17,7 @@ usage()
echo "CMD (docker related):" echo "CMD (docker related):"
echo -e "\tshell - start docker container with shell inside to work on IronOS with all tools needed" echo -e "\tshell - start docker container with shell inside to work on IronOS with all tools needed"
echo -e "\tbuild - compile builds of IronOS inside docker container for supported hardware" echo -e "\tbuild - compile builds of IronOS inside docker container for supported hardware"
echo -e "\tclean - delete created docker container (but not pre-downloaded data for it)\n" echo -e "\tclean - delete created docker image for IronOS & its build cache objects\n"
echo "CMD (helper routines):" echo "CMD (helper routines):"
echo -e "\tdocs_readme - generate & OVERWRITE(!) README.md inside Documentation/ based on nav section from mkdocs.yml if it changed\n" echo -e "\tdocs_readme - generate & OVERWRITE(!) README.md inside Documentation/ based on nav section from mkdocs.yml if it changed\n"
echo -e "\tcheck_style_file SRC - run code style checks based on clang-format & custom parsers for source code file SRC\n" echo -e "\tcheck_style_file SRC - run code style checks based on clang-format & custom parsers for source code file SRC\n"
@@ -194,6 +194,7 @@ elif [ "${cmd}" = "build" ]; then
docker_cmd="run --rm builder make build-all OUT=${OUT}" docker_cmd="run --rm builder make build-all OUT=${OUT}"
elif [ "${cmd}" = "clean" ]; then elif [ "${cmd}" = "clean" ]; then
docker rmi ironos-builder:latest docker rmi ironos-builder:latest
docker system prune --filter label=ironos-builder:latest --force
exit "${?}" exit "${?}"
else else
usage usage

View File

@@ -3,9 +3,11 @@
#include "BSP_Power.h" #include "BSP_Power.h"
#include "BSP_QC.h" #include "BSP_QC.h"
#include "Defines.h" #include "Defines.h"
#include "Types.h"
#include "configuration.h" #include "configuration.h"
#include <stdbool.h> #include <stdbool.h>
#include <stdint.h> #include <stdint.h>
/* /*
* BSP.h -- Board Support * BSP.h -- Board Support
* *

View File

@@ -19,9 +19,8 @@ void power_check();
// Returns the tip resistance in x10 ohms, so 7.5 = 75; 14=140 etc // Returns the tip resistance in x10 ohms, so 7.5 = 75; 14=140 etc
uint8_t getTipResistanceX10(); uint8_t getTipResistanceX10();
uint8_t getTipThermalMass(); uint16_t getTipThermalMass();
uint8_t getTipInertia(); uint16_t getTipInertia();
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@@ -263,25 +263,6 @@ void unstick_I2C() {
int timeout = 100; int timeout = 100;
int timeout_cnt = 0; int timeout_cnt = 0;
// 1. Clear PE bit.
hi2c1.Instance->CR1 &= ~(0x0001);
/**I2C1 GPIO Configuration
PB6 ------> I2C1_SCL
PB7 ------> I2C1_SDA
*/
// 2. Configure the SCL and SDA I/Os as General Purpose Output Open-Drain, High level (Write 1 to GPIOx_ODR).
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_OD;
GPIO_InitStruct.Pull = GPIO_PULLUP;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
GPIO_InitStruct.Pin = SCL_Pin;
HAL_GPIO_Init(SCL_GPIO_Port, &GPIO_InitStruct);
HAL_GPIO_WritePin(SCL_GPIO_Port, SCL_Pin, GPIO_PIN_SET);
GPIO_InitStruct.Pin = SDA_Pin;
HAL_GPIO_Init(SDA_GPIO_Port, &GPIO_InitStruct);
HAL_GPIO_WritePin(SDA_GPIO_Port, SDA_Pin, GPIO_PIN_SET);
while (GPIO_PIN_SET != HAL_GPIO_ReadPin(SDA_GPIO_Port, SDA_Pin)) { while (GPIO_PIN_SET != HAL_GPIO_ReadPin(SDA_GPIO_Port, SDA_Pin)) {
// Move clock to release I2C // Move clock to release I2C
HAL_GPIO_WritePin(SCL_GPIO_Port, SCL_Pin, GPIO_PIN_RESET); HAL_GPIO_WritePin(SCL_GPIO_Port, SCL_Pin, GPIO_PIN_RESET);
@@ -295,36 +276,6 @@ void unstick_I2C() {
if (timeout_cnt > timeout) if (timeout_cnt > timeout)
return; return;
} }
// 12. Configure the SCL and SDA I/Os as Alternate function Open-Drain.
GPIO_InitStruct.Mode = GPIO_MODE_AF_OD;
GPIO_InitStruct.Pull = GPIO_PULLUP;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
GPIO_InitStruct.Pin = SCL_Pin;
HAL_GPIO_Init(SCL_GPIO_Port, &GPIO_InitStruct);
GPIO_InitStruct.Pin = SDA_Pin;
HAL_GPIO_Init(SDA_GPIO_Port, &GPIO_InitStruct);
HAL_GPIO_WritePin(SCL_GPIO_Port, SCL_Pin, GPIO_PIN_SET);
HAL_GPIO_WritePin(SDA_GPIO_Port, SDA_Pin, GPIO_PIN_SET);
// 13. Set SWRST bit in I2Cx_CR1 register.
hi2c1.Instance->CR1 |= 0x8000;
asm("nop");
// 14. Clear SWRST bit in I2Cx_CR1 register.
hi2c1.Instance->CR1 &= ~0x8000;
asm("nop");
// 15. Enable the I2C peripheral by setting the PE bit in I2Cx_CR1 register
hi2c1.Instance->CR1 |= 0x0001;
// Call initialization function.
HAL_I2C_Init(&hi2c1);
} }
uint8_t getButtonA() { return HAL_GPIO_ReadPin(KEY_A_GPIO_Port, KEY_A_Pin) == GPIO_PIN_RESET ? 1 : 0; } uint8_t getButtonA() { return HAL_GPIO_ReadPin(KEY_A_GPIO_Port, KEY_A_Pin) == GPIO_PIN_RESET ? 1 : 0; }
@@ -472,7 +423,7 @@ uint64_t getDeviceID() {
uint8_t preStartChecksDone() { return 1; } uint8_t preStartChecksDone() { return 1; }
uint8_t getTipThermalMass() { return TIP_THERMAL_MASS; } uint16_t getTipThermalMass() { return TIP_THERMAL_MASS; }
uint8_t getTipInertia() { return TIP_THERMAL_MASS; } uint16_t getTipInertia() { return TIP_THERMAL_MASS; }
void showBootLogo(void) { BootLogo::handleShowingLogo((uint8_t *)FLASH_LOGOADDR); } void showBootLogo(void) { BootLogo::handleShowingLogo((uint8_t *)FLASH_LOGOADDR); }

View File

@@ -1,91 +0,0 @@
/*
* FRToSI2C.cpp
*
* Created on: 14Apr.,2018
* Author: Ralim
*/
#include "BSP.h"
#include "Setup.h"
#include <I2C_Wrapper.hpp>
SemaphoreHandle_t FRToSI2C::I2CSemaphore = nullptr;
StaticSemaphore_t FRToSI2C::xSemaphoreBuffer;
void FRToSI2C::CpltCallback() {
hi2c1.State = HAL_I2C_STATE_READY; // Force state reset (even if tx error)
if (I2CSemaphore) {
xSemaphoreGiveFromISR(I2CSemaphore, NULL);
}
}
bool FRToSI2C::Mem_Read(uint16_t DevAddress, uint16_t MemAddress, uint8_t *pData, uint16_t Size) {
if (!lock())
return false;
if (HAL_I2C_Mem_Read(&hi2c1, DevAddress, MemAddress, I2C_MEMADD_SIZE_8BIT, pData, Size, 500) != HAL_OK) {
I2C_Unstick();
unlock();
return false;
}
unlock();
return true;
}
bool FRToSI2C::I2C_RegisterWrite(uint8_t address, uint8_t reg, uint8_t data) { return Mem_Write(address, reg, &data, 1); }
uint8_t FRToSI2C::I2C_RegisterRead(uint8_t add, uint8_t reg) {
uint8_t tx_data[1];
Mem_Read(add, reg, tx_data, 1);
return tx_data[0];
}
bool FRToSI2C::Mem_Write(uint16_t DevAddress, uint16_t MemAddress, uint8_t *pData, uint16_t Size) {
if (!lock())
return false;
if (HAL_I2C_Mem_Write(&hi2c1, DevAddress, MemAddress, I2C_MEMADD_SIZE_8BIT, pData, Size, 500) != HAL_OK) {
I2C_Unstick();
unlock();
return false;
}
unlock();
return true;
}
bool FRToSI2C::Transmit(uint16_t DevAddress, uint8_t *pData, uint16_t Size) {
if (!lock())
return false;
if (HAL_I2C_Master_Transmit_DMA(&hi2c1, DevAddress, pData, Size) != HAL_OK) {
I2C_Unstick();
unlock();
return false;
}
return true;
}
bool FRToSI2C::probe(uint16_t DevAddress) {
if (!lock())
return false;
uint8_t buffer[1];
bool worked = HAL_I2C_Mem_Read(&hi2c1, DevAddress, 0x0F, I2C_MEMADD_SIZE_8BIT, buffer, 1, 1000) == HAL_OK;
unlock();
return worked;
}
void FRToSI2C::I2C_Unstick() { unstick_I2C(); }
void FRToSI2C::unlock() { xSemaphoreGive(I2CSemaphore); }
bool FRToSI2C::lock() { return xSemaphoreTake(I2CSemaphore, (TickType_t)50) == pdTRUE; }
bool FRToSI2C::writeRegistersBulk(const uint8_t address, const I2C_REG *registers, const uint8_t registersLength) {
for (int index = 0; index < registersLength; index++) {
if (!I2C_RegisterWrite(address, registers[index].reg, registers[index].val)) {
return false;
}
if (registers[index].pause_ms)
delay_ms(registers[index].pause_ms);
}
return true;
}

View File

@@ -27,12 +27,6 @@ void HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef *hadc) {
} }
} }
} }
void HAL_I2C_MasterRxCpltCallback(I2C_HandleTypeDef *hi2c __unused) { FRToSI2C::CpltCallback(); }
void HAL_I2C_MasterTxCpltCallback(I2C_HandleTypeDef *hi2c __unused) { FRToSI2C::CpltCallback(); }
void HAL_I2C_MemTxCpltCallback(I2C_HandleTypeDef *hi2c __unused) { FRToSI2C::CpltCallback(); }
void HAL_I2C_ErrorCallback(I2C_HandleTypeDef *hi2c __unused) { FRToSI2C::CpltCallback(); }
void HAL_I2C_AbortCpltCallback(I2C_HandleTypeDef *hi2c __unused) { FRToSI2C::CpltCallback(); }
void HAL_I2C_MemRxCpltCallback(I2C_HandleTypeDef *hi2c __unused) { FRToSI2C::CpltCallback(); }
extern osThreadId POWTaskHandle; extern osThreadId POWTaskHandle;
void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin) { void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin) {

View File

@@ -18,12 +18,6 @@
extern "C" { extern "C" {
#endif #endif
void HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef *hadc); void HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef *hadc);
void HAL_I2C_ErrorCallback(I2C_HandleTypeDef *hi2c);
void HAL_I2C_AbortCpltCallback(I2C_HandleTypeDef *hi2c);
void HAL_I2C_MasterTxCpltCallback(I2C_HandleTypeDef *hi2c);
void HAL_I2C_MasterRxCpltCallback(I2C_HandleTypeDef *hi2c);
void HAL_I2C_MemTxCpltCallback(I2C_HandleTypeDef *hi2c);
void HAL_I2C_MemRxCpltCallback(I2C_HandleTypeDef *hi2c);
void HAL_GPIO_EXTI_Callback(uint16_t); void HAL_GPIO_EXTI_Callback(uint16_t);
#ifdef __cplusplus #ifdef __cplusplus

View File

@@ -11,10 +11,6 @@ ADC_HandleTypeDef hadc1;
ADC_HandleTypeDef hadc2; ADC_HandleTypeDef hadc2;
DMA_HandleTypeDef hdma_adc1; DMA_HandleTypeDef hdma_adc1;
I2C_HandleTypeDef hi2c1;
DMA_HandleTypeDef hdma_i2c1_rx;
DMA_HandleTypeDef hdma_i2c1_tx;
IWDG_HandleTypeDef hiwdg; IWDG_HandleTypeDef hiwdg;
TIM_HandleTypeDef htim2; TIM_HandleTypeDef htim2;
TIM_HandleTypeDef htim3; TIM_HandleTypeDef htim3;
@@ -25,7 +21,7 @@ uint32_t ADCReadings[ADC_SAMPLES * ADC_CHANNELS]; // room for 32 lots of the pai
// Functions // Functions
static void SystemClock_Config(void); static void SystemClock_Config(void);
static void MX_ADC1_Init(void); static void MX_ADC1_Init(void);
static void MX_I2C1_Init(void);
static void MX_IWDG_Init(void); static void MX_IWDG_Init(void);
static void MX_TIM3_Init(void); static void MX_TIM3_Init(void);
static void MX_TIM2_Init(void); static void MX_TIM2_Init(void);
@@ -39,7 +35,7 @@ void Setup_HAL() {
MX_GPIO_Init(); MX_GPIO_Init();
MX_DMA_Init(); MX_DMA_Init();
MX_I2C1_Init();
MX_ADC1_Init(); MX_ADC1_Init();
MX_ADC2_Init(); MX_ADC2_Init();
MX_TIM3_Init(); MX_TIM3_Init();
@@ -196,19 +192,6 @@ static void MX_ADC2_Init(void) {
; ;
} }
} }
/* I2C1 init function */
static void MX_I2C1_Init(void) {
hi2c1.Instance = I2C1;
hi2c1.Init.ClockSpeed = 300000;
hi2c1.Init.DutyCycle = I2C_DUTYCYCLE_2;
hi2c1.Init.OwnAddress1 = 0;
hi2c1.Init.AddressingMode = I2C_ADDRESSINGMODE_7BIT;
hi2c1.Init.DualAddressMode = I2C_DUALADDRESS_DISABLE;
hi2c1.Init.OwnAddress2 = 0;
hi2c1.Init.GeneralCallMode = I2C_GENERALCALL_DISABLE;
hi2c1.Init.NoStretchMode = I2C_NOSTRETCH_DISABLE;
HAL_I2C_Init(&hi2c1);
}
/* IWDG init function */ /* IWDG init function */
static void MX_IWDG_Init(void) { static void MX_IWDG_Init(void) {

View File

@@ -20,7 +20,6 @@ extern DMA_HandleTypeDef hdma_adc1;
extern DMA_HandleTypeDef hdma_i2c1_rx; extern DMA_HandleTypeDef hdma_i2c1_rx;
extern DMA_HandleTypeDef hdma_i2c1_tx; extern DMA_HandleTypeDef hdma_i2c1_tx;
extern I2C_HandleTypeDef hi2c1;
extern IWDG_HandleTypeDef hiwdg; extern IWDG_HandleTypeDef hiwdg;

View File

@@ -18,13 +18,26 @@
#define SOFT_SDA2_LOW() HAL_GPIO_WritePin(SDA2_GPIO_Port, SDA2_Pin, GPIO_PIN_RESET) #define SOFT_SDA2_LOW() HAL_GPIO_WritePin(SDA2_GPIO_Port, SDA2_Pin, GPIO_PIN_RESET)
#define SOFT_SDA2_READ() (HAL_GPIO_ReadPin(SDA2_GPIO_Port, SDA2_Pin) == GPIO_PIN_SET ? 1 : 0) #define SOFT_SDA2_READ() (HAL_GPIO_ReadPin(SDA2_GPIO_Port, SDA2_Pin) == GPIO_PIN_SET ? 1 : 0)
#define SOFT_SCL2_READ() (HAL_GPIO_ReadPin(SCL2_GPIO_Port, SCL2_Pin) == GPIO_PIN_SET ? 1 : 0) #define SOFT_SCL2_READ() (HAL_GPIO_ReadPin(SCL2_GPIO_Port, SCL2_Pin) == GPIO_PIN_SET ? 1 : 0)
#endif
#ifdef I2C_SOFT_BUS_1
#define SOFT_SCL1_HIGH() HAL_GPIO_WritePin(SCL_GPIO_Port, SCL_Pin, GPIO_PIN_SET)
#define SOFT_SCL1_LOW() HAL_GPIO_WritePin(SCL_GPIO_Port, SCL_Pin, GPIO_PIN_RESET)
#define SOFT_SDA1_HIGH() HAL_GPIO_WritePin(SDA_GPIO_Port, SDA_Pin, GPIO_PIN_SET)
#define SOFT_SDA1_LOW() HAL_GPIO_WritePin(SDA_GPIO_Port, SDA_Pin, GPIO_PIN_RESET)
#define SOFT_SDA1_READ() (HAL_GPIO_ReadPin(SDA_GPIO_Port, SDA_Pin) == GPIO_PIN_SET ? 1 : 0)
#define SOFT_SCL1_READ() (HAL_GPIO_ReadPin(SCL_GPIO_Port, SCL_Pin) == GPIO_PIN_SET ? 1 : 0)
#endif
#define SOFT_I2C_DELAY() \ #define SOFT_I2C_DELAY() \
{ \ { \
for (int xx = 0; xx < 20; xx++) { \ for (int xx = 0; xx < 15; xx++) { \
asm("nop"); \ asm("nop"); \
} \ } \
} }
#endif // 40 ~= 100kHz; 15 gives around 250kHz or so which is fast _and_ stable
#endif /* BSP_MINIWARE_SOFTWARE_I2C_H_ */ #endif /* BSP_MINIWARE_SOFTWARE_I2C_H_ */

View File

@@ -6,10 +6,12 @@
*/ */
#include "Setup.h" #include "Setup.h"
#include "TipThermoModel.h" #include "TipThermoModel.h"
#include "Types.h"
#include "Utils.h" #include "Utils.h"
#include "configuration.h" #include "configuration.h"
extern uint16_t tipSenseResistancex10Ohms;
uint32_t TipThermoModel::convertuVToDegC(uint32_t tipuVDelta) { extern uint16_t tipSenseResistancex10Ohms;
TemperatureType_t TipThermoModel::convertuVToDegC(uint32_t tipuVDelta) {
// For the MHP30, we are mimicing the original code and using the resistor fitted to the base of the heater head, // For the MHP30, we are mimicing the original code and using the resistor fitted to the base of the heater head,
// this is measured at boot in pid task and in the disconnected tip check if tip is removed // this is measured at boot in pid task and in the disconnected tip check if tip is removed
if (tipSenseResistancex10Ohms > 900 && tipSenseResistancex10Ohms <= 1100) { if (tipSenseResistancex10Ohms > 900 && tipSenseResistancex10Ohms <= 1100) {

View File

@@ -1,728 +0,0 @@
/**
******************************************************************************
* @file stm32f1xx_hal_i2c.h
* @author MCD Application Team
* @brief Header file of I2C HAL module.
******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics.
* All rights reserved.</center></h2>
*
* This software component is licensed by ST under BSD 3-Clause license,
* the "License"; You may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
* opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __STM32F1xx_HAL_I2C_H
#define __STM32F1xx_HAL_I2C_H
#ifdef __cplusplus
extern "C" {
#endif
/* Includes ------------------------------------------------------------------*/
#include "stm32f1xx_hal_def.h"
/** @addtogroup STM32F1xx_HAL_Driver
* @{
*/
/** @addtogroup I2C
* @{
*/
/* Exported types ------------------------------------------------------------*/
/** @defgroup I2C_Exported_Types I2C Exported Types
* @{
*/
/** @defgroup I2C_Configuration_Structure_definition I2C Configuration Structure definition
* @brief I2C Configuration Structure definition
* @{
*/
typedef struct {
uint32_t ClockSpeed; /*!< Specifies the clock frequency.
This parameter must be set to a value lower than 400kHz */
uint32_t DutyCycle; /*!< Specifies the I2C fast mode duty cycle.
This parameter can be a value of @ref I2C_duty_cycle_in_fast_mode */
uint32_t OwnAddress1; /*!< Specifies the first device own address.
This parameter can be a 7-bit or 10-bit address. */
uint32_t AddressingMode; /*!< Specifies if 7-bit or 10-bit addressing mode is selected.
This parameter can be a value of @ref I2C_addressing_mode */
uint32_t DualAddressMode; /*!< Specifies if dual addressing mode is selected.
This parameter can be a value of @ref I2C_dual_addressing_mode */
uint32_t OwnAddress2; /*!< Specifies the second device own address if dual addressing mode is selected
This parameter can be a 7-bit address. */
uint32_t GeneralCallMode; /*!< Specifies if general call mode is selected.
This parameter can be a value of @ref I2C_general_call_addressing_mode */
uint32_t NoStretchMode; /*!< Specifies if nostretch mode is selected.
This parameter can be a value of @ref I2C_nostretch_mode */
} I2C_InitTypeDef;
/**
* @}
*/
/** @defgroup HAL_state_structure_definition HAL state structure definition
* @brief HAL State structure definition
* @note HAL I2C State value coding follow below described bitmap :
* b7-b6 Error information
* 00 : No Error
* 01 : Abort (Abort user request on going)
* 10 : Timeout
* 11 : Error
* b5 Peripheral initilisation status
* 0 : Reset (Peripheral not initialized)
* 1 : Init done (Peripheral initialized and ready to use. HAL I2C Init function called)
* b4 (not used)
* x : Should be set to 0
* b3
* 0 : Ready or Busy (No Listen mode ongoing)
* 1 : Listen (Peripheral in Address Listen Mode)
* b2 Intrinsic process state
* 0 : Ready
* 1 : Busy (Peripheral busy with some configuration or internal operations)
* b1 Rx state
* 0 : Ready (no Rx operation ongoing)
* 1 : Busy (Rx operation ongoing)
* b0 Tx state
* 0 : Ready (no Tx operation ongoing)
* 1 : Busy (Tx operation ongoing)
* @{
*/
typedef enum {
HAL_I2C_STATE_RESET = 0x00U, /*!< Peripheral is not yet Initialized */
HAL_I2C_STATE_READY = 0x20U, /*!< Peripheral Initialized and ready for use */
HAL_I2C_STATE_BUSY = 0x24U, /*!< An internal process is ongoing */
HAL_I2C_STATE_BUSY_TX = 0x21U, /*!< Data Transmission process is ongoing */
HAL_I2C_STATE_BUSY_RX = 0x22U, /*!< Data Reception process is ongoing */
HAL_I2C_STATE_LISTEN = 0x28U, /*!< Address Listen Mode is ongoing */
HAL_I2C_STATE_BUSY_TX_LISTEN = 0x29U, /*!< Address Listen Mode and Data Transmission
process is ongoing */
HAL_I2C_STATE_BUSY_RX_LISTEN = 0x2AU, /*!< Address Listen Mode and Data Reception
process is ongoing */
HAL_I2C_STATE_ABORT = 0x60U, /*!< Abort user request ongoing */
HAL_I2C_STATE_TIMEOUT = 0xA0U, /*!< Timeout state */
HAL_I2C_STATE_ERROR = 0xE0U /*!< Error */
} HAL_I2C_StateTypeDef;
/**
* @}
*/
/** @defgroup HAL_mode_structure_definition HAL mode structure definition
* @brief HAL Mode structure definition
* @note HAL I2C Mode value coding follow below described bitmap :\n
* b7 (not used)\n
* x : Should be set to 0\n
* b6\n
* 0 : None\n
* 1 : Memory (HAL I2C communication is in Memory Mode)\n
* b5\n
* 0 : None\n
* 1 : Slave (HAL I2C communication is in Slave Mode)\n
* b4\n
* 0 : None\n
* 1 : Master (HAL I2C communication is in Master Mode)\n
* b3-b2-b1-b0 (not used)\n
* xxxx : Should be set to 0000
* @{
*/
typedef enum {
HAL_I2C_MODE_NONE = 0x00U, /*!< No I2C communication on going */
HAL_I2C_MODE_MASTER = 0x10U, /*!< I2C communication is in Master Mode */
HAL_I2C_MODE_SLAVE = 0x20U, /*!< I2C communication is in Slave Mode */
HAL_I2C_MODE_MEM = 0x40U /*!< I2C communication is in Memory Mode */
} HAL_I2C_ModeTypeDef;
/**
* @}
*/
/** @defgroup I2C_Error_Code_definition I2C Error Code definition
* @brief I2C Error Code definition
* @{
*/
#define HAL_I2C_ERROR_NONE 0x00000000U /*!< No error */
#define HAL_I2C_ERROR_BERR 0x00000001U /*!< BERR error */
#define HAL_I2C_ERROR_ARLO 0x00000002U /*!< ARLO error */
#define HAL_I2C_ERROR_AF 0x00000004U /*!< AF error */
#define HAL_I2C_ERROR_OVR 0x00000008U /*!< OVR error */
#define HAL_I2C_ERROR_DMA 0x00000010U /*!< DMA transfer error */
#define HAL_I2C_ERROR_TIMEOUT 0x00000020U /*!< Timeout Error */
#define HAL_I2C_ERROR_SIZE 0x00000040U /*!< Size Management error */
#define HAL_I2C_ERROR_DMA_PARAM 0x00000080U /*!< DMA Parameter Error */
#define HAL_I2C_WRONG_START 0x00000200U /*!< Wrong start Error */
#if (USE_HAL_I2C_REGISTER_CALLBACKS == 1)
#define HAL_I2C_ERROR_INVALID_CALLBACK 0x00000100U /*!< Invalid Callback error */
#endif /* USE_HAL_I2C_REGISTER_CALLBACKS */
/**
* @}
*/
/** @defgroup I2C_handle_Structure_definition I2C handle Structure definition
* @brief I2C handle Structure definition
* @{
*/
#if (USE_HAL_I2C_REGISTER_CALLBACKS == 1)
typedef struct __I2C_HandleTypeDef
#else
typedef struct
#endif /* USE_HAL_I2C_REGISTER_CALLBACKS */
{
I2C_TypeDef *Instance; /*!< I2C registers base address */
I2C_InitTypeDef Init; /*!< I2C communication parameters */
uint8_t *pBuffPtr; /*!< Pointer to I2C transfer buffer */
uint16_t XferSize; /*!< I2C transfer size */
__IO uint16_t XferCount; /*!< I2C transfer counter */
__IO uint32_t XferOptions; /*!< I2C transfer options */
__IO uint32_t PreviousState; /*!< I2C communication Previous state and mode
context for internal usage */
DMA_HandleTypeDef *hdmatx; /*!< I2C Tx DMA handle parameters */
DMA_HandleTypeDef *hdmarx; /*!< I2C Rx DMA handle parameters */
HAL_LockTypeDef Lock; /*!< I2C locking object */
__IO HAL_I2C_StateTypeDef State; /*!< I2C communication state */
__IO HAL_I2C_ModeTypeDef Mode; /*!< I2C communication mode */
__IO uint32_t ErrorCode; /*!< I2C Error code */
__IO uint32_t Devaddress; /*!< I2C Target device address */
__IO uint32_t Memaddress; /*!< I2C Target memory address */
__IO uint32_t MemaddSize; /*!< I2C Target memory address size */
__IO uint32_t EventCount; /*!< I2C Event counter */
#ifndef USE_HAL_I2C_REGISTER_CALLBACKS
#define USE_HAL_I2C_REGISTER_CALLBACKS 0
#endif
#if (USE_HAL_I2C_REGISTER_CALLBACKS == 1)
void (*MasterTxCpltCallback)(struct __I2C_HandleTypeDef *hi2c); /*!< I2C Master Tx Transfer completed callback */
void (*MasterRxCpltCallback)(struct __I2C_HandleTypeDef *hi2c); /*!< I2C Master Rx Transfer completed callback */
void (*SlaveTxCpltCallback)(struct __I2C_HandleTypeDef *hi2c); /*!< I2C Slave Tx Transfer completed callback */
void (*SlaveRxCpltCallback)(struct __I2C_HandleTypeDef *hi2c); /*!< I2C Slave Rx Transfer completed callback */
void (*ListenCpltCallback)(struct __I2C_HandleTypeDef *hi2c); /*!< I2C Listen Complete callback */
void (*MemTxCpltCallback)(struct __I2C_HandleTypeDef *hi2c); /*!< I2C Memory Tx Transfer completed callback */
void (*MemRxCpltCallback)(struct __I2C_HandleTypeDef *hi2c); /*!< I2C Memory Rx Transfer completed callback */
void (*ErrorCallback)(struct __I2C_HandleTypeDef *hi2c); /*!< I2C Error callback */
void (*AbortCpltCallback)(struct __I2C_HandleTypeDef *hi2c); /*!< I2C Abort callback */
void (*AddrCallback)(struct __I2C_HandleTypeDef *hi2c, uint8_t TransferDirection, uint16_t AddrMatchCode); /*!< I2C Slave Address Match callback */
void (*MspInitCallback)(struct __I2C_HandleTypeDef *hi2c); /*!< I2C Msp Init callback */
void (*MspDeInitCallback)(struct __I2C_HandleTypeDef *hi2c); /*!< I2C Msp DeInit callback */
#endif /* USE_HAL_I2C_REGISTER_CALLBACKS */
} I2C_HandleTypeDef;
#if (USE_HAL_I2C_REGISTER_CALLBACKS == 1)
/**
* @brief HAL I2C Callback ID enumeration definition
*/
typedef enum {
HAL_I2C_MASTER_TX_COMPLETE_CB_ID = 0x00U, /*!< I2C Master Tx Transfer completed callback ID */
HAL_I2C_MASTER_RX_COMPLETE_CB_ID = 0x01U, /*!< I2C Master Rx Transfer completed callback ID */
HAL_I2C_SLAVE_TX_COMPLETE_CB_ID = 0x02U, /*!< I2C Slave Tx Transfer completed callback ID */
HAL_I2C_SLAVE_RX_COMPLETE_CB_ID = 0x03U, /*!< I2C Slave Rx Transfer completed callback ID */
HAL_I2C_LISTEN_COMPLETE_CB_ID = 0x04U, /*!< I2C Listen Complete callback ID */
HAL_I2C_MEM_TX_COMPLETE_CB_ID = 0x05U, /*!< I2C Memory Tx Transfer callback ID */
HAL_I2C_MEM_RX_COMPLETE_CB_ID = 0x06U, /*!< I2C Memory Rx Transfer completed callback ID */
HAL_I2C_ERROR_CB_ID = 0x07U, /*!< I2C Error callback ID */
HAL_I2C_ABORT_CB_ID = 0x08U, /*!< I2C Abort callback ID */
HAL_I2C_MSPINIT_CB_ID = 0x09U, /*!< I2C Msp Init callback ID */
HAL_I2C_MSPDEINIT_CB_ID = 0x0AU /*!< I2C Msp DeInit callback ID */
} HAL_I2C_CallbackIDTypeDef;
/**
* @brief HAL I2C Callback pointer definition
*/
typedef void (*pI2C_CallbackTypeDef)(I2C_HandleTypeDef *hi2c); /*!< pointer to an I2C callback function */
typedef void (*pI2C_AddrCallbackTypeDef)(I2C_HandleTypeDef *hi2c, uint8_t TransferDirection, uint16_t AddrMatchCode); /*!< pointer to an I2C Address Match callback function */
#endif /* USE_HAL_I2C_REGISTER_CALLBACKS */
/**
* @}
*/
/**
* @}
*/
/* Exported constants --------------------------------------------------------*/
/** @defgroup I2C_Exported_Constants I2C Exported Constants
* @{
*/
/** @defgroup I2C_duty_cycle_in_fast_mode I2C duty cycle in fast mode
* @{
*/
#define I2C_DUTYCYCLE_2 0x00000000U
#define I2C_DUTYCYCLE_16_9 I2C_CCR_DUTY
/**
* @}
*/
/** @defgroup I2C_addressing_mode I2C addressing mode
* @{
*/
#define I2C_ADDRESSINGMODE_7BIT 0x00004000U
#define I2C_ADDRESSINGMODE_10BIT (I2C_OAR1_ADDMODE | 0x00004000U)
/**
* @}
*/
/** @defgroup I2C_dual_addressing_mode I2C dual addressing mode
* @{
*/
#define I2C_DUALADDRESS_DISABLE 0x00000000U
#define I2C_DUALADDRESS_ENABLE I2C_OAR2_ENDUAL
/**
* @}
*/
/** @defgroup I2C_general_call_addressing_mode I2C general call addressing mode
* @{
*/
#define I2C_GENERALCALL_DISABLE 0x00000000U
#define I2C_GENERALCALL_ENABLE I2C_CR1_ENGC
/**
* @}
*/
/** @defgroup I2C_nostretch_mode I2C nostretch mode
* @{
*/
#define I2C_NOSTRETCH_DISABLE 0x00000000U
#define I2C_NOSTRETCH_ENABLE I2C_CR1_NOSTRETCH
/**
* @}
*/
/** @defgroup I2C_Memory_Address_Size I2C Memory Address Size
* @{
*/
#define I2C_MEMADD_SIZE_8BIT 0x00000001U
#define I2C_MEMADD_SIZE_16BIT 0x00000010U
/**
* @}
*/
/** @defgroup I2C_XferDirection_definition I2C XferDirection definition
* @{
*/
#define I2C_DIRECTION_RECEIVE 0x00000000U
#define I2C_DIRECTION_TRANSMIT 0x00000001U
/**
* @}
*/
/** @defgroup I2C_XferOptions_definition I2C XferOptions definition
* @{
*/
#define I2C_FIRST_FRAME 0x00000001U
#define I2C_FIRST_AND_NEXT_FRAME 0x00000002U
#define I2C_NEXT_FRAME 0x00000004U
#define I2C_FIRST_AND_LAST_FRAME 0x00000008U
#define I2C_LAST_FRAME_NO_STOP 0x00000010U
#define I2C_LAST_FRAME 0x00000020U
/* List of XferOptions in usage of :
* 1- Restart condition in all use cases (direction change or not)
*/
#define I2C_OTHER_FRAME (0x00AA0000U)
#define I2C_OTHER_AND_LAST_FRAME (0xAA000000U)
/**
* @}
*/
/** @defgroup I2C_Interrupt_configuration_definition I2C Interrupt configuration definition
* @brief I2C Interrupt definition
* Elements values convention: 0xXXXXXXXX
* - XXXXXXXX : Interrupt control mask
* @{
*/
#define I2C_IT_BUF I2C_CR2_ITBUFEN
#define I2C_IT_EVT I2C_CR2_ITEVTEN
#define I2C_IT_ERR I2C_CR2_ITERREN
/**
* @}
*/
/** @defgroup I2C_Flag_definition I2C Flag definition
* @{
*/
#define I2C_FLAG_OVR 0x00010800U
#define I2C_FLAG_AF 0x00010400U
#define I2C_FLAG_ARLO 0x00010200U
#define I2C_FLAG_BERR 0x00010100U
#define I2C_FLAG_TXE 0x00010080U
#define I2C_FLAG_RXNE 0x00010040U
#define I2C_FLAG_STOPF 0x00010010U
#define I2C_FLAG_ADD10 0x00010008U
#define I2C_FLAG_BTF 0x00010004U
#define I2C_FLAG_ADDR 0x00010002U
#define I2C_FLAG_SB 0x00010001U
#define I2C_FLAG_DUALF 0x00100080U
#define I2C_FLAG_GENCALL 0x00100010U
#define I2C_FLAG_TRA 0x00100004U
#define I2C_FLAG_BUSY 0x00100002U
#define I2C_FLAG_MSL 0x00100001U
/**
* @}
*/
/**
* @}
*/
/* Exported macros -----------------------------------------------------------*/
/** @defgroup I2C_Exported_Macros I2C Exported Macros
* @{
*/
/** @brief Reset I2C handle state.
* @param __HANDLE__ specifies the I2C Handle.
* @retval None
*/
#if (USE_HAL_I2C_REGISTER_CALLBACKS == 1)
#define __HAL_I2C_RESET_HANDLE_STATE(__HANDLE__) \
do { \
(__HANDLE__)->State = HAL_I2C_STATE_RESET; \
(__HANDLE__)->MspInitCallback = NULL; \
(__HANDLE__)->MspDeInitCallback = NULL; \
} while (0)
#else
#define __HAL_I2C_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_I2C_STATE_RESET)
#endif
/** @brief Enable or disable the specified I2C interrupts.
* @param __HANDLE__ specifies the I2C Handle.
* @param __INTERRUPT__ specifies the interrupt source to enable or disable.
* This parameter can be one of the following values:
* @arg I2C_IT_BUF: Buffer interrupt enable
* @arg I2C_IT_EVT: Event interrupt enable
* @arg I2C_IT_ERR: Error interrupt enable
* @retval None
*/
#define __HAL_I2C_ENABLE_IT(__HANDLE__, __INTERRUPT__) SET_BIT((__HANDLE__)->Instance->CR2, (__INTERRUPT__))
#define __HAL_I2C_DISABLE_IT(__HANDLE__, __INTERRUPT__) CLEAR_BIT((__HANDLE__)->Instance->CR2, (__INTERRUPT__))
/** @brief Checks if the specified I2C interrupt source is enabled or disabled.
* @param __HANDLE__ specifies the I2C Handle.
* @param __INTERRUPT__ specifies the I2C interrupt source to check.
* This parameter can be one of the following values:
* @arg I2C_IT_BUF: Buffer interrupt enable
* @arg I2C_IT_EVT: Event interrupt enable
* @arg I2C_IT_ERR: Error interrupt enable
* @retval The new state of __INTERRUPT__ (TRUE or FALSE).
*/
#define __HAL_I2C_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) ((((__HANDLE__)->Instance->CR2 & (__INTERRUPT__)) == (__INTERRUPT__)) ? SET : RESET)
/** @brief Checks whether the specified I2C flag is set or not.
* @param __HANDLE__ specifies the I2C Handle.
* @param __FLAG__ specifies the flag to check.
* This parameter can be one of the following values:
* @arg I2C_FLAG_OVR: Overrun/Underrun flag
* @arg I2C_FLAG_AF: Acknowledge failure flag
* @arg I2C_FLAG_ARLO: Arbitration lost flag
* @arg I2C_FLAG_BERR: Bus error flag
* @arg I2C_FLAG_TXE: Data register empty flag
* @arg I2C_FLAG_RXNE: Data register not empty flag
* @arg I2C_FLAG_STOPF: Stop detection flag
* @arg I2C_FLAG_ADD10: 10-bit header sent flag
* @arg I2C_FLAG_BTF: Byte transfer finished flag
* @arg I2C_FLAG_ADDR: Address sent flag
* Address matched flag
* @arg I2C_FLAG_SB: Start bit flag
* @arg I2C_FLAG_DUALF: Dual flag
* @arg I2C_FLAG_GENCALL: General call header flag
* @arg I2C_FLAG_TRA: Transmitter/Receiver flag
* @arg I2C_FLAG_BUSY: Bus busy flag
* @arg I2C_FLAG_MSL: Master/Slave flag
* @retval The new state of __FLAG__ (TRUE or FALSE).
*/
#define __HAL_I2C_GET_FLAG(__HANDLE__, __FLAG__) \
((((uint8_t)((__FLAG__) >> 16U)) == 0x01U) ? (((((__HANDLE__)->Instance->SR1) & ((__FLAG__)&I2C_FLAG_MASK)) == ((__FLAG__)&I2C_FLAG_MASK)) ? SET : RESET) \
: (((((__HANDLE__)->Instance->SR2) & ((__FLAG__)&I2C_FLAG_MASK)) == ((__FLAG__)&I2C_FLAG_MASK)) ? SET : RESET))
/** @brief Clears the I2C pending flags which are cleared by writing 0 in a specific bit.
* @param __HANDLE__ specifies the I2C Handle.
* @param __FLAG__ specifies the flag to clear.
* This parameter can be any combination of the following values:
* @arg I2C_FLAG_OVR: Overrun/Underrun flag (Slave mode)
* @arg I2C_FLAG_AF: Acknowledge failure flag
* @arg I2C_FLAG_ARLO: Arbitration lost flag (Master mode)
* @arg I2C_FLAG_BERR: Bus error flag
* @retval None
*/
#define __HAL_I2C_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->SR1 = ~((__FLAG__)&I2C_FLAG_MASK))
/** @brief Clears the I2C ADDR pending flag.
* @param __HANDLE__ specifies the I2C Handle.
* This parameter can be I2C where x: 1, 2, or 3 to select the I2C peripheral.
* @retval None
*/
#define __HAL_I2C_CLEAR_ADDRFLAG(__HANDLE__) \
do { \
__IO uint32_t tmpreg = 0x00U; \
tmpreg = (__HANDLE__)->Instance->SR1; \
tmpreg = (__HANDLE__)->Instance->SR2; \
UNUSED(tmpreg); \
} while (0)
/** @brief Clears the I2C STOPF pending flag.
* @param __HANDLE__ specifies the I2C Handle.
* @retval None
*/
#define __HAL_I2C_CLEAR_STOPFLAG(__HANDLE__) \
do { \
__IO uint32_t tmpreg = 0x00U; \
tmpreg = (__HANDLE__)->Instance->SR1; \
SET_BIT((__HANDLE__)->Instance->CR1, I2C_CR1_PE); \
UNUSED(tmpreg); \
} while (0)
/** @brief Enable the specified I2C peripheral.
* @param __HANDLE__ specifies the I2C Handle.
* @retval None
*/
#define __HAL_I2C_ENABLE(__HANDLE__) SET_BIT((__HANDLE__)->Instance->CR1, I2C_CR1_PE)
/** @brief Disable the specified I2C peripheral.
* @param __HANDLE__ specifies the I2C Handle.
* @retval None
*/
#define __HAL_I2C_DISABLE(__HANDLE__) CLEAR_BIT((__HANDLE__)->Instance->CR1, I2C_CR1_PE)
/**
* @}
*/
/* Exported functions --------------------------------------------------------*/
/** @addtogroup I2C_Exported_Functions
* @{
*/
/** @addtogroup I2C_Exported_Functions_Group1 Initialization and de-initialization functions
* @{
*/
/* Initialization and de-initialization functions******************************/
HAL_StatusTypeDef HAL_I2C_Init(I2C_HandleTypeDef *hi2c);
HAL_StatusTypeDef HAL_I2C_DeInit(I2C_HandleTypeDef *hi2c);
void HAL_I2C_MspInit(I2C_HandleTypeDef *hi2c);
void HAL_I2C_MspDeInit(I2C_HandleTypeDef *hi2c);
/* Callbacks Register/UnRegister functions ***********************************/
#if (USE_HAL_I2C_REGISTER_CALLBACKS == 1)
HAL_StatusTypeDef HAL_I2C_RegisterCallback(I2C_HandleTypeDef *hi2c, HAL_I2C_CallbackIDTypeDef CallbackID, pI2C_CallbackTypeDef pCallback);
HAL_StatusTypeDef HAL_I2C_UnRegisterCallback(I2C_HandleTypeDef *hi2c, HAL_I2C_CallbackIDTypeDef CallbackID);
HAL_StatusTypeDef HAL_I2C_RegisterAddrCallback(I2C_HandleTypeDef *hi2c, pI2C_AddrCallbackTypeDef pCallback);
HAL_StatusTypeDef HAL_I2C_UnRegisterAddrCallback(I2C_HandleTypeDef *hi2c);
#endif /* USE_HAL_I2C_REGISTER_CALLBACKS */
/**
* @}
*/
/** @addtogroup I2C_Exported_Functions_Group2 Input and Output operation functions
* @{
*/
/* IO operation functions ****************************************************/
/******* Blocking mode: Polling */
HAL_StatusTypeDef HAL_I2C_Master_Transmit(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size, uint32_t Timeout);
HAL_StatusTypeDef HAL_I2C_Master_Receive(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size, uint32_t Timeout);
HAL_StatusTypeDef HAL_I2C_Slave_Transmit(I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size, uint32_t Timeout);
HAL_StatusTypeDef HAL_I2C_Slave_Receive(I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size, uint32_t Timeout);
HAL_StatusTypeDef HAL_I2C_Mem_Write(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint16_t MemAddress, uint16_t MemAddSize, uint8_t *pData, uint16_t Size, uint32_t Timeout);
HAL_StatusTypeDef HAL_I2C_Mem_Read(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint16_t MemAddress, uint16_t MemAddSize, uint8_t *pData, uint16_t Size, uint32_t Timeout);
HAL_StatusTypeDef HAL_I2C_IsDeviceReady(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint32_t Trials, uint32_t Timeout);
/******* Non-Blocking mode: Interrupt */
HAL_StatusTypeDef HAL_I2C_Master_Transmit_IT(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size);
HAL_StatusTypeDef HAL_I2C_Master_Receive_IT(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size);
HAL_StatusTypeDef HAL_I2C_Slave_Transmit_IT(I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size);
HAL_StatusTypeDef HAL_I2C_Slave_Receive_IT(I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size);
HAL_StatusTypeDef HAL_I2C_Mem_Write_IT(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint16_t MemAddress, uint16_t MemAddSize, uint8_t *pData, uint16_t Size);
HAL_StatusTypeDef HAL_I2C_Mem_Read_IT(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint16_t MemAddress, uint16_t MemAddSize, uint8_t *pData, uint16_t Size);
HAL_StatusTypeDef HAL_I2C_Master_Seq_Transmit_IT(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size, uint32_t XferOptions);
HAL_StatusTypeDef HAL_I2C_Master_Seq_Receive_IT(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size, uint32_t XferOptions);
HAL_StatusTypeDef HAL_I2C_Slave_Seq_Transmit_IT(I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size, uint32_t XferOptions);
HAL_StatusTypeDef HAL_I2C_Slave_Seq_Receive_IT(I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size, uint32_t XferOptions);
HAL_StatusTypeDef HAL_I2C_EnableListen_IT(I2C_HandleTypeDef *hi2c);
HAL_StatusTypeDef HAL_I2C_DisableListen_IT(I2C_HandleTypeDef *hi2c);
HAL_StatusTypeDef HAL_I2C_Master_Abort_IT(I2C_HandleTypeDef *hi2c, uint16_t DevAddress);
/******* Non-Blocking mode: DMA */
HAL_StatusTypeDef HAL_I2C_Master_Transmit_DMA(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size);
HAL_StatusTypeDef HAL_I2C_Master_Receive_DMA(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size);
HAL_StatusTypeDef HAL_I2C_Slave_Transmit_DMA(I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size);
HAL_StatusTypeDef HAL_I2C_Slave_Receive_DMA(I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size);
HAL_StatusTypeDef HAL_I2C_Mem_Write_DMA(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint16_t MemAddress, uint16_t MemAddSize, uint8_t *pData, uint16_t Size);
HAL_StatusTypeDef HAL_I2C_Mem_Read_DMA(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint16_t MemAddress, uint16_t MemAddSize, uint8_t *pData, uint16_t Size);
HAL_StatusTypeDef HAL_I2C_Master_Seq_Transmit_DMA(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size, uint32_t XferOptions);
HAL_StatusTypeDef HAL_I2C_Master_Seq_Receive_DMA(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size, uint32_t XferOptions);
HAL_StatusTypeDef HAL_I2C_Slave_Seq_Transmit_DMA(I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size, uint32_t XferOptions);
HAL_StatusTypeDef HAL_I2C_Slave_Seq_Receive_DMA(I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size, uint32_t XferOptions);
/**
* @}
*/
/** @addtogroup I2C_IRQ_Handler_and_Callbacks IRQ Handler and Callbacks
* @{
*/
/******* I2C IRQHandler and Callbacks used in non blocking modes (Interrupt and DMA) */
void HAL_I2C_EV_IRQHandler(I2C_HandleTypeDef *hi2c);
void HAL_I2C_ER_IRQHandler(I2C_HandleTypeDef *hi2c);
void HAL_I2C_MasterTxCpltCallback(I2C_HandleTypeDef *hi2c);
void HAL_I2C_MasterRxCpltCallback(I2C_HandleTypeDef *hi2c);
void HAL_I2C_SlaveTxCpltCallback(I2C_HandleTypeDef *hi2c);
void HAL_I2C_SlaveRxCpltCallback(I2C_HandleTypeDef *hi2c);
void HAL_I2C_AddrCallback(I2C_HandleTypeDef *hi2c, uint8_t TransferDirection, uint16_t AddrMatchCode);
void HAL_I2C_ListenCpltCallback(I2C_HandleTypeDef *hi2c);
void HAL_I2C_MemTxCpltCallback(I2C_HandleTypeDef *hi2c);
void HAL_I2C_MemRxCpltCallback(I2C_HandleTypeDef *hi2c);
void HAL_I2C_ErrorCallback(I2C_HandleTypeDef *hi2c);
void HAL_I2C_AbortCpltCallback(I2C_HandleTypeDef *hi2c);
/**
* @}
*/
/** @addtogroup I2C_Exported_Functions_Group3 Peripheral State, Mode and Error functions
* @{
*/
/* Peripheral State, Mode and Error functions *********************************/
HAL_I2C_StateTypeDef HAL_I2C_GetState(I2C_HandleTypeDef *hi2c);
HAL_I2C_ModeTypeDef HAL_I2C_GetMode(I2C_HandleTypeDef *hi2c);
uint32_t HAL_I2C_GetError(I2C_HandleTypeDef *hi2c);
/**
* @}
*/
/**
* @}
*/
/* Private types -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
/* Private constants ---------------------------------------------------------*/
/** @defgroup I2C_Private_Constants I2C Private Constants
* @{
*/
#define I2C_FLAG_MASK 0x0000FFFFU
#define I2C_MIN_PCLK_FREQ_STANDARD 2000000U /*!< 2 MHz */
#define I2C_MIN_PCLK_FREQ_FAST 4000000U /*!< 4 MHz */
/**
* @}
*/
/* Private macros ------------------------------------------------------------*/
/** @defgroup I2C_Private_Macros I2C Private Macros
* @{
*/
#define I2C_MIN_PCLK_FREQ(__PCLK__, __SPEED__) (((__SPEED__) <= 100000U) ? ((__PCLK__) < I2C_MIN_PCLK_FREQ_STANDARD) : ((__PCLK__) < I2C_MIN_PCLK_FREQ_FAST))
#define I2C_CCR_CALCULATION(__PCLK__, __SPEED__, __COEFF__) (((((__PCLK__)-1U) / ((__SPEED__) * (__COEFF__))) + 1U) & I2C_CCR_CCR)
#define I2C_FREQRANGE(__PCLK__) ((__PCLK__) / 1000000U)
#define I2C_RISE_TIME(__FREQRANGE__, __SPEED__) (((__SPEED__) <= 100000U) ? ((__FREQRANGE__) + 1U) : ((((__FREQRANGE__)*300U) / 1000U) + 1U))
#define I2C_SPEED_STANDARD(__PCLK__, __SPEED__) ((I2C_CCR_CALCULATION((__PCLK__), (__SPEED__), 2U) < 4U) ? 4U : I2C_CCR_CALCULATION((__PCLK__), (__SPEED__), 2U))
#define I2C_SPEED_FAST(__PCLK__, __SPEED__, __DUTYCYCLE__) \
(((__DUTYCYCLE__) == I2C_DUTYCYCLE_2) ? I2C_CCR_CALCULATION((__PCLK__), (__SPEED__), 3U) : (I2C_CCR_CALCULATION((__PCLK__), (__SPEED__), 25U) | I2C_DUTYCYCLE_16_9))
#define I2C_SPEED(__PCLK__, __SPEED__, __DUTYCYCLE__) \
(((__SPEED__) <= 100000U) ? (I2C_SPEED_STANDARD((__PCLK__), (__SPEED__))) \
: ((I2C_SPEED_FAST((__PCLK__), (__SPEED__), (__DUTYCYCLE__)) & I2C_CCR_CCR) == 0U) ? 1U \
: ((I2C_SPEED_FAST((__PCLK__), (__SPEED__), (__DUTYCYCLE__))) | I2C_CCR_FS))
#define I2C_7BIT_ADD_WRITE(__ADDRESS__) ((uint8_t)((__ADDRESS__) & (uint8_t)(~I2C_OAR1_ADD0)))
#define I2C_7BIT_ADD_READ(__ADDRESS__) ((uint8_t)((__ADDRESS__) | I2C_OAR1_ADD0))
#define I2C_10BIT_ADDRESS(__ADDRESS__) ((uint8_t)((uint16_t)((__ADDRESS__) & (uint16_t)0x00FF)))
#define I2C_10BIT_HEADER_WRITE(__ADDRESS__) ((uint8_t)((uint16_t)((uint16_t)(((uint16_t)((__ADDRESS__) & (uint16_t)0x0300)) >> 7) | (uint16_t)0x00F0)))
#define I2C_10BIT_HEADER_READ(__ADDRESS__) ((uint8_t)((uint16_t)((uint16_t)(((uint16_t)((__ADDRESS__) & (uint16_t)0x0300)) >> 7) | (uint16_t)(0x00F1))))
#define I2C_MEM_ADD_MSB(__ADDRESS__) ((uint8_t)((uint16_t)(((uint16_t)((__ADDRESS__) & (uint16_t)0xFF00)) >> 8)))
#define I2C_MEM_ADD_LSB(__ADDRESS__) ((uint8_t)((uint16_t)((__ADDRESS__) & (uint16_t)0x00FF)))
/** @defgroup I2C_IS_RTC_Definitions I2C Private macros to check input parameters
* @{
*/
#define IS_I2C_DUTY_CYCLE(CYCLE) (((CYCLE) == I2C_DUTYCYCLE_2) || ((CYCLE) == I2C_DUTYCYCLE_16_9))
#define IS_I2C_ADDRESSING_MODE(ADDRESS) (((ADDRESS) == I2C_ADDRESSINGMODE_7BIT) || ((ADDRESS) == I2C_ADDRESSINGMODE_10BIT))
#define IS_I2C_DUAL_ADDRESS(ADDRESS) (((ADDRESS) == I2C_DUALADDRESS_DISABLE) || ((ADDRESS) == I2C_DUALADDRESS_ENABLE))
#define IS_I2C_GENERAL_CALL(CALL) (((CALL) == I2C_GENERALCALL_DISABLE) || ((CALL) == I2C_GENERALCALL_ENABLE))
#define IS_I2C_NO_STRETCH(STRETCH) (((STRETCH) == I2C_NOSTRETCH_DISABLE) || ((STRETCH) == I2C_NOSTRETCH_ENABLE))
#define IS_I2C_MEMADD_SIZE(SIZE) (((SIZE) == I2C_MEMADD_SIZE_8BIT) || ((SIZE) == I2C_MEMADD_SIZE_16BIT))
#define IS_I2C_CLOCK_SPEED(SPEED) (((SPEED) > 0U) && ((SPEED) <= 400000U))
#define IS_I2C_OWN_ADDRESS1(ADDRESS1) (((ADDRESS1)&0xFFFFFC00U) == 0U)
#define IS_I2C_OWN_ADDRESS2(ADDRESS2) (((ADDRESS2)&0xFFFFFF01U) == 0U)
#define IS_I2C_TRANSFER_OPTIONS_REQUEST(REQUEST) \
(((REQUEST) == I2C_FIRST_FRAME) || ((REQUEST) == I2C_FIRST_AND_NEXT_FRAME) || ((REQUEST) == I2C_NEXT_FRAME) || ((REQUEST) == I2C_FIRST_AND_LAST_FRAME) || ((REQUEST) == I2C_LAST_FRAME) \
|| ((REQUEST) == I2C_LAST_FRAME_NO_STOP) || IS_I2C_TRANSFER_OTHER_OPTIONS_REQUEST(REQUEST))
#define IS_I2C_TRANSFER_OTHER_OPTIONS_REQUEST(REQUEST) (((REQUEST) == I2C_OTHER_FRAME) || ((REQUEST) == I2C_OTHER_AND_LAST_FRAME))
#define I2C_CHECK_FLAG(__ISR__, __FLAG__) ((((__ISR__) & ((__FLAG__)&I2C_FLAG_MASK)) == ((__FLAG__)&I2C_FLAG_MASK)) ? SET : RESET)
#define I2C_CHECK_IT_SOURCE(__CR1__, __IT__) ((((__CR1__) & (__IT__)) == (__IT__)) ? SET : RESET)
/**
* @}
*/
/**
* @}
*/
/* Private functions ---------------------------------------------------------*/
/** @defgroup I2C_Private_Functions I2C Private Functions
* @{
*/
/**
* @}
*/
/**
* @}
*/
/**
* @}
*/
#ifdef __cplusplus
}
#endif
#endif /* __STM32F1xx_HAL_I2C_H */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

File diff suppressed because it is too large Load Diff

View File

@@ -155,7 +155,10 @@
#define POW_PD 1 #define POW_PD 1
#define POW_PD_EXT 0 #define POW_PD_EXT 0
#define TEMP_NTC #define TEMP_NTC
#define I2C_SOFT_BUS_2 #define I2C_SOFT_BUS_2 1
#define I2C_SOFT_BUS_1 1
#define OLED_I2CBB1 1
#define ACCEL_I2CBB1 1
#define BATTFILTERDEPTH 8 #define BATTFILTERDEPTH 8
#define OLED_I2CBB2 #define OLED_I2CBB2
#define ACCEL_EXITS_ON_MOVEMENT #define ACCEL_EXITS_ON_MOVEMENT

View File

@@ -1,13 +1,13 @@
#include "configuration.h" #include "configuration.h"
#ifdef POW_PD #ifdef POW_PD
#include "BSP.h" #include "BSP.h"
#include "I2C_Wrapper.hpp" #include "I2CBB1.hpp"
#include "Pins.h" #include "Pins.h"
#include "Setup.h" #include "Setup.h"
#include "USBPD.h" #include "USBPD.h"
bool fusb_read_buf(const uint8_t deviceAddr, const uint8_t registerAdd, const uint8_t size, uint8_t *buf) { return FRToSI2C::Mem_Read(deviceAddr, registerAdd, buf, size); } bool fusb_read_buf(const uint8_t deviceAddr, const uint8_t registerAdd, const uint8_t size, uint8_t *buf) { return I2CBB1::Mem_Read(deviceAddr, registerAdd, buf, size); }
bool fusb_write_buf(const uint8_t deviceAddr, const uint8_t registerAdd, const uint8_t size, uint8_t *buf) { return FRToSI2C::Mem_Write(deviceAddr, registerAdd, (uint8_t *)buf, size); } bool fusb_write_buf(const uint8_t deviceAddr, const uint8_t registerAdd, const uint8_t size, uint8_t *buf) { return I2CBB1::Mem_Write(deviceAddr, registerAdd, (uint8_t *)buf, size); }
void setupFUSBIRQ() { void setupFUSBIRQ() {
GPIO_InitTypeDef GPIO_InitStruct; GPIO_InitTypeDef GPIO_InitStruct;

View File

@@ -6,6 +6,7 @@
*/ */
#include "BSP.h" #include "BSP.h"
#include "I2CBB1.hpp"
#include "I2CBB2.hpp" #include "I2CBB2.hpp"
#include "Pins.h" #include "Pins.h"
#include "Setup.h" #include "Setup.h"
@@ -18,6 +19,5 @@ void preRToSInit() {
Setup_HAL(); // Setup all the HAL objects Setup_HAL(); // Setup all the HAL objects
BSPInit(); BSPInit();
I2CBB2::init(); I2CBB2::init();
/* Init the IPC objects */ I2CBB1::init();
FRToSI2C::FRToSInit();
} }

View File

@@ -75,55 +75,6 @@ void HAL_ADC_MspInit(ADC_HandleTypeDef *hadc) {
} }
} }
void HAL_I2C_MspInit(I2C_HandleTypeDef *hi2c) {
GPIO_InitTypeDef GPIO_InitStruct;
/**I2C1 GPIO Configuration
PB6 ------> I2C1_SCL
PB7 ------> I2C1_SDA
*/
GPIO_InitStruct.Pin = SCL_Pin | SDA_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_AF_OD;
GPIO_InitStruct.Pull = GPIO_PULLUP;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
/* Peripheral clock enable */
__HAL_RCC_I2C1_CLK_ENABLE();
/* I2C1 DMA Init */
/* I2C1_RX Init */
hdma_i2c1_rx.Instance = DMA1_Channel7;
hdma_i2c1_rx.Init.Direction = DMA_PERIPH_TO_MEMORY;
hdma_i2c1_rx.Init.PeriphInc = DMA_PINC_DISABLE;
hdma_i2c1_rx.Init.MemInc = DMA_MINC_ENABLE;
hdma_i2c1_rx.Init.PeriphDataAlignment = DMA_PDATAALIGN_BYTE;
hdma_i2c1_rx.Init.MemDataAlignment = DMA_MDATAALIGN_BYTE;
hdma_i2c1_rx.Init.Mode = DMA_NORMAL;
hdma_i2c1_rx.Init.Priority = DMA_PRIORITY_LOW;
HAL_DMA_Init(&hdma_i2c1_rx);
__HAL_LINKDMA(hi2c, hdmarx, hdma_i2c1_rx);
/* I2C1_TX Init */
hdma_i2c1_tx.Instance = DMA1_Channel6;
hdma_i2c1_tx.Init.Direction = DMA_MEMORY_TO_PERIPH;
hdma_i2c1_tx.Init.PeriphInc = DMA_PINC_DISABLE;
hdma_i2c1_tx.Init.MemInc = DMA_MINC_ENABLE;
hdma_i2c1_tx.Init.PeriphDataAlignment = DMA_PDATAALIGN_BYTE;
hdma_i2c1_tx.Init.MemDataAlignment = DMA_MDATAALIGN_BYTE;
hdma_i2c1_tx.Init.Mode = DMA_NORMAL;
hdma_i2c1_tx.Init.Priority = DMA_PRIORITY_MEDIUM;
HAL_DMA_Init(&hdma_i2c1_tx);
__HAL_LINKDMA(hi2c, hdmatx, hdma_i2c1_tx);
/* I2C1 interrupt Init */
HAL_NVIC_SetPriority(I2C1_EV_IRQn, 15, 0);
HAL_NVIC_EnableIRQ(I2C1_EV_IRQn);
HAL_NVIC_SetPriority(I2C1_ER_IRQn, 15, 0);
HAL_NVIC_EnableIRQ(I2C1_ER_IRQn);
}
void HAL_TIM_Base_MspInit(TIM_HandleTypeDef *htim_base) { void HAL_TIM_Base_MspInit(TIM_HandleTypeDef *htim_base) {
if (htim_base->Instance == TIM3) { if (htim_base->Instance == TIM3) {

View File

@@ -44,10 +44,5 @@ void ADC1_2_IRQHandler(void) { HAL_ADC_IRQHandler(&hadc1); }
// used for hal ticks // used for hal ticks
void TIM4_IRQHandler(void) { HAL_TIM_IRQHandler(&htim4); } void TIM4_IRQHandler(void) { HAL_TIM_IRQHandler(&htim4); }
void I2C1_EV_IRQHandler(void) { HAL_I2C_EV_IRQHandler(&hi2c1); }
void I2C1_ER_IRQHandler(void) { HAL_I2C_ER_IRQHandler(&hi2c1); }
void DMA1_Channel6_IRQHandler(void) { HAL_DMA_IRQHandler(&hdma_i2c1_tx); }
void DMA1_Channel7_IRQHandler(void) { HAL_DMA_IRQHandler(&hdma_i2c1_rx); }
void EXTI9_5_IRQHandler(void) { HAL_GPIO_EXTI_IRQHandler(INT_PD_Pin); } void EXTI9_5_IRQHandler(void) { HAL_GPIO_EXTI_IRQHandler(INT_PD_Pin); }

View File

@@ -396,7 +396,7 @@ bool isTipShorted() { return tipShorted; }
#else #else
bool isTipShorted() { return false; } bool isTipShorted() { return false; }
#endif #endif
uint8_t getTipThermalMass() { uint16_t getTipThermalMass() {
#ifdef TIP_RESISTANCE_SENSE_Pin #ifdef TIP_RESISTANCE_SENSE_Pin
if (lastTipResistance >= 80) { if (lastTipResistance >= 80) {
return TIP_THERMAL_MASS; return TIP_THERMAL_MASS;
@@ -406,7 +406,7 @@ uint8_t getTipThermalMass() {
return TIP_THERMAL_MASS; return TIP_THERMAL_MASS;
#endif #endif
} }
uint8_t getTipInertia() { uint16_t getTipInertia() {
#ifdef TIP_RESISTANCE_SENSE_Pin #ifdef TIP_RESISTANCE_SENSE_Pin
if (lastTipResistance >= 80) { if (lastTipResistance >= 80) {
return TIP_THERMAL_MASS; return TIP_THERMAL_MASS;

View File

@@ -1,91 +0,0 @@
/*
* FRToSI2C.cpp
*
* Created on: 14Apr.,2018
* Author: Ralim
*/
#include "BSP.h"
#include "Setup.h"
#include <I2C_Wrapper.hpp>
SemaphoreHandle_t FRToSI2C::I2CSemaphore = nullptr;
StaticSemaphore_t FRToSI2C::xSemaphoreBuffer;
void FRToSI2C::CpltCallback() {
hi2c1.State = HAL_I2C_STATE_READY; // Force state reset (even if tx error)
if (I2CSemaphore) {
xSemaphoreGiveFromISR(I2CSemaphore, NULL);
}
}
bool FRToSI2C::Mem_Read(uint16_t DevAddress, uint16_t MemAddress, uint8_t *pData, uint16_t Size) {
if (!lock())
return false;
if (HAL_I2C_Mem_Read(&hi2c1, DevAddress, MemAddress, I2C_MEMADD_SIZE_8BIT, pData, Size, 500) != HAL_OK) {
I2C_Unstick();
unlock();
return false;
}
unlock();
return true;
}
bool FRToSI2C::I2C_RegisterWrite(uint8_t address, uint8_t reg, uint8_t data) { return Mem_Write(address, reg, &data, 1); }
uint8_t FRToSI2C::I2C_RegisterRead(uint8_t add, uint8_t reg) {
uint8_t tx_data[1];
Mem_Read(add, reg, tx_data, 1);
return tx_data[0];
}
bool FRToSI2C::Mem_Write(uint16_t DevAddress, uint16_t MemAddress, uint8_t *pData, uint16_t Size) {
if (!lock())
return false;
if (HAL_I2C_Mem_Write(&hi2c1, DevAddress, MemAddress, I2C_MEMADD_SIZE_8BIT, pData, Size, 500) != HAL_OK) {
I2C_Unstick();
unlock();
return false;
}
unlock();
return true;
}
bool FRToSI2C::Transmit(uint16_t DevAddress, uint8_t *pData, uint16_t Size) {
if (!lock())
return false;
if (HAL_I2C_Master_Transmit_IT(&hi2c1, DevAddress, pData, Size) != HAL_OK) {
I2C_Unstick();
unlock();
return false;
}
return true;
}
bool FRToSI2C::probe(uint16_t DevAddress) {
if (!lock())
return false;
uint8_t buffer[1];
bool worked = HAL_I2C_Mem_Read(&hi2c1, DevAddress, 0x0F, I2C_MEMADD_SIZE_8BIT, buffer, 1, 1000) == HAL_OK;
unlock();
return worked;
}
void FRToSI2C::I2C_Unstick() { unstick_I2C(); }
void FRToSI2C::unlock() { xSemaphoreGive(I2CSemaphore); }
bool FRToSI2C::lock() { return xSemaphoreTake(I2CSemaphore, (TickType_t)50) == pdTRUE; }
bool FRToSI2C::writeRegistersBulk(const uint8_t address, const I2C_REG *registers, const uint8_t registersLength) {
for (int index = 0; index < registersLength; index++) {
if (!I2C_RegisterWrite(address, registers[index].reg, registers[index].val)) {
return false;
}
if (registers[index].pause_ms)
delay_ms(registers[index].pause_ms);
}
return true;
}

View File

@@ -23,12 +23,6 @@ void HAL_ADCEx_InjectedConvCpltCallback(ADC_HandleTypeDef *hadc) {
} }
} }
} }
void HAL_I2C_MasterRxCpltCallback(I2C_HandleTypeDef *hi2c __unused) { FRToSI2C::CpltCallback(); }
void HAL_I2C_MasterTxCpltCallback(I2C_HandleTypeDef *hi2c __unused) { FRToSI2C::CpltCallback(); }
void HAL_I2C_MemTxCpltCallback(I2C_HandleTypeDef *hi2c __unused) { FRToSI2C::CpltCallback(); }
void HAL_I2C_ErrorCallback(I2C_HandleTypeDef *hi2c __unused) { FRToSI2C::CpltCallback(); }
void HAL_I2C_AbortCpltCallback(I2C_HandleTypeDef *hi2c __unused) { FRToSI2C::CpltCallback(); }
void HAL_I2C_MemRxCpltCallback(I2C_HandleTypeDef *hi2c __unused) { FRToSI2C::CpltCallback(); }
extern osThreadId POWTaskHandle; extern osThreadId POWTaskHandle;

View File

@@ -18,12 +18,6 @@
extern "C" { extern "C" {
#endif #endif
void HAL_ADCEx_InjectedConvCpltCallback(ADC_HandleTypeDef *hadc); void HAL_ADCEx_InjectedConvCpltCallback(ADC_HandleTypeDef *hadc);
void HAL_I2C_ErrorCallback(I2C_HandleTypeDef *hi2c);
void HAL_I2C_AbortCpltCallback(I2C_HandleTypeDef *hi2c);
void HAL_I2C_MasterTxCpltCallback(I2C_HandleTypeDef *hi2c);
void HAL_I2C_MasterRxCpltCallback(I2C_HandleTypeDef *hi2c);
void HAL_I2C_MemTxCpltCallback(I2C_HandleTypeDef *hi2c);
void HAL_I2C_MemRxCpltCallback(I2C_HandleTypeDef *hi2c);
void HAL_GPIO_EXTI_Callback(uint16_t); void HAL_GPIO_EXTI_Callback(uint16_t);
#ifdef __cplusplus #ifdef __cplusplus

View File

@@ -7,16 +7,13 @@
#include "Setup.h" #include "Setup.h"
#include "BSP.h" #include "BSP.h"
#include "Pins.h" #include "Pins.h"
#include "configuration.h"
#include "history.hpp" #include "history.hpp"
#include <stdint.h> #include <stdint.h>
ADC_HandleTypeDef hadc1; ADC_HandleTypeDef hadc1;
ADC_HandleTypeDef hadc2; ADC_HandleTypeDef hadc2;
DMA_HandleTypeDef hdma_adc1; DMA_HandleTypeDef hdma_adc1;
I2C_HandleTypeDef hi2c1;
DMA_HandleTypeDef hdma_i2c1_rx;
DMA_HandleTypeDef hdma_i2c1_tx;
IWDG_HandleTypeDef hiwdg; IWDG_HandleTypeDef hiwdg;
TIM_HandleTypeDef htimADC; TIM_HandleTypeDef htimADC;
TIM_HandleTypeDef htimTip; TIM_HandleTypeDef htimTip;
@@ -27,7 +24,6 @@ uint16_t ADCReadings[ADC_SAMPLES]; // Used to store the adc readings for the han
// Functions // Functions
static void SystemClock_Config(void); static void SystemClock_Config(void);
static void MX_ADC1_Init(void); static void MX_ADC1_Init(void);
static void MX_I2C1_Init(void);
static void MX_IWDG_Init(void); static void MX_IWDG_Init(void);
static void MX_TIP_CONTROL_TIMER_Init(void); static void MX_TIP_CONTROL_TIMER_Init(void);
static void MX_ADC_CONTROL_TIMER_Init(void); static void MX_ADC_CONTROL_TIMER_Init(void);
@@ -46,7 +42,7 @@ void Setup_HAL() {
MX_GPIO_Init(); MX_GPIO_Init();
MX_DMA_Init(); MX_DMA_Init();
#ifndef I2C_SOFT_BUS_1 #ifndef I2C_SOFT_BUS_1
MX_I2C1_Init(); #error "Only Bit-Bang now"
#endif #endif
MX_ADC1_Init(); MX_ADC1_Init();
MX_ADC2_Init(); MX_ADC2_Init();
@@ -277,20 +273,6 @@ static void MX_ADC2_Init(void) {
; ;
} }
} }
/* I2C1 init function */
static void MX_I2C1_Init(void) {
hi2c1.Instance = I2C1;
hi2c1.Init.ClockSpeed = 75000;
// OLED doesnt handle >100k when its asleep (off).
hi2c1.Init.DutyCycle = I2C_DUTYCYCLE_2;
hi2c1.Init.OwnAddress1 = 0;
hi2c1.Init.AddressingMode = I2C_ADDRESSINGMODE_7BIT;
hi2c1.Init.DualAddressMode = I2C_DUALADDRESS_DISABLE;
hi2c1.Init.OwnAddress2 = 0;
hi2c1.Init.GeneralCallMode = I2C_GENERALCALL_DISABLE;
hi2c1.Init.NoStretchMode = I2C_NOSTRETCH_DISABLE;
HAL_I2C_Init(&hi2c1);
}
/* IWDG init function */ /* IWDG init function */
static void MX_IWDG_Init(void) { static void MX_IWDG_Init(void) {

View File

@@ -18,10 +18,6 @@ extern ADC_HandleTypeDef hadc1;
extern ADC_HandleTypeDef hadc2; extern ADC_HandleTypeDef hadc2;
extern DMA_HandleTypeDef hdma_adc1; extern DMA_HandleTypeDef hdma_adc1;
extern DMA_HandleTypeDef hdma_i2c1_rx;
extern DMA_HandleTypeDef hdma_i2c1_tx;
extern I2C_HandleTypeDef hi2c1;
extern IWDG_HandleTypeDef hiwdg; extern IWDG_HandleTypeDef hiwdg;
extern TIM_HandleTypeDef htimADC; extern TIM_HandleTypeDef htimADC;

View File

@@ -127,4 +127,4 @@ const int32_t uVtoDegC[] = {
#endif #endif
const int uVtoDegCItems = sizeof(uVtoDegC) / (2 * sizeof(uVtoDegC[0])); const int uVtoDegCItems = sizeof(uVtoDegC) / (2 * sizeof(uVtoDegC[0]));
uint32_t TipThermoModel::convertuVToDegC(uint32_t tipuVDelta) { return Utils::InterpolateLookupTable(uVtoDegC, uVtoDegCItems, tipuVDelta); } TemperatureType_t TipThermoModel::convertuVToDegC(uint32_t tipuVDelta) { return Utils::InterpolateLookupTable(uVtoDegC, uVtoDegCItems, tipuVDelta); }

View File

@@ -86,7 +86,7 @@
#define POWER_PULSE_DEFAULT 0 #define POWER_PULSE_DEFAULT 0
#else #else
#define POWER_PULSE_DEFAULT 5 #define POWER_PULSE_DEFAULT 5
#endif /* TS100 */ #endif /* TS100 */
#define POWER_PULSE_WAIT_DEFAULT 4 // Default rate of the power pulse: 4*2500 = 10000 ms = 10 s #define POWER_PULSE_WAIT_DEFAULT 4 // Default rate of the power pulse: 4*2500 = 10000 ms = 10 s
#define POWER_PULSE_DURATION_DEFAULT 1 // Default duration of the power pulse: 1*250 = 250 ms #define POWER_PULSE_DURATION_DEFAULT 1 // Default duration of the power pulse: 1*250 = 250 ms
@@ -156,6 +156,10 @@
#define MIN_BOOST_TEMP_C 250 // The min settable temp for boost mode °C #define MIN_BOOST_TEMP_C 250 // The min settable temp for boost mode °C
#define MIN_BOOST_TEMP_F 480 // The min settable temp for boost mode °F #define MIN_BOOST_TEMP_F 480 // The min settable temp for boost mode °F
// Miniware cant be trusted, and keep using the GD32 randomly now, so assume they will clones in the future
#define I2C_SOFT_BUS_1 1
#ifdef MODEL_TS100 #ifdef MODEL_TS100
#define VOLTAGE_DIV 467 // 467 - Default divider from schematic #define VOLTAGE_DIV 467 // 467 - Default divider from schematic
#define CALIBRATION_OFFSET 900 // 900 - Default adc offset in uV #define CALIBRATION_OFFSET 900 // 900 - Default adc offset in uV
@@ -165,8 +169,9 @@
#define POWER_LIMIT_STEPS 5 #define POWER_LIMIT_STEPS 5
#define OP_AMP_GAIN_STAGE OP_AMP_GAIN_STAGE_TS100 #define OP_AMP_GAIN_STAGE OP_AMP_GAIN_STAGE_TS100
#define TEMP_uV_LOOKUP_HAKKO #define TEMP_uV_LOOKUP_HAKKO
#define USB_PD_VMAX 20 // Maximum voltage for PD to negotiate #define USB_PD_VMAX 20 // Maximum voltage for PD to negotiate
#define OLED_I2CBB1 1
#define ACCEL_I2CBB1 1
#define HARDWARE_MAX_WATTAGE_X10 750 #define HARDWARE_MAX_WATTAGE_X10 750
#define TIP_THERMAL_MASS 65 // X10 watts to raise 1 deg C in 1 second #define TIP_THERMAL_MASS 65 // X10 watts to raise 1 deg C in 1 second
#define TIP_RESISTANCE 75 // x10 ohms, 7.5 typical for ts100 tips #define TIP_RESISTANCE 75 // x10 ohms, 7.5 typical for ts100 tips
@@ -194,7 +199,6 @@
#define POW_DC 1 #define POW_DC 1
#define POW_PD 1 #define POW_PD 1
#define I2C_SOFT_BUS_2 1 #define I2C_SOFT_BUS_2 1
#define I2C_SOFT_BUS_1 1
#define OLED_I2CBB1 1 #define OLED_I2CBB1 1
#define USB_PD_I2CBB2 1 #define USB_PD_I2CBB2 1
#define USB_PD_VMAX 28 // Device supposedly can do 28V; looks like vmax is 33 ish #define USB_PD_VMAX 28 // Device supposedly can do 28V; looks like vmax is 33 ish
@@ -218,7 +222,7 @@
#define TIP_THERMAL_MASS 40 #define TIP_THERMAL_MASS 40
#define TIP_RESISTANCE 45 // x10 ohms, 4.5 typical for ts80 tips #define TIP_RESISTANCE 45 // x10 ohms, 4.5 typical for ts80 tips
#define I2C_SOFT_BUS_2 1
#define LIS_ORI_FLIP #define LIS_ORI_FLIP
#define OLED_FLIP #define OLED_FLIP
#endif /* TS80(P) */ #endif /* TS80(P) */
@@ -228,6 +232,8 @@
#define CALIBRATION_OFFSET 900 // the adc offset in uV #define CALIBRATION_OFFSET 900 // the adc offset in uV
#define PID_POWER_LIMIT 35 // Sets the max pwm power limit #define PID_POWER_LIMIT 35 // Sets the max pwm power limit
#define POWER_LIMIT 32 // 24 watts default power limit #define POWER_LIMIT 32 // 24 watts default power limit
#define OLED_I2CBB1 1
#define ACCEL_I2CBB1 1
#define HARDWARE_MAX_WATTAGE_X10 320 #define HARDWARE_MAX_WATTAGE_X10 320
@@ -237,17 +243,18 @@
#endif /* TS80 */ #endif /* TS80 */
#ifdef MODEL_TS80P #ifdef MODEL_TS80P
#define VOLTAGE_DIV 650 // Default for TS80P with slightly different resistors #define VOLTAGE_DIV 650 // Default for TS80P with slightly different resistors
#define CALIBRATION_OFFSET 1500 // the adc offset in uV #define CALIBRATION_OFFSET 1500 // the adc offset in uV
#define PID_POWER_LIMIT 35 // Sets the max pwm power limit #define PID_POWER_LIMIT 35 // Sets the max pwm power limit
#define POWER_LIMIT 32 // 30 watts default power limit #define POWER_LIMIT 32 // 30 watts default power limit
#define I2C_SOFT_BUS_2 1
#define HARDWARE_MAX_WATTAGE_X10 320 #define HARDWARE_MAX_WATTAGE_X10 320
#define OLED_I2CBB1 1
#define ACCEL_I2CBB1 1
#define POW_PD 1 #define POW_PD 1
#define POW_QC 1 #define POW_QC 1
#define TEMP_NTC #define TEMP_NTC
#define I2C_SOFT_BUS_2 1
#define SC7_ORI_FLIP #define SC7_ORI_FLIP
#endif /* TS80P */ #endif /* TS80P */
@@ -255,8 +262,8 @@
#define FLASH_LOGOADDR (0x08000000 + (126 * 1024)) #define FLASH_LOGOADDR (0x08000000 + (126 * 1024))
#define SETTINGS_START_PAGE (0x08000000 + (127 * 1024)) #define SETTINGS_START_PAGE (0x08000000 + (127 * 1024))
#else #else
#define FLASH_LOGOADDR (0x08000000 + (62 * 1024)) #define FLASH_LOGOADDR (0x08000000 + (62 * 1024))
#define SETTINGS_START_PAGE (0x08000000 + (63 * 1024)) #define SETTINGS_START_PAGE (0x08000000 + (63 * 1024))
#endif /* TS101 */ #endif /* TS101 */
#endif /* CONFIGURATION_H_ */ #endif /* CONFIGURATION_H_ */

View File

@@ -25,7 +25,4 @@ void preRToSInit() {
#ifdef I2C_SOFT_BUS_1 #ifdef I2C_SOFT_BUS_1
I2CBB1::init(); I2CBB1::init();
#endif #endif
/* Init the IPC objects */
FRToSI2C::FRToSInit();
} }

View File

@@ -81,55 +81,6 @@ void HAL_ADC_MspInit(ADC_HandleTypeDef *hadc) {
} }
} }
void HAL_I2C_MspInit(I2C_HandleTypeDef *hi2c) {
GPIO_InitTypeDef GPIO_InitStruct;
/**I2C1 GPIO Configuration
PB6 ------> I2C1_SCL
PB7 ------> I2C1_SDA
*/
GPIO_InitStruct.Pin = SCL_Pin | SDA_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_AF_OD;
GPIO_InitStruct.Pull = GPIO_PULLUP;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
HAL_GPIO_Init(SCL_GPIO_Port, &GPIO_InitStruct);
/* Peripheral clock enable */
__HAL_RCC_I2C1_CLK_ENABLE();
/* I2C1 DMA Init */
/* I2C1_RX Init */
hdma_i2c1_rx.Instance = DMA1_Channel7;
hdma_i2c1_rx.Init.Direction = DMA_PERIPH_TO_MEMORY;
hdma_i2c1_rx.Init.PeriphInc = DMA_PINC_DISABLE;
hdma_i2c1_rx.Init.MemInc = DMA_MINC_ENABLE;
hdma_i2c1_rx.Init.PeriphDataAlignment = DMA_PDATAALIGN_BYTE;
hdma_i2c1_rx.Init.MemDataAlignment = DMA_MDATAALIGN_BYTE;
hdma_i2c1_rx.Init.Mode = DMA_NORMAL;
hdma_i2c1_rx.Init.Priority = DMA_PRIORITY_LOW;
HAL_DMA_Init(&hdma_i2c1_rx);
__HAL_LINKDMA(hi2c, hdmarx, hdma_i2c1_rx);
/* I2C1_TX Init */
hdma_i2c1_tx.Instance = DMA1_Channel6;
hdma_i2c1_tx.Init.Direction = DMA_MEMORY_TO_PERIPH;
hdma_i2c1_tx.Init.PeriphInc = DMA_PINC_DISABLE;
hdma_i2c1_tx.Init.MemInc = DMA_MINC_ENABLE;
hdma_i2c1_tx.Init.PeriphDataAlignment = DMA_PDATAALIGN_BYTE;
hdma_i2c1_tx.Init.MemDataAlignment = DMA_MDATAALIGN_BYTE;
hdma_i2c1_tx.Init.Mode = DMA_NORMAL;
hdma_i2c1_tx.Init.Priority = DMA_PRIORITY_MEDIUM;
HAL_DMA_Init(&hdma_i2c1_tx);
__HAL_LINKDMA(hi2c, hdmatx, hdma_i2c1_tx);
/* I2C1 interrupt Init */
HAL_NVIC_SetPriority(I2C1_EV_IRQn, 15, 0);
HAL_NVIC_EnableIRQ(I2C1_EV_IRQn);
HAL_NVIC_SetPriority(I2C1_ER_IRQn, 15, 0);
HAL_NVIC_EnableIRQ(I2C1_ER_IRQn);
}
void HAL_TIM_Base_MspInit(TIM_HandleTypeDef *htim_base) { void HAL_TIM_Base_MspInit(TIM_HandleTypeDef *htim_base) {
if (htim_base->Instance == TIM3) { if (htim_base->Instance == TIM3) {
/* Peripheral clock enable */ /* Peripheral clock enable */

View File

@@ -57,13 +57,6 @@ void TIM4_IRQHandler(void) {
HAL_TIM_IRQHandler(handle); HAL_TIM_IRQHandler(handle);
} }
void I2C1_EV_IRQHandler(void) { HAL_I2C_EV_IRQHandler(&hi2c1); }
void I2C1_ER_IRQHandler(void) { HAL_I2C_ER_IRQHandler(&hi2c1); }
void DMA1_Channel6_IRQHandler(void) { HAL_DMA_IRQHandler(&hdma_i2c1_tx); }
void DMA1_Channel7_IRQHandler(void) { HAL_DMA_IRQHandler(&hdma_i2c1_rx); }
void EXTI9_5_IRQHandler(void) { void EXTI9_5_IRQHandler(void) {
#ifdef INT_PD_Pin #ifdef INT_PD_Pin
HAL_GPIO_EXTI_IRQHandler(INT_PD_Pin); HAL_GPIO_EXTI_IRQHandler(INT_PD_Pin);

View File

@@ -97,7 +97,7 @@ uint8_t getTipResistanceX10() { return TIP_RESISTANCE; }
bool isTipShorted() { return false; } bool isTipShorted() { return false; }
uint8_t preStartChecksDone() { return 1; } uint8_t preStartChecksDone() { return 1; }
uint8_t getTipThermalMass() { return TIP_THERMAL_MASS; } uint16_t getTipThermalMass() { return TIP_THERMAL_MASS; }
uint8_t getTipInertia() { return TIP_THERMAL_MASS; } uint16_t getTipInertia() { return TIP_THERMAL_MASS; }
void showBootLogo(void) { BootLogo::handleShowingLogo((uint8_t *)FLASH_LOGOADDR); } void showBootLogo(void) { BootLogo::handleShowingLogo((uint8_t *)FLASH_LOGOADDR); }

View File

@@ -69,4 +69,4 @@ const int32_t uVtoDegC[] = {
const int uVtoDegCItems = sizeof(uVtoDegC) / (2 * sizeof(uVtoDegC[0])); const int uVtoDegCItems = sizeof(uVtoDegC) / (2 * sizeof(uVtoDegC[0]));
uint32_t TipThermoModel::convertuVToDegC(uint32_t tipuVDelta) { return Utils::InterpolateLookupTable(uVtoDegC, uVtoDegCItems, tipuVDelta); } TemperatureType_t TipThermoModel::convertuVToDegC(uint32_t tipuVDelta) { return Utils::InterpolateLookupTable(uVtoDegC, uVtoDegCItems, tipuVDelta); }

View File

@@ -17,8 +17,8 @@
// These control the period's of time used for the PWM // These control the period's of time used for the PWM
const uint16_t powerPWM = 255; const uint16_t powerPWM = 255;
const uint8_t holdoffTicks = 25; // This is the tick delay before temp measure starts (i.e. time for op-amp recovery) uint8_t holdoffTicks = 25; // This is the tick delay before temp measure starts (i.e. time for op-amp recovery)
const uint8_t tempMeasureTicks = 25; uint8_t tempMeasureTicks = 25;
uint16_t totalPWM = 255; // Total length of the cycle's ticks uint16_t totalPWM = 255; // Total length of the cycle's ticks
@@ -160,18 +160,8 @@ uint8_t getTipResistanceX10() {
return lastTipResistance; return lastTipResistance;
} }
uint8_t getTipThermalMass() { uint16_t getTipThermalMass() { return 120; }
if (lastTipResistance >= 80) { uint16_t getTipInertia() { return 750; }
return TIP_THERMAL_MASS;
}
return 45;
}
uint8_t getTipInertia() {
if (lastTipResistance >= 80) {
return TIP_THERMAL_MASS;
}
return 10;
}
// We want to calculate lastTipResistance // We want to calculate lastTipResistance
// If tip is connected, and the tip is cold and the tip is not being heated // If tip is connected, and the tip is cold and the tip is not being heated
// We can use the GPIO to inject a small current into the tip and measure this // We can use the GPIO to inject a small current into the tip and measure this
@@ -180,7 +170,7 @@ uint8_t getTipInertia() {
// Which is around 0.54mA this will induce: // Which is around 0.54mA this will induce:
// 6 ohm tip -> 3.24mV (Real world ~= 3320) // 6 ohm tip -> 3.24mV (Real world ~= 3320)
// 8 ohm tip -> 4.32mV (Real world ~= 4500) // 8 ohm tip -> 4.32mV (Real world ~= 4500)
// Which is definitely measureable // Which is definitely measurable
// Taking shortcuts here as we know we only really have to pick apart 6 and 8 ohm tips // Taking shortcuts here as we know we only really have to pick apart 6 and 8 ohm tips
// These are reported as 60 and 75 respectively // These are reported as 60 and 75 respectively
void performTipResistanceSampleReading() { void performTipResistanceSampleReading() {

View File

@@ -19,17 +19,17 @@ extern "C" {
} }
void start_PWM_output(void); void start_PWM_output(void);
#define ADC_Filter_Smooth 4 #define ADC_Filter_Smooth 4 /* This basically smooths over one PWM cycle / set of readings */
history<uint16_t, ADC_Filter_Smooth> ADC_Vin; history<uint16_t, ADC_Filter_Smooth> ADC_Vin;
history<uint16_t, ADC_Filter_Smooth> ADC_Temp; history<uint16_t, ADC_Filter_Smooth> ADC_Temp;
history<uint16_t, ADC_Filter_Smooth> ADC_Tip; history<uint16_t, ADC_Filter_Smooth> ADC_Tip;
volatile uint8_t ADCBurstCounter = 0;
void adc_fifo_irq(void) { // IRQ is called at the end of the 8 set readings, pop these from the FIFO and send to filters
void adc_fifo_irq(void) {
if (ADC_GetIntStatus(ADC_INT_FIFO_READY) == SET) { if (ADC_GetIntStatus(ADC_INT_FIFO_READY) == SET) {
// Read out all entries in the fifo // Read out all entries in the fifo
while (ADC_Get_FIFO_Count()) { while (ADC_Get_FIFO_Count()) {
ADCBurstCounter++; uint32_t reading = ADC_Read_FIFO();
volatile uint32_t reading = ADC_Read_FIFO();
// As per manual, 26 bit reading; lowest 16 are the ADC // As per manual, 26 bit reading; lowest 16 are the ADC
uint16_t sample = reading & 0xFFFF; uint16_t sample = reading & 0xFFFF;
uint8_t source = (reading >> 21) & 0b11111; uint8_t source = (reading >> 21) & 0b11111;
@@ -43,23 +43,16 @@ void adc_fifo_irq(void) {
case VIN_ADC_CHANNEL: case VIN_ADC_CHANNEL:
ADC_Vin.update(sample); ADC_Vin.update(sample);
break; break;
default: default:
break; break;
} }
} }
// unblock the PID controller thread
if (ADCBurstCounter >= 8) { if (xTaskGetSchedulerState() != taskSCHEDULER_NOT_STARTED) {
ADCBurstCounter = 0; BaseType_t xHigherPriorityTaskWoken = pdFALSE;
start_PWM_output(); if (pidTaskNotification) {
vTaskNotifyGiveFromISR(pidTaskNotification, &xHigherPriorityTaskWoken);
// unblock the PID controller thread portYIELD_FROM_ISR(xHigherPriorityTaskWoken);
if (xTaskGetSchedulerState() != taskSCHEDULER_NOT_STARTED) {
BaseType_t xHigherPriorityTaskWoken = pdFALSE;
if (pidTaskNotification) {
vTaskNotifyGiveFromISR(pidTaskNotification, &xHigherPriorityTaskWoken);
portYIELD_FROM_ISR(xHigherPriorityTaskWoken);
}
} }
} }
} }
@@ -67,19 +60,21 @@ void adc_fifo_irq(void) {
ADC_IntClr(ADC_INT_ALL); ADC_IntClr(ADC_INT_ALL);
} }
static bool fastPWM = false; volatile bool inFastPWMMode = false;
static void switchToFastPWM(void);
volatile uint16_t PWMSafetyTimer = 0; static void switchToFastPWM(void);
volatile uint8_t pendingPWM = 0; static void switchToSlowPWM(void);
volatile bool lastPeriodWasFast = false;
volatile uint16_t PWMSafetyTimer = 0;
volatile uint8_t pendingPWM = 0;
volatile bool pendingNextPeriodIsFast = false;
void start_PWM_output(void) { void start_PWM_output(void) {
if (PWMSafetyTimer) { if (PWMSafetyTimer) {
PWMSafetyTimer--; PWMSafetyTimer--;
if (lastPeriodWasFast != fastPWM) { if (pendingNextPeriodIsFast != inFastPWMMode) {
if (fastPWM) { if (pendingNextPeriodIsFast) {
switchToFastPWM(); switchToFastPWM();
} else { } else {
switchToSlowPWM(); switchToSlowPWM();
@@ -96,55 +91,87 @@ void start_PWM_output(void) {
} }
} else { } else {
PWM_Channel_Disable(PWM_Channel); PWM_Channel_Disable(PWM_Channel);
switchToFastPWM();
} }
TIMER_Enable(TIMER_CH0);
} }
// Timer 0 is used to co-ordinate the ADC and the output PWM // Timer 0 is used to co-ordinate the ADC and the output PWM
void timer0_comp0_callback(void) { void timer0_comp0_callback(void) {
TIMER_Disable(TIMER_CH0); if (PWM_Channel_Is_Enabled(PWM_Channel)) {
ADC_Start(); // So there appears to be a bug _somewhere_ where sometimes the comparator doesn't fire
// Its not re-occurring with specific values, so suspect its a weird bug
// For now, we just skip the cycle and throw away the ADC readings. Its a waste but
// It stops stupid glitches in readings, i'd take slight instability from the time jump
// Over the readings we get that are borked as the header is left on
// <Ralim 2023/10/14>
PWM_Channel_Disable(PWM_Channel);
// MSG("ALERT PWM Glitch\r\n");
// Triger the PID now instead
if (xTaskGetSchedulerState() != taskSCHEDULER_NOT_STARTED) {
BaseType_t xHigherPriorityTaskWoken = pdFALSE;
if (pidTaskNotification) {
vTaskNotifyGiveFromISR(pidTaskNotification, &xHigherPriorityTaskWoken);
portYIELD_FROM_ISR(xHigherPriorityTaskWoken);
}
}
} else {
ADC_Start();
}
TIMER_ClearIntStatus(TIMER_CH0, TIMER_COMP_ID_0);
}
void timer0_comp1_callback(void) {
// Trigged at end of output cycle; turn off the tip PWM
PWM_Channel_Disable(PWM_Channel);
TIMER_ClearIntStatus(TIMER_CH0, TIMER_COMP_ID_1);
} }
void timer0_comp1_callback(void) { PWM_Channel_Disable(PWM_Channel); } // Trigged at end of output cycle; turn off the tip PWM
void timer0_comp2_callback(void) {
// Triggered at end of timer cycle; re-start the tip driver
start_PWM_output();
TIMER_ClearIntStatus(TIMER_CH0, TIMER_COMP_ID_2);
}
void switchToFastPWM(void) { void switchToFastPWM(void) {
fastPWM = true; inFastPWMMode = true;
totalPWM = powerPWM + tempMeasureTicks + holdoffTicks; holdoffTicks = 10;
tempMeasureTicks = 10;
totalPWM = powerPWM + tempMeasureTicks + holdoffTicks;
TIMER_SetCompValue(TIMER_CH0, TIMER_COMP_ID_2, totalPWM); TIMER_SetCompValue(TIMER_CH0, TIMER_COMP_ID_2, totalPWM);
// ~10Hz // ~10Hz
TIMER_SetCompValue(TIMER_CH0, TIMER_COMP_ID_0, powerPWM + holdoffTicks); TIMER_SetCompValue(TIMER_CH0, TIMER_COMP_ID_0, powerPWM + holdoffTicks);
// Set divider to 11
// Set divider to 10 ~= 10.5Hz
uint32_t tmpVal = BL_RD_REG(TIMER_BASE, TIMER_TCDR); uint32_t tmpVal = BL_RD_REG(TIMER_BASE, TIMER_TCDR);
tmpVal = BL_SET_REG_BITS_VAL(tmpVal, TIMER_TCDR2, 11); tmpVal = BL_SET_REG_BITS_VAL(tmpVal, TIMER_TCDR2, 10);
BL_WR_REG(TIMER_BASE, TIMER_TCDR, tmpVal); BL_WR_REG(TIMER_BASE, TIMER_TCDR, tmpVal);
} }
void switchToSlowPWM(void) { void switchToSlowPWM(void) {
// 5Hz // 5Hz
fastPWM = false; inFastPWMMode = false;
totalPWM = powerPWM + tempMeasureTicks / 2 + holdoffTicks / 2; holdoffTicks = 5;
tempMeasureTicks = 5;
totalPWM = powerPWM + tempMeasureTicks + holdoffTicks;
TIMER_SetCompValue(TIMER_CH0, TIMER_COMP_ID_2, totalPWM); TIMER_SetCompValue(TIMER_CH0, TIMER_COMP_ID_2, totalPWM);
// Adjust ADC // Adjust ADC
TIMER_SetCompValue(TIMER_CH0, TIMER_COMP_ID_0, powerPWM + (holdoffTicks / 2)); TIMER_SetCompValue(TIMER_CH0, TIMER_COMP_ID_0, powerPWM + holdoffTicks);
// Set divider to 22 // Set divider for ~ 5Hz
uint32_t tmpVal = BL_RD_REG(TIMER_BASE, TIMER_TCDR); uint32_t tmpVal = BL_RD_REG(TIMER_BASE, TIMER_TCDR);
tmpVal = BL_SET_REG_BITS_VAL(tmpVal, TIMER_TCDR2, 22); tmpVal = BL_SET_REG_BITS_VAL(tmpVal, TIMER_TCDR2, 20);
BL_WR_REG(TIMER_BASE, TIMER_TCDR, tmpVal); BL_WR_REG(TIMER_BASE, TIMER_TCDR, tmpVal);
} }
void setTipPWM(const uint8_t pulse, const bool shouldUseFastModePWM) { void setTipPWM(const uint8_t pulse, const bool shouldUseFastModePWM) {
PWMSafetyTimer = 10; // This is decremented in the handler for PWM so that the tip pwm is PWMSafetyTimer = 10; // This is decremented in the handler for PWM so that the tip pwm is
// disabled if the PID task is not scheduled often enough. // disabled if the PID task is not scheduled often enough.
pendingPWM = pulse; pendingPWM = pulse;
fastPWM = shouldUseFastModePWM; pendingNextPeriodIsFast = shouldUseFastModePWM;
} }
extern osThreadId POWTaskHandle; extern osThreadId POWTaskHandle;
@@ -186,5 +213,6 @@ uint16_t getADCHandleTemp(uint8_t sample) { return ADC_Temp.average(); }
uint16_t getADCVin(uint8_t sample) { return ADC_Vin.average(); } uint16_t getADCVin(uint8_t sample) { return ADC_Vin.average(); }
// Returns either average or instant value. When sample is set the samples from the injected ADC are copied to the filter and then the raw reading is returned // Returns the current raw tip reading after any cleanup filtering
// For Pinecil V2 we dont do any rolling filtering other than just averaging all 4 readings in the adc snapshot
uint16_t getTipRawTemp(uint8_t sample) { return ADC_Tip.average() >> 1; } uint16_t getTipRawTemp(uint8_t sample) { return ADC_Tip.average() >> 1; }

View File

@@ -21,7 +21,6 @@ void timer0_comp1_callback(void);
void timer0_comp2_callback(void); void timer0_comp2_callback(void);
void adc_fifo_irq(void); void adc_fifo_irq(void);
void GPIO_IRQHandler(void); void GPIO_IRQHandler(void);
void switchToSlowPWM(void);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@@ -102,7 +102,7 @@ void setup_adc(void) {
adc_cfg.clkDiv = ADC_CLK_DIV_4; adc_cfg.clkDiv = ADC_CLK_DIV_4;
adc_cfg.vref = ADC_VREF_3P2V; adc_cfg.vref = ADC_VREF_3P2V;
adc_cfg.resWidth = ADC_DATA_WIDTH_14_WITH_64_AVERAGE; adc_cfg.resWidth = ADC_DATA_WIDTH_14_WITH_16_AVERAGE;
adc_cfg.inputMode = ADC_INPUT_SINGLE_END; adc_cfg.inputMode = ADC_INPUT_SINGLE_END;
adc_cfg.v18Sel = ADC_V18_SEL_1P72V; adc_cfg.v18Sel = ADC_V18_SEL_1P72V;
adc_cfg.v11Sel = ADC_V11_SEL_1P1V; adc_cfg.v11Sel = ADC_V11_SEL_1P1V;
@@ -111,7 +111,7 @@ void setup_adc(void) {
adc_cfg.chopMode = ADC_CHOP_MOD_AZ_ON; adc_cfg.chopMode = ADC_CHOP_MOD_AZ_ON;
adc_cfg.biasSel = ADC_BIAS_SEL_MAIN_BANDGAP; adc_cfg.biasSel = ADC_BIAS_SEL_MAIN_BANDGAP;
adc_cfg.vcm = ADC_PGA_VCM_1P6V; adc_cfg.vcm = ADC_PGA_VCM_1P6V;
adc_cfg.offsetCalibEn = ENABLE; adc_cfg.offsetCalibEn = DISABLE;
adc_cfg.offsetCalibVal = 0; adc_cfg.offsetCalibVal = 0;
ADC_Disable(); ADC_Disable();
@@ -120,7 +120,7 @@ void setup_adc(void) {
ADC_Init(&adc_cfg); ADC_Init(&adc_cfg);
adc_fifo_cfg.dmaEn = DISABLE; adc_fifo_cfg.dmaEn = DISABLE;
adc_fifo_cfg.fifoThreshold = ADC_FIFO_THRESHOLD_8; adc_fifo_cfg.fifoThreshold = ADC_FIFO_THRESHOLD_8; // Triger FIFO when all 8 measurements are done
ADC_FIFO_Cfg(&adc_fifo_cfg); ADC_FIFO_Cfg(&adc_fifo_cfg);
ADC_MIC_Bias_Disable(); ADC_MIC_Bias_Disable();
ADC_Tsen_Disable(); ADC_Tsen_Disable();
@@ -138,26 +138,29 @@ void setup_timer_scheduler() {
TIMER_Disable(TIMER_CH0); TIMER_Disable(TIMER_CH0);
TIMER_CFG_Type cfg = { TIMER_CFG_Type cfg = {
TIMER_CH0, // Channel TIMER_CH0, // Channel
TIMER_CLKSRC_32K, // Clock source TIMER_CLKSRC_32K, // Clock source
TIMER_PRELOAD_TRIG_COMP0, // Trigger; reset after trigger 0 TIMER_PRELOAD_TRIG_COMP2, // Trigger; reset after trigger 0
TIMER_COUNT_PRELOAD, // Counter mode TIMER_COUNT_PRELOAD, // Counter mode
22, // Clock div 22, // Clock div
(uint16_t)(powerPWM + holdoffTicks), // CH0 compare (adc) (uint16_t)(powerPWM + holdoffTicks), // CH0 compare (adc)
0, // CH1 compare (pwm out) (uint16_t)(powerPWM), // CH1 compare (pwm out)
0, // CH2 compare not used (uint16_t)(powerPWM + holdoffTicks + tempMeasureTicks), // CH2 compare end of cycle
0, // Preload 0, // Preload
}; };
TIMER_Init(&cfg); TIMER_Init(&cfg);
Timer_Int_Callback_Install(TIMER_CH0, TIMER_INT_COMP_0, timer0_comp0_callback); Timer_Int_Callback_Install(TIMER_CH0, TIMER_INT_COMP_0, timer0_comp0_callback);
Timer_Int_Callback_Install(TIMER_CH0, TIMER_INT_COMP_1, timer0_comp1_callback); Timer_Int_Callback_Install(TIMER_CH0, TIMER_INT_COMP_1, timer0_comp1_callback);
Timer_Int_Callback_Install(TIMER_CH0, TIMER_INT_COMP_2, timer0_comp2_callback);
TIMER_ClearIntStatus(TIMER_CH0, TIMER_COMP_ID_0); TIMER_ClearIntStatus(TIMER_CH0, TIMER_COMP_ID_0);
TIMER_ClearIntStatus(TIMER_CH0, TIMER_COMP_ID_1); TIMER_ClearIntStatus(TIMER_CH0, TIMER_COMP_ID_1);
TIMER_ClearIntStatus(TIMER_CH0, TIMER_COMP_ID_2);
TIMER_IntMask(TIMER_CH0, TIMER_INT_COMP_0, UNMASK); TIMER_IntMask(TIMER_CH0, TIMER_INT_COMP_0, UNMASK);
TIMER_IntMask(TIMER_CH0, TIMER_INT_COMP_1, UNMASK); TIMER_IntMask(TIMER_CH0, TIMER_INT_COMP_1, UNMASK);
TIMER_IntMask(TIMER_CH0, TIMER_INT_COMP_2, UNMASK);
CPU_Interrupt_Enable(TIMER_CH0_IRQn); CPU_Interrupt_Enable(TIMER_CH0_IRQn);
TIMER_Enable(TIMER_CH0); TIMER_Enable(TIMER_CH0);
} }

View File

@@ -29,7 +29,7 @@ uint16_t getADCVin(uint8_t sample);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
void setupFUSBIRQ(); void setupFUSBIRQ();
extern const uint8_t holdoffTicks; extern uint8_t holdoffTicks;
extern const uint8_t tempMeasureTicks; extern uint8_t tempMeasureTicks;
#endif /* PINE_SETUP_H_ */ #endif /* PINE_SETUP_H_ */

View File

@@ -69,4 +69,4 @@ const int32_t uVtoDegC[] = {
const int uVtoDegCItems = sizeof(uVtoDegC) / (2 * sizeof(int32_t)); const int uVtoDegCItems = sizeof(uVtoDegC) / (2 * sizeof(int32_t));
uint32_t TipThermoModel::convertuVToDegC(uint32_t tipuVDelta) { return Utils::InterpolateLookupTable(uVtoDegC, uVtoDegCItems, tipuVDelta); } TemperatureType_t TipThermoModel::convertuVToDegC(uint32_t tipuVDelta) { return Utils::InterpolateLookupTable(uVtoDegC, uVtoDegCItems, tipuVDelta); }

View File

@@ -1,43 +1,44 @@
/** /**
****************************************************************************** ******************************************************************************
* @file bl702_pwm.h * @file bl702_pwm.h
* @version V1.0 * @version V1.0
* @date * @date
* @brief This file is the standard driver header file * @brief This file is the standard driver header file
****************************************************************************** ******************************************************************************
* @attention * @attention
* *
* <h2><center>&copy; COPYRIGHT(c) 2020 Bouffalo Lab</center></h2> * <h2><center>&copy; COPYRIGHT(c) 2020 Bouffalo Lab</center></h2>
* *
* Redistribution and use in source and binary forms, with or without modification, * Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met: * are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright notice, * 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer. * this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice, * 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation * this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution. * and/or other materials provided with the distribution.
* 3. Neither the name of Bouffalo Lab nor the names of its contributors * 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 * may be used to endorse or promote products derived from this software
* without specific prior written permission. * without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * 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 * 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. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
****************************************************************************** ******************************************************************************
*/ */
#ifndef __BL702_PWM_H__ #ifndef __BL702_PWM_H__
#define __BL702_PWM_H__ #define __BL702_PWM_H__
#include "pwm_reg.h"
#include "bl702_common.h" #include "bl702_common.h"
#include "pwm_reg.h"
/** @addtogroup BL702_Peripheral_Driver /** @addtogroup BL702_Peripheral_Driver
* @{ * @{
@@ -55,61 +56,60 @@
* @brief PWM No. type definition * @brief PWM No. type definition
*/ */
typedef enum { typedef enum {
PWM_CH0 = 0, /*!< PWM Channel 0 define */ PWM_CH0 = 0, /*!< PWM Channel 0 define */
PWM_CH1, /*!< PWM Channel 1 define */ PWM_CH1, /*!< PWM Channel 1 define */
PWM_CH2, /*!< PWM Channel 2 define */ PWM_CH2, /*!< PWM Channel 2 define */
PWM_CH3, /*!< PWM Channel 3 define */ PWM_CH3, /*!< PWM Channel 3 define */
PWM_CH4, /*!< PWM Channel 4 define */ PWM_CH4, /*!< PWM Channel 4 define */
PWM_CH_MAX, /*!< */ PWM_CH_MAX, /*!< */
} PWM_CH_ID_Type; } PWM_CH_ID_Type;
/** /**
* @brief PWM Clock definition * @brief PWM Clock definition
*/ */
typedef enum { typedef enum {
PWM_CLK_XCLK = 0, /*!< PWM Clock source :XTAL CLK */ PWM_CLK_XCLK = 0, /*!< PWM Clock source :XTAL CLK */
PWM_CLK_BCLK, /*!< PWM Clock source :Bus CLK */ PWM_CLK_BCLK, /*!< PWM Clock source :Bus CLK */
PWM_CLK_32K, /*!< PWM Clock source :32K CLK */ PWM_CLK_32K, /*!< PWM Clock source :32K CLK */
} PWM_Clk_Type; } PWM_Clk_Type;
/** /**
* @brief PWM Stop Mode definition * @brief PWM Stop Mode definition
*/ */
typedef enum { typedef enum {
PWM_STOP_ABRUPT = 0, /*!< PWM stop abrupt select define */ PWM_STOP_ABRUPT = 0, /*!< PWM stop abrupt select define */
PWM_STOP_GRACEFUL, /*!< PWM stop graceful select define */ PWM_STOP_GRACEFUL, /*!< PWM stop graceful select define */
} PWM_Stop_Mode_Type; } PWM_Stop_Mode_Type;
/** /**
* @brief PWM mode type def * @brief PWM mode type def
*/ */
typedef enum { typedef enum {
PWM_POL_NORMAL = 0, /*!< PWM normal polarity mode define */ PWM_POL_NORMAL = 0, /*!< PWM normal polarity mode define */
PWM_POL_INVERT, /*!< PWM invert polarity mode define */ PWM_POL_INVERT, /*!< PWM invert polarity mode define */
} PWM_Polarity_Type; } PWM_Polarity_Type;
/** /**
* @brief PWM interrupt type def * @brief PWM interrupt type def
*/ */
typedef enum { typedef enum {
PWM_INT_PULSE_CNT = 0, /*!< PWM Pulse count interrupt define */ PWM_INT_PULSE_CNT = 0, /*!< PWM Pulse count interrupt define */
PWM_INT_ALL, /*!< */ PWM_INT_ALL, /*!< */
} PWM_INT_Type; } PWM_INT_Type;
/** /**
* @brief PWM configuration structure type definition * @brief PWM configuration structure type definition
*/ */
typedef struct typedef struct {
{ PWM_CH_ID_Type ch; /*!< PWM channel */
PWM_CH_ID_Type ch; /*!< PWM channel */ PWM_Clk_Type clk; /*!< PWM Clock */
PWM_Clk_Type clk; /*!< PWM Clock */ PWM_Stop_Mode_Type stopMode; /*!< PWM Stop Mode */
PWM_Stop_Mode_Type stopMode; /*!< PWM Stop Mode */ PWM_Polarity_Type pol; /*!< PWM mode type */
PWM_Polarity_Type pol; /*!< PWM mode type */ uint16_t clkDiv; /*!< PWM clkDiv num */
uint16_t clkDiv; /*!< PWM clkDiv num */ uint16_t period; /*!< PWM period set */
uint16_t period; /*!< PWM period set */ uint16_t threshold1; /*!< PWM threshold1 num */
uint16_t threshold1; /*!< PWM threshold1 num */ uint16_t threshold2; /*!< PWM threshold2 num */
uint16_t threshold2; /*!< PWM threshold2 num */ uint16_t intPulseCnt; /*!< PWM interrupt pulse count */
uint16_t intPulseCnt; /*!< PWM interrupt pulse count */
} PWM_CH_CFG_Type; } PWM_CH_CFG_Type;
/*@} end of group PWM_Public_Types */ /*@} end of group PWM_Public_Types */
@@ -121,37 +121,27 @@ typedef struct
/** @defgroup PWM_CH_ID_TYPE /** @defgroup PWM_CH_ID_TYPE
* @{ * @{
*/ */
#define IS_PWM_CH_ID_TYPE(type) (((type) == PWM_CH0) || \ #define IS_PWM_CH_ID_TYPE(type) (((type) == PWM_CH0) || ((type) == PWM_CH1) || ((type) == PWM_CH2) || ((type) == PWM_CH3) || ((type) == PWM_CH4) || ((type) == PWM_CH_MAX))
((type) == PWM_CH1) || \
((type) == PWM_CH2) || \
((type) == PWM_CH3) || \
((type) == PWM_CH4) || \
((type) == PWM_CH_MAX))
/** @defgroup PWM_CLK_TYPE /** @defgroup PWM_CLK_TYPE
* @{ * @{
*/ */
#define IS_PWM_CLK_TYPE(type) (((type) == PWM_CLK_XCLK) || \ #define IS_PWM_CLK_TYPE(type) (((type) == PWM_CLK_XCLK) || ((type) == PWM_CLK_BCLK) || ((type) == PWM_CLK_32K))
((type) == PWM_CLK_BCLK) || \
((type) == PWM_CLK_32K))
/** @defgroup PWM_STOP_MODE_TYPE /** @defgroup PWM_STOP_MODE_TYPE
* @{ * @{
*/ */
#define IS_PWM_STOP_MODE_TYPE(type) (((type) == PWM_STOP_ABRUPT) || \ #define IS_PWM_STOP_MODE_TYPE(type) (((type) == PWM_STOP_ABRUPT) || ((type) == PWM_STOP_GRACEFUL))
((type) == PWM_STOP_GRACEFUL))
/** @defgroup PWM_POLARITY_TYPE /** @defgroup PWM_POLARITY_TYPE
* @{ * @{
*/ */
#define IS_PWM_POLARITY_TYPE(type) (((type) == PWM_POL_NORMAL) || \ #define IS_PWM_POLARITY_TYPE(type) (((type) == PWM_POL_NORMAL) || ((type) == PWM_POL_INVERT))
((type) == PWM_POL_INVERT))
/** @defgroup PWM_INT_TYPE /** @defgroup PWM_INT_TYPE
* @{ * @{
*/ */
#define IS_PWM_INT_TYPE(type) (((type) == PWM_INT_PULSE_CNT) || \ #define IS_PWM_INT_TYPE(type) (((type) == PWM_INT_PULSE_CNT) || ((type) == PWM_INT_ALL))
((type) == PWM_INT_ALL))
/*@} end of group PWM_Public_Constants */ /*@} end of group PWM_Public_Constants */
@@ -173,21 +163,21 @@ typedef struct
void PWM_IRQHandler(void); void PWM_IRQHandler(void);
#endif #endif
BL_Err_Type PWM_Channel_Init(PWM_CH_CFG_Type *chCfg); BL_Err_Type PWM_Channel_Init(PWM_CH_CFG_Type *chCfg);
void PWM_Channel_Update(PWM_CH_ID_Type ch, uint16_t period, uint16_t threshold1, uint16_t threshold2); void PWM_Channel_Update(PWM_CH_ID_Type ch, uint16_t period, uint16_t threshold1, uint16_t threshold2);
void PWM_Channel_Set_Div(PWM_CH_ID_Type ch, uint16_t div); void PWM_Channel_Set_Div(PWM_CH_ID_Type ch, uint16_t div);
void PWM_Channel_Set_Threshold1(PWM_CH_ID_Type ch, uint16_t threshold1); void PWM_Channel_Set_Threshold1(PWM_CH_ID_Type ch, uint16_t threshold1);
void PWM_Channel_Set_Threshold2(PWM_CH_ID_Type ch, uint16_t threshold2); void PWM_Channel_Set_Threshold2(PWM_CH_ID_Type ch, uint16_t threshold2);
void PWM_Channel_Set_Period(PWM_CH_ID_Type ch, uint16_t period); void PWM_Channel_Set_Period(PWM_CH_ID_Type ch, uint16_t period);
void PWM_Channel_Get(PWM_CH_ID_Type ch, uint16_t *period, uint16_t *threshold1, uint16_t *threshold2); void PWM_Channel_Get(PWM_CH_ID_Type ch, uint16_t *period, uint16_t *threshold1, uint16_t *threshold2);
void PWM_IntMask(PWM_CH_ID_Type ch, PWM_INT_Type intType, BL_Mask_Type intMask); void PWM_IntMask(PWM_CH_ID_Type ch, PWM_INT_Type intType, BL_Mask_Type intMask);
void PWM_Channel_Enable(PWM_CH_ID_Type ch); void PWM_Channel_Enable(PWM_CH_ID_Type ch);
void PWM_Channel_Disable(PWM_CH_ID_Type ch); uint8_t PWM_Channel_Is_Enabled(PWM_CH_ID_Type ch);
void PWM_SW_Mode(PWM_CH_ID_Type ch, BL_Fun_Type enable); void PWM_Channel_Disable(PWM_CH_ID_Type ch);
void PWM_SW_Force_Value(PWM_CH_ID_Type ch, uint8_t value); void PWM_SW_Mode(PWM_CH_ID_Type ch, BL_Fun_Type enable);
void PWM_Int_Callback_Install(PWM_CH_ID_Type ch, uint32_t intType, intCallback_Type *cbFun); void PWM_SW_Force_Value(PWM_CH_ID_Type ch, uint8_t value);
void PWM_Int_Callback_Install(PWM_CH_ID_Type ch, uint32_t intType, intCallback_Type *cbFun);
BL_Err_Type PWM_Smart_Configure(PWM_CH_ID_Type ch, uint32_t frequency, uint8_t dutyCycle); BL_Err_Type PWM_Smart_Configure(PWM_CH_ID_Type ch, uint32_t frequency, uint8_t dutyCycle);
/*@} end of group PWM_Public_Functions */ /*@} end of group PWM_Public_Functions */
/*@} end of group PWM */ /*@} end of group PWM */

View File

@@ -354,7 +354,18 @@ void PWM_Channel_Enable(PWM_CH_ID_Type ch) {
tmpVal = BL_RD_REG(PWMx, PWM_CONFIG); tmpVal = BL_RD_REG(PWMx, PWM_CONFIG);
BL_WR_REG(PWMx, PWM_CONFIG, BL_CLR_REG_BIT(tmpVal, PWM_STOP_EN)); BL_WR_REG(PWMx, PWM_CONFIG, BL_CLR_REG_BIT(tmpVal, PWM_STOP_EN));
} }
uint8_t PWM_Channel_Is_Enabled(PWM_CH_ID_Type ch) {
uint32_t tmpVal;
/* Get channel register */
uint32_t PWMx = PWM_Get_Channel_Reg(ch);
/* Check the parameters */
CHECK_PARAM(IS_PWM_CH_ID_TYPE(ch));
/* Config pwm clock to enable pwm */
tmpVal = BL_RD_REG(PWMx, PWM_CONFIG);
return BL_GET_REG_BITS_VAL(tmpVal, PWM_STOP_EN) == 0;
}
/**************************************************************************** /****************************************************************************
* @brief PWM disable * @brief PWM disable
* *

View File

@@ -160,11 +160,16 @@
#define HALL_SI7210 #define HALL_SI7210
#define DEBUG_UART_OUTPUT #define DEBUG_UART_OUTPUT
#define HAS_POWER_DEBUG_MENU #define HAS_POWER_DEBUG_MENU
#define HARDWARE_MAX_WATTAGE_X10 750 #define HARDWARE_MAX_WATTAGE_X10 750
#define TIP_THERMAL_MASS 65 // X10 watts to raise 1 deg C in 1 second #define BLE_ENABLED // We have a BLE stack
#define BLE_ENABLED #define NEEDS_VBUS_PROBE 0 // No vbus probe, its not connected in pcb
#define NEEDS_VBUS_PROBE 0 #define CANT_DIRECT_READ_SETTINGS // We cant memcpy settings due to flash cache
#define CANT_DIRECT_READ_SETTINGS #define TIP_CONTROL_PID // We use PID rather than integrator
#define TIP_PID_KP 45 // Reasonable compromise for most tips so far
#define TIP_PID_KI 9 // About as high for stability across tips
#define TIP_PID_KD 200 // Helps dampen smaller tips; ~= nothing for larger tips
#define FILTER_DISPLAYED_TIP_TEMP 8 // Filtering for GUI display
#endif /* Pinecilv2 */ #endif /* Pinecilv2 */
#define FLASH_PAGE_SIZE (1024) // Read pages #define FLASH_PAGE_SIZE (1024) // Read pages

View File

@@ -234,8 +234,8 @@ uint8_t getTipResistanceX10() { return TIP_RESISTANCE; }
bool isTipShorted() { return false; } bool isTipShorted() { return false; }
uint8_t preStartChecksDone() { return 1; } uint8_t preStartChecksDone() { return 1; }
uint8_t getTipThermalMass() { return TIP_THERMAL_MASS; } uint16_t getTipThermalMass() { return TIP_THERMAL_MASS; }
uint8_t getTipInertia() { return TIP_THERMAL_INERTIA; } uint16_t getTipInertia() { return TIP_THERMAL_INERTIA; }
void setBuzzer(bool on) {} void setBuzzer(bool on) {}

View File

@@ -1,91 +0,0 @@
/*
* FRToSI2C.cpp
*
* Created on: 14Apr.,2018
* Author: Ralim
*/
#include "BSP.h"
#include "Setup.h"
#include <I2C_Wrapper.hpp>
SemaphoreHandle_t FRToSI2C::I2CSemaphore = nullptr;
StaticSemaphore_t FRToSI2C::xSemaphoreBuffer;
void FRToSI2C::CpltCallback() {
hi2c1.State = HAL_I2C_STATE_READY; // Force state reset (even if tx error)
if (I2CSemaphore) {
xSemaphoreGiveFromISR(I2CSemaphore, NULL);
}
}
bool FRToSI2C::Mem_Read(uint16_t DevAddress, uint16_t MemAddress, uint8_t *pData, uint16_t Size) {
if (!lock())
return false;
if (HAL_I2C_Mem_Read(&hi2c1, DevAddress, MemAddress, I2C_MEMADD_SIZE_8BIT, pData, Size, 500) != HAL_OK) {
I2C_Unstick();
unlock();
return false;
}
unlock();
return true;
}
bool FRToSI2C::I2C_RegisterWrite(uint8_t address, uint8_t reg, uint8_t data) { return Mem_Write(address, reg, &data, 1); }
uint8_t FRToSI2C::I2C_RegisterRead(uint8_t add, uint8_t reg) {
uint8_t tx_data[1];
Mem_Read(add, reg, tx_data, 1);
return tx_data[0];
}
bool FRToSI2C::Mem_Write(uint16_t DevAddress, uint16_t MemAddress, uint8_t *pData, uint16_t Size) {
if (!lock())
return false;
if (HAL_I2C_Mem_Write(&hi2c1, DevAddress, MemAddress, I2C_MEMADD_SIZE_8BIT, pData, Size, 500) != HAL_OK) {
I2C_Unstick();
unlock();
return false;
}
unlock();
return true;
}
bool FRToSI2C::Transmit(uint16_t DevAddress, uint8_t *pData, uint16_t Size) {
if (!lock())
return false;
if (HAL_I2C_Master_Transmit_IT(&hi2c1, DevAddress, pData, Size) != HAL_OK) {
I2C_Unstick();
unlock();
return false;
}
return true;
}
bool FRToSI2C::probe(uint16_t DevAddress) {
if (!lock())
return false;
uint8_t buffer[1];
bool worked = HAL_I2C_Mem_Read(&hi2c1, DevAddress, 0x0F, I2C_MEMADD_SIZE_8BIT, buffer, 1, 1000) == HAL_OK;
unlock();
return worked;
}
void FRToSI2C::I2C_Unstick() { unstick_I2C(); }
void FRToSI2C::unlock() { xSemaphoreGive(I2CSemaphore); }
bool FRToSI2C::lock() { return xSemaphoreTake(I2CSemaphore, (TickType_t)50) == pdTRUE; }
bool FRToSI2C::writeRegistersBulk(const uint8_t address, const I2C_REG *registers, const uint8_t registersLength) {
for (int index = 0; index < registersLength; index++) {
if (!I2C_RegisterWrite(address, registers[index].reg, registers[index].val)) {
return false;
}
if (registers[index].pause_ms)
delay_ms(registers[index].pause_ms);
}
return true;
}

View File

@@ -23,12 +23,6 @@ void HAL_ADCEx_InjectedConvCpltCallback(ADC_HandleTypeDef *hadc) {
} }
} }
} }
void HAL_I2C_MasterRxCpltCallback(I2C_HandleTypeDef *hi2c __unused) { FRToSI2C::CpltCallback(); }
void HAL_I2C_MasterTxCpltCallback(I2C_HandleTypeDef *hi2c __unused) { FRToSI2C::CpltCallback(); }
void HAL_I2C_MemTxCpltCallback(I2C_HandleTypeDef *hi2c __unused) { FRToSI2C::CpltCallback(); }
void HAL_I2C_ErrorCallback(I2C_HandleTypeDef *hi2c __unused) { FRToSI2C::CpltCallback(); }
void HAL_I2C_AbortCpltCallback(I2C_HandleTypeDef *hi2c __unused) { FRToSI2C::CpltCallback(); }
void HAL_I2C_MemRxCpltCallback(I2C_HandleTypeDef *hi2c __unused) { FRToSI2C::CpltCallback(); }
extern osThreadId POWTaskHandle; extern osThreadId POWTaskHandle;

View File

@@ -18,12 +18,6 @@
extern "C" { extern "C" {
#endif #endif
void HAL_ADCEx_InjectedConvCpltCallback(ADC_HandleTypeDef *hadc); void HAL_ADCEx_InjectedConvCpltCallback(ADC_HandleTypeDef *hadc);
void HAL_I2C_ErrorCallback(I2C_HandleTypeDef *hi2c);
void HAL_I2C_AbortCpltCallback(I2C_HandleTypeDef *hi2c);
void HAL_I2C_MasterTxCpltCallback(I2C_HandleTypeDef *hi2c);
void HAL_I2C_MasterRxCpltCallback(I2C_HandleTypeDef *hi2c);
void HAL_I2C_MemTxCpltCallback(I2C_HandleTypeDef *hi2c);
void HAL_I2C_MemRxCpltCallback(I2C_HandleTypeDef *hi2c);
void HAL_GPIO_EXTI_Callback(uint16_t); void HAL_GPIO_EXTI_Callback(uint16_t);
#ifdef __cplusplus #ifdef __cplusplus

View File

@@ -14,10 +14,6 @@ ADC_HandleTypeDef hadc1;
ADC_HandleTypeDef hadc2; ADC_HandleTypeDef hadc2;
DMA_HandleTypeDef hdma_adc1; DMA_HandleTypeDef hdma_adc1;
I2C_HandleTypeDef hi2c1;
DMA_HandleTypeDef hdma_i2c1_rx;
DMA_HandleTypeDef hdma_i2c1_tx;
IWDG_HandleTypeDef hiwdg; IWDG_HandleTypeDef hiwdg;
TIM_HandleTypeDef htim4; // Tip control TIM_HandleTypeDef htim4; // Tip control
TIM_HandleTypeDef htim2; // ADC Scheduling TIM_HandleTypeDef htim2; // ADC Scheduling
@@ -28,7 +24,6 @@ uint16_t ADCReadings[ADC_SAMPLES]; // Used to store the adc readings for the han
// Functions // Functions
static void SystemClock_Config(void); static void SystemClock_Config(void);
static void MX_ADC1_Init(void); static void MX_ADC1_Init(void);
static void MX_I2C1_Init(void);
static void MX_IWDG_Init(void); static void MX_IWDG_Init(void);
static void MX_TIM4_Init(void); // Tip control static void MX_TIM4_Init(void); // Tip control
static void MX_TIM2_Init(void); // ADC Scheduling static void MX_TIM2_Init(void); // ADC Scheduling
@@ -44,9 +39,6 @@ void Setup_HAL() {
// These are not shared so no harm enabling // These are not shared so no harm enabling
__HAL_AFIO_REMAP_SWJ_NOJTAG(); __HAL_AFIO_REMAP_SWJ_NOJTAG();
#ifdef SCL_Pin
MX_I2C1_Init();
#endif
MX_GPIO_Init(); MX_GPIO_Init();
MX_DMA_Init(); MX_DMA_Init();
MX_ADC1_Init(); MX_ADC1_Init();
@@ -249,33 +241,6 @@ static void MX_ADC2_Init(void) {
; ;
} }
} }
/* I2C1 init function */
static void MX_I2C1_Init(void) {
hi2c1.Instance = I2C1;
hi2c1.Init.ClockSpeed = 200000;
// OLED doesnt handle >100k when its asleep (off).
hi2c1.Init.DutyCycle = I2C_DUTYCYCLE_16_9;
hi2c1.Init.OwnAddress1 = 0;
hi2c1.Init.AddressingMode = I2C_ADDRESSINGMODE_7BIT;
hi2c1.Init.DualAddressMode = I2C_DUALADDRESS_DISABLE;
hi2c1.Init.OwnAddress2 = 0;
hi2c1.Init.GeneralCallMode = I2C_GENERALCALL_DISABLE;
hi2c1.Init.NoStretchMode = I2C_NOSTRETCH_DISABLE;
__HAL_I2C_DISABLE(&hi2c1);
__HAL_RCC_I2C1_CLK_ENABLE();
// 13. Set SWRST bit in I2Cx_CR1 register.
hi2c1.Instance->CR1 |= 0x8000;
asm("nop");
// 14. Clear SWRST bit in I2Cx_CR1 register.
hi2c1.Instance->CR1 &= ~0x8000;
HAL_I2C_Init(&hi2c1);
unstick_I2C();
}
/* IWDG init function */ /* IWDG init function */
static void MX_IWDG_Init(void) { static void MX_IWDG_Init(void) {

View File

@@ -18,10 +18,6 @@ extern ADC_HandleTypeDef hadc1;
extern ADC_HandleTypeDef hadc2; extern ADC_HandleTypeDef hadc2;
extern DMA_HandleTypeDef hdma_adc1; extern DMA_HandleTypeDef hdma_adc1;
extern DMA_HandleTypeDef hdma_i2c1_rx;
extern DMA_HandleTypeDef hdma_i2c1_tx;
extern I2C_HandleTypeDef hi2c1;
extern IWDG_HandleTypeDef hiwdg; extern IWDG_HandleTypeDef hiwdg;
extern TIM_HandleTypeDef htim4; extern TIM_HandleTypeDef htim4;

View File

@@ -8,4 +8,4 @@
#include "Utils.h" #include "Utils.h"
#include "configuration.h" #include "configuration.h"
uint32_t TipThermoModel::convertuVToDegC(uint32_t tipuVDelta) { return (tipuVDelta * 50) / 485; } TemperatureType_t TipThermoModel::convertuVToDegC(uint32_t tipuVDelta) { return (tipuVDelta * 50) / 485; }

View File

@@ -163,7 +163,7 @@
#define OLED_I2CBB2 #define OLED_I2CBB2
#define MODEL_HAS_DCDC // We dont have DC/DC but have reallly fast PWM that gets us roughly the same place #define MODEL_HAS_DCDC // We dont have DC/DC but have reallly fast PWM that gets us roughly the same place
#endif /* S60 */ #endif /* S60 */
#define FLASH_LOGOADDR (0x08000000 + (62 * 1024)) #define FLASH_LOGOADDR (0x08000000 + (62 * 1024))
#define SETTINGS_START_PAGE (0x08000000 + (63 * 1024)) #define SETTINGS_START_PAGE (0x08000000 + (63 * 1024))

View File

@@ -20,6 +20,4 @@ void preRToSInit() {
#ifdef I2C_SOFT_BUS_2 #ifdef I2C_SOFT_BUS_2
I2CBB2::init(); I2CBB2::init();
#endif #endif
/* Init the IPC objects */
FRToSI2C::FRToSInit();
} }

View File

@@ -72,54 +72,6 @@ void HAL_ADC_MspInit(ADC_HandleTypeDef *hadc) {
} }
} }
void HAL_I2C_MspInit(I2C_HandleTypeDef *hi2c) {
#ifdef SCL_Pin
GPIO_InitTypeDef GPIO_InitStruct;
/**I2C1 GPIO Configuration
PB6 ------> I2C1_SCL
PB7 ------> I2C1_SDA
*/
GPIO_InitStruct.Pin = SCL_Pin | SDA_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_AF_OD;
GPIO_InitStruct.Pull = GPIO_PULLUP;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_MEDIUM;
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
/* I2C1 DMA Init */
/* I2C1_RX Init */
hdma_i2c1_rx.Instance = DMA1_Channel7;
hdma_i2c1_rx.Init.Direction = DMA_PERIPH_TO_MEMORY;
hdma_i2c1_rx.Init.PeriphInc = DMA_PINC_DISABLE;
hdma_i2c1_rx.Init.MemInc = DMA_MINC_ENABLE;
hdma_i2c1_rx.Init.PeriphDataAlignment = DMA_PDATAALIGN_BYTE;
hdma_i2c1_rx.Init.MemDataAlignment = DMA_MDATAALIGN_BYTE;
hdma_i2c1_rx.Init.Mode = DMA_NORMAL;
hdma_i2c1_rx.Init.Priority = DMA_PRIORITY_LOW;
HAL_DMA_Init(&hdma_i2c1_rx);
__HAL_LINKDMA(hi2c, hdmarx, hdma_i2c1_rx);
/* I2C1_TX Init */
hdma_i2c1_tx.Instance = DMA1_Channel6;
hdma_i2c1_tx.Init.Direction = DMA_MEMORY_TO_PERIPH;
hdma_i2c1_tx.Init.PeriphInc = DMA_PINC_DISABLE;
hdma_i2c1_tx.Init.MemInc = DMA_MINC_ENABLE;
hdma_i2c1_tx.Init.PeriphDataAlignment = DMA_PDATAALIGN_BYTE;
hdma_i2c1_tx.Init.MemDataAlignment = DMA_MDATAALIGN_BYTE;
hdma_i2c1_tx.Init.Mode = DMA_NORMAL;
hdma_i2c1_tx.Init.Priority = DMA_PRIORITY_MEDIUM;
HAL_DMA_Init(&hdma_i2c1_tx);
__HAL_LINKDMA(hi2c, hdmatx, hdma_i2c1_tx);
/* I2C1 interrupt Init */
HAL_NVIC_SetPriority(I2C1_EV_IRQn, 15, 0);
HAL_NVIC_EnableIRQ(I2C1_EV_IRQn);
HAL_NVIC_SetPriority(I2C1_ER_IRQn, 15, 0);
HAL_NVIC_EnableIRQ(I2C1_ER_IRQn);
#endif
}
void HAL_TIM_Base_MspInit(TIM_HandleTypeDef *htim_base) { void HAL_TIM_Base_MspInit(TIM_HandleTypeDef *htim_base) {
if (htim_base->Instance == TIM4) { if (htim_base->Instance == TIM4) {
/* Peripheral clock enable */ /* Peripheral clock enable */

View File

@@ -33,10 +33,4 @@ void TIM1_UP_IRQHandler(void) { HAL_TIM_IRQHandler(&htim1); }
void TIM4_IRQHandler(void) { HAL_TIM_IRQHandler(&htim4); } void TIM4_IRQHandler(void) { HAL_TIM_IRQHandler(&htim4); }
void TIM2_IRQHandler(void) { HAL_TIM_IRQHandler(&htim2); } void TIM2_IRQHandler(void) { HAL_TIM_IRQHandler(&htim2); }
void I2C1_EV_IRQHandler(void) { HAL_I2C_EV_IRQHandler(&hi2c1); }
void I2C1_ER_IRQHandler(void) { HAL_I2C_ER_IRQHandler(&hi2c1); }
void DMA1_Channel6_IRQHandler(void) { HAL_DMA_IRQHandler(&hdma_i2c1_tx); }
void DMA1_Channel7_IRQHandler(void) { HAL_DMA_IRQHandler(&hdma_i2c1_rx); }
void EXTI9_5_IRQHandler(void) { HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_9); } void EXTI9_5_IRQHandler(void) { HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_9); }

View File

@@ -5,14 +5,15 @@
* Author: Ralim * Author: Ralim
*/ */
#include "accelerometers_common.h"
#include <BMA223.hpp> #include <BMA223.hpp>
#include <array> #include <array>
bool BMA223::detect() { bool BMA223::detect() {
if (FRToSI2C::probe(BMA223_ADDRESS)) { if (ACCEL_I2C_CLASS::probe(BMA223_ADDRESS)) {
// Read chip id to ensure its not an address collision // Read chip id to ensure its not an address collision
uint8_t id = 0; uint8_t id = 0;
if (FRToSI2C::Mem_Read(BMA223_ADDRESS, BMA223_BGW_CHIPID, &id, 1)) { if (ACCEL_I2C_CLASS::Mem_Read(BMA223_ADDRESS, BMA223_BGW_CHIPID, &id, 1)) {
return id == 0b11111000; return id == 0b11111000;
} }
} }
@@ -20,7 +21,7 @@ bool BMA223::detect() {
return false; return false;
} }
static const FRToSI2C::I2C_REG i2c_registers[] = { static const ACCEL_I2C_CLASS::I2C_REG i2c_registers[] = {
// //
// //
{BMA223_PMU_RANGE, 0b00000011, 0}, // 2G range {BMA223_PMU_RANGE, 0b00000011, 0}, // 2G range
@@ -44,7 +45,7 @@ bool BMA223::initalize() {
// Hysteresis is set to ~ 16 counts // Hysteresis is set to ~ 16 counts
// Theta blocking is set to 0b10 // Theta blocking is set to 0b10
return FRToSI2C::writeRegistersBulk(BMA223_ADDRESS, i2c_registers, sizeof(i2c_registers) / sizeof(i2c_registers[0])); return ACCEL_I2C_CLASS::writeRegistersBulk(BMA223_ADDRESS, i2c_registers, sizeof(i2c_registers) / sizeof(i2c_registers[0]));
} }
void BMA223::getAxisReadings(int16_t &x, int16_t &y, int16_t &z) { void BMA223::getAxisReadings(int16_t &x, int16_t &y, int16_t &z) {
@@ -52,7 +53,7 @@ void BMA223::getAxisReadings(int16_t &x, int16_t &y, int16_t &z) {
// And yet there are MSB and LSB registers _sigh_. // And yet there are MSB and LSB registers _sigh_.
uint8_t sensorData[6] = {0, 0, 0, 0, 0, 0}; uint8_t sensorData[6] = {0, 0, 0, 0, 0, 0};
if (FRToSI2C::Mem_Read(BMA223_ADDRESS, BMA223_ACCD_X_LSB, sensorData, 6) == false) { if (ACCEL_I2C_CLASS::Mem_Read(BMA223_ADDRESS, BMA223_ACCD_X_LSB, sensorData, 6) == false) {
x = y = z = 0; x = y = z = 0;
return; return;
} }

View File

@@ -10,6 +10,8 @@
#include "BMA223_defines.h" #include "BMA223_defines.h"
#include "BSP.h" #include "BSP.h"
#include "I2C_Wrapper.hpp" #include "I2C_Wrapper.hpp"
#include "accelerometers_common.h"
class BMA223 { class BMA223 {
public: public:
@@ -17,7 +19,7 @@ public:
static bool initalize(); static bool initalize();
// 1 = rh, 2,=lh, 8=flat // 1 = rh, 2,=lh, 8=flat
static Orientation getOrientation() { static Orientation getOrientation() {
uint8_t val = FRToSI2C::I2C_RegisterRead(BMA223_ADDRESS, BMA223_INT_STATUS_3); uint8_t val = ACCEL_I2C_CLASS::I2C_RegisterRead(BMA223_ADDRESS, BMA223_INT_STATUS_3);
val >>= 4; // we dont need high values val >>= 4; // we dont need high values
val &= 0b11; val &= 0b11;
if (val & 0b10) { if (val & 0b10) {

View File

@@ -314,4 +314,15 @@ bool I2CBB1::writeRegistersBulk(const uint8_t address, const I2C_REG *registers,
} }
return true; return true;
} }
bool I2CBB1::wakePart(uint16_t DevAddress) {
// wakepart is a special case where only the device address is sent
if (!lock())
return false;
start();
bool ack = send(DevAddress);
stop();
unlock();
return ack;
}
#endif #endif

View File

@@ -36,6 +36,7 @@ public:
const uint8_t pause_ms; // How many ms to pause _after_ writing this reg const uint8_t pause_ms; // How many ms to pause _after_ writing this reg
} I2C_REG; } I2C_REG;
static bool writeRegistersBulk(const uint8_t address, const I2C_REG *registers, const uint8_t registersLength); static bool writeRegistersBulk(const uint8_t address, const I2C_REG *registers, const uint8_t registersLength);
static bool wakePart(uint16_t DevAddress);
private: private:
static SemaphoreHandle_t I2CSemaphore; static SemaphoreHandle_t I2CSemaphore;

View File

@@ -313,4 +313,15 @@ bool I2CBB2::writeRegistersBulk(const uint8_t address, const I2C_REG *registers,
} }
return true; return true;
} }
bool I2CBB2::wakePart(uint16_t DevAddress) {
// wakepart is a special case where only the device address is sent
if (!lock())
return false;
start();
bool ack = send(DevAddress);
stop();
unlock();
return ack;
}
#endif #endif

View File

@@ -36,6 +36,7 @@ public:
const uint8_t pause_ms; // How many ms to pause _after_ writing this reg const uint8_t pause_ms; // How many ms to pause _after_ writing this reg
} I2C_REG; } I2C_REG;
static bool writeRegistersBulk(const uint8_t address, const I2C_REG *registers, const uint8_t registersLength); static bool writeRegistersBulk(const uint8_t address, const I2C_REG *registers, const uint8_t registersLength);
static bool wakePart(uint16_t DevAddress);
private: private:
static SemaphoreHandle_t I2CSemaphore; static SemaphoreHandle_t I2CSemaphore;

View File

@@ -5,12 +5,12 @@
* Author: Ben V. Brown * Author: Ben V. Brown
*/ */
#include "MMA8652FC.hpp"
#include "accelerometers_common.h"
#include "cmsis_os.h"
#include <array> #include <array>
#include "MMA8652FC.hpp" static const ACCEL_I2C_CLASS::I2C_REG i2c_registers[] = {
#include "cmsis_os.h"
static const FRToSI2C::I2C_REG i2c_registers[] = {
{CTRL_REG2, 0, 0}, // Normal mode {CTRL_REG2, 0, 0}, // Normal mode
{CTRL_REG2, 0x40, 2}, // Reset all registers to POR values {CTRL_REG2, 0x40, 2}, // Reset all registers to POR values
{FF_MT_CFG_REG, 0x78, 0}, // Enable motion detection for X, Y, Z axis, latch disabled {FF_MT_CFG_REG, 0x78, 0}, // Enable motion detection for X, Y, Z axis, latch disabled
@@ -26,11 +26,11 @@ static const FRToSI2C::I2C_REG i2c_registers[] = {
{CTRL_REG1, 0x19, 0} // ODR=12 Hz, Active mode {CTRL_REG1, 0x19, 0} // ODR=12 Hz, Active mode
}; };
bool MMA8652FC::initalize() { return FRToSI2C::writeRegistersBulk(MMA8652FC_I2C_ADDRESS, i2c_registers, sizeof(i2c_registers) / sizeof(i2c_registers[0])); } bool MMA8652FC::initalize() { return ACCEL_I2C_CLASS::writeRegistersBulk(MMA8652FC_I2C_ADDRESS, i2c_registers, sizeof(i2c_registers) / sizeof(i2c_registers[0])); }
Orientation MMA8652FC::getOrientation() { Orientation MMA8652FC::getOrientation() {
// First read the PL_STATUS register // First read the PL_STATUS register
uint8_t plStatus = FRToSI2C::I2C_RegisterRead(MMA8652FC_I2C_ADDRESS, PL_STATUS_REG); uint8_t plStatus = ACCEL_I2C_CLASS::I2C_RegisterRead(MMA8652FC_I2C_ADDRESS, PL_STATUS_REG);
if ((plStatus & 0b10000000) == 0b10000000) { if ((plStatus & 0b10000000) == 0b10000000) {
plStatus >>= 1; // We don't need the up/down bit plStatus >>= 1; // We don't need the up/down bit
plStatus &= 0x03; // mask to the two lower bits plStatus &= 0x03; // mask to the two lower bits
@@ -47,11 +47,11 @@ Orientation MMA8652FC::getOrientation() {
void MMA8652FC::getAxisReadings(int16_t &x, int16_t &y, int16_t &z) { void MMA8652FC::getAxisReadings(int16_t &x, int16_t &y, int16_t &z) {
std::array<int16_t, 3> sensorData; std::array<int16_t, 3> sensorData;
FRToSI2C::Mem_Read(MMA8652FC_I2C_ADDRESS, OUT_X_MSB_REG, reinterpret_cast<uint8_t *>(sensorData.begin()), sensorData.size() * sizeof(int16_t)); ACCEL_I2C_CLASS::Mem_Read(MMA8652FC_I2C_ADDRESS, OUT_X_MSB_REG, reinterpret_cast<uint8_t *>(sensorData.begin()), sensorData.size() * sizeof(int16_t));
x = static_cast<int16_t>(__builtin_bswap16(*reinterpret_cast<uint16_t *>(&sensorData[0]))); x = static_cast<int16_t>(__builtin_bswap16(*reinterpret_cast<uint16_t *>(&sensorData[0])));
y = static_cast<int16_t>(__builtin_bswap16(*reinterpret_cast<uint16_t *>(&sensorData[1]))); y = static_cast<int16_t>(__builtin_bswap16(*reinterpret_cast<uint16_t *>(&sensorData[1])));
z = static_cast<int16_t>(__builtin_bswap16(*reinterpret_cast<uint16_t *>(&sensorData[2]))); z = static_cast<int16_t>(__builtin_bswap16(*reinterpret_cast<uint16_t *>(&sensorData[2])));
} }
bool MMA8652FC::detect() { return FRToSI2C::probe(MMA8652FC_I2C_ADDRESS); } bool MMA8652FC::detect() { return ACCEL_I2C_CLASS::probe(MMA8652FC_I2C_ADDRESS); }

View File

@@ -6,11 +6,13 @@
*/ */
#include "MSA301_defines.h" #include "MSA301_defines.h"
#include "accelerometers_common.h"
#include <MSA301.h> #include <MSA301.h>
#define MSA301_I2C_ADDRESS 0x26 << 1
bool MSA301::detect() { return FRToSI2C::probe(MSA301_I2C_ADDRESS); }
static const FRToSI2C::I2C_REG i2c_registers[] = { #define MSA301_I2C_ADDRESS 0x26 << 1
bool MSA301::detect() { return ACCEL_I2C_CLASS::probe(MSA301_I2C_ADDRESS); }
static const ACCEL_I2C_CLASS::I2C_REG i2c_registers[] = {
// //
// //
{MSA301_REG_ODR, 0b00001000, 1}, // X/Y/Z enabled @ 250Hz {MSA301_REG_ODR, 0b00001000, 1}, // X/Y/Z enabled @ 250Hz
@@ -21,11 +23,11 @@ static const FRToSI2C::I2C_REG i2c_registers[] = {
}; };
bool MSA301::initalize() { return FRToSI2C::writeRegistersBulk(MSA301_I2C_ADDRESS, i2c_registers, sizeof(i2c_registers) / sizeof(i2c_registers[0])); } bool MSA301::initalize() { return ACCEL_I2C_CLASS::writeRegistersBulk(MSA301_I2C_ADDRESS, i2c_registers, sizeof(i2c_registers) / sizeof(i2c_registers[0])); }
Orientation MSA301::getOrientation() { Orientation MSA301::getOrientation() {
uint8_t temp = 0; uint8_t temp = 0;
FRToSI2C::Mem_Read(MSA301_I2C_ADDRESS, MSA301_REG_ORIENT_STATUS, &temp, 1); ACCEL_I2C_CLASS::Mem_Read(MSA301_I2C_ADDRESS, MSA301_REG_ORIENT_STATUS, &temp, 1);
switch (temp) { switch (temp) {
case 112: case 112:
return Orientation::ORIENTATION_LEFT_HAND; return Orientation::ORIENTATION_LEFT_HAND;
@@ -39,7 +41,7 @@ Orientation MSA301::getOrientation() {
void MSA301::getAxisReadings(int16_t &x, int16_t &y, int16_t &z) { void MSA301::getAxisReadings(int16_t &x, int16_t &y, int16_t &z) {
uint8_t temp[6]; uint8_t temp[6];
// Bulk read all 6 regs // Bulk read all 6 regs
FRToSI2C::Mem_Read(MSA301_I2C_ADDRESS, MSA301_REG_OUT_X_L, temp, 6); ACCEL_I2C_CLASS::Mem_Read(MSA301_I2C_ADDRESS, MSA301_REG_OUT_X_L, temp, 6);
x = int16_t(((int16_t)temp[1]) << 8 | temp[0]) >> 2; x = int16_t(((int16_t)temp[1]) << 8 | temp[0]) >> 2;
y = int16_t(((int16_t)temp[3]) << 8 | temp[2]) >> 2; y = int16_t(((int16_t)temp[3]) << 8 | temp[2]) >> 2;
z = int16_t(((int16_t)temp[5]) << 8 | temp[4]) >> 2; z = int16_t(((int16_t)temp[5]) << 8 | temp[4]) >> 2;

View File

@@ -46,9 +46,9 @@ extern "C" {
#define OLED_GRAM_START_FLIP 0 #define OLED_GRAM_START_FLIP 0
#define OLED_GRAM_END_FLIP 0x7F #define OLED_GRAM_END_FLIP 0x7F
#define OLED_VCOM_LAYOUT 0x12 #define OLED_VCOM_LAYOUT 0x12
#define OLED_SEGMENT_MAP_REVERSED #define OLED_SEGMENT_MAP_REVERSED
#define OLED_DIVIDER 0xD3 #define OLED_DIVIDER 0xD3
#else #else
@@ -59,14 +59,14 @@ extern "C" {
#define OLED_GRAM_START_FLIP 0 #define OLED_GRAM_START_FLIP 0
#define OLED_GRAM_END_FLIP 95 #define OLED_GRAM_END_FLIP 95
#define OLED_VCOM_LAYOUT 0x02 #define OLED_VCOM_LAYOUT 0x02
#define OLED_SEGMENT_MAP 0xA0 #define OLED_SEGMENT_MAP 0xA0
#define OLED_DIVIDER 0xD5 #define OLED_DIVIDER 0xD5
#endif /* OLED_128x32 */ #endif /* OLED_128x32 */
#define OLED_ON 0xAF #define OLED_ON 0xAF
#define OLED_OFF 0xAE #define OLED_OFF 0xAE
#define FRAMEBUFFER_START 17 #define FRAMEBUFFER_START 17
@@ -78,7 +78,10 @@ enum class FontStyle {
class OLED { class OLED {
public: public:
enum DisplayState : bool { OFF = false, ON = true }; enum DisplayState : bool {
OFF = false,
ON = true
};
static void initialize(); // Startup the I2C coms (brings screen out of reset etc) static void initialize(); // Startup the I2C coms (brings screen out of reset etc)
static bool isInitDone(); static bool isInitDone();
@@ -117,10 +120,10 @@ public:
static void setInverseDisplay(bool inverted); static void setInverseDisplay(bool inverted);
static int16_t getCursorX() { return cursor_x; } static int16_t getCursorX() { return cursor_x; }
// Draw a string to the current location, with selected font; optionally - with MAX length only // Draw a string to the current location, with selected font; optionally - with MAX length only
static void print(const char *string, FontStyle fontStyle, uint8_t length = 255); static void print(const char *string, FontStyle fontStyle, uint8_t length = 255);
static void printWholeScreen(const char *string); static void printWholeScreen(const char *string);
// Print *F or *C - in font style of Small, Large (by default) or Extra based on input arg // Print *F or *C - in font style of Small, Large (by default) or Extra based on input arg
static void printSymbolDeg(FontStyle fontStyle = FontStyle::LARGE); static void printSymbolDeg(FontStyle fontStyle = FontStyle::LARGE);
// Set the cursor location by pixels // Set the cursor location by pixels
static void setCursor(int16_t x, int16_t y) { static void setCursor(int16_t x, int16_t y) {
cursor_x = x; cursor_x = x;

View File

@@ -6,6 +6,7 @@
*/ */
#include "LIS2DH12_defines.hpp" #include "LIS2DH12_defines.hpp"
#include "accelerometers_common.h"
#include <SC7A20.hpp> #include <SC7A20.hpp>
#include <SC7A20_defines.h> #include <SC7A20_defines.h>
#include <array> #include <array>
@@ -17,20 +18,20 @@ bool SC7A20::isInImitationMode;
*/ */
bool SC7A20::detect() { bool SC7A20::detect() {
if (FRToSI2C::probe(SC7A20_ADDRESS)) { if (ACCEL_I2C_CLASS::probe(SC7A20_ADDRESS)) {
// Read chip id to ensure its not an address collision // Read chip id to ensure its not an address collision
uint8_t id = 0; uint8_t id = 0;
if (FRToSI2C::Mem_Read(SC7A20_ADDRESS, SC7A20_WHO_AMI_I, &id, 1)) { if (ACCEL_I2C_CLASS::Mem_Read(SC7A20_ADDRESS, SC7A20_WHO_AMI_I, &id, 1)) {
if (id == SC7A20_WHO_AM_I_VALUE) { if (id == SC7A20_WHO_AM_I_VALUE) {
isInImitationMode = false; isInImitationMode = false;
return true; return true;
} }
} }
} }
if (FRToSI2C::probe(SC7A20_ADDRESS2)) { if (ACCEL_I2C_CLASS::probe(SC7A20_ADDRESS2)) {
// Read chip id to ensure its not an address collision // Read chip id to ensure its not an address collision
uint8_t id = 0; uint8_t id = 0;
if (FRToSI2C::Mem_Read(SC7A20_ADDRESS2, SC7A20_WHO_AMI_I, &id, 1)) { if (ACCEL_I2C_CLASS::Mem_Read(SC7A20_ADDRESS2, SC7A20_WHO_AMI_I, &id, 1)) {
if (id == SC7A20_WHO_AM_I_VALUE) { if (id == SC7A20_WHO_AM_I_VALUE) {
isInImitationMode = true; isInImitationMode = true;
return true; return true;
@@ -40,7 +41,7 @@ bool SC7A20::detect() {
return false; return false;
} }
static const FRToSI2C::I2C_REG i2c_registers[] = { static const ACCEL_I2C_CLASS::I2C_REG i2c_registers[] = {
// //
// //
{SC7A20_CTRL_REG1, 0b01100111, 0}, // 200Hz, XYZ enabled {SC7A20_CTRL_REG1, 0b01100111, 0}, // 200Hz, XYZ enabled
@@ -59,19 +60,19 @@ static const FRToSI2C::I2C_REG i2c_registers[] = {
// //
}; };
static const FRToSI2C::I2C_REG i2c_registers_alt[] = {{LIS_CTRL_REG1, 0b00110111, 0}, // 200Hz XYZ static const ACCEL_I2C_CLASS::I2C_REG i2c_registers_alt[] = {{LIS_CTRL_REG1, 0b00110111, 0}, // 200Hz XYZ
{LIS_CTRL_REG2, 0b00000000, 0}, // {LIS_CTRL_REG2, 0b00000000, 0}, //
{LIS_CTRL_REG3, 0b01100000, 0}, // Setup interrupt pins {LIS_CTRL_REG3, 0b01100000, 0}, // Setup interrupt pins
{LIS_CTRL_REG4, 0b00001000, 0}, // Block update mode off, HR on {LIS_CTRL_REG4, 0b00001000, 0}, // Block update mode off, HR on
{LIS_CTRL_REG5, 0b00000010, 0}, // {LIS_CTRL_REG5, 0b00000010, 0}, //
{LIS_CTRL_REG6, 0b01100010, 0}, {LIS_CTRL_REG6, 0b01100010, 0},
// Basically setup the unit to run, and enable 4D orientation detection // Basically setup the unit to run, and enable 4D orientation detection
{LIS_INT2_CFG, 0b01111110, 0}, // setup for movement detection {LIS_INT2_CFG, 0b01111110, 0}, // setup for movement detection
{LIS_INT2_THS, 0x28, 0}, // {LIS_INT2_THS, 0x28, 0}, //
{LIS_INT2_DURATION, 64, 0}, // {LIS_INT2_DURATION, 64, 0}, //
{LIS_INT1_CFG, 0b01111110, 0}, // {LIS_INT1_CFG, 0b01111110, 0}, //
{LIS_INT1_THS, 0x28, 0}, // {LIS_INT1_THS, 0x28, 0}, //
{LIS_INT1_DURATION, 64, 0}}; {LIS_INT1_DURATION, 64, 0}};
bool SC7A20::initalize() { bool SC7A20::initalize() {
// Setup acceleration readings // Setup acceleration readings
@@ -83,9 +84,9 @@ bool SC7A20::initalize() {
// Hysteresis is set to ~ 16 counts // Hysteresis is set to ~ 16 counts
// Theta blocking is set to 0b10 // Theta blocking is set to 0b10
if (isInImitationMode) { if (isInImitationMode) {
return FRToSI2C::writeRegistersBulk(SC7A20_ADDRESS2, i2c_registers_alt, sizeof(i2c_registers_alt) / sizeof(i2c_registers_alt[0])); return ACCEL_I2C_CLASS::writeRegistersBulk(SC7A20_ADDRESS2, i2c_registers_alt, sizeof(i2c_registers_alt) / sizeof(i2c_registers_alt[0]));
} else { } else {
return FRToSI2C::writeRegistersBulk(SC7A20_ADDRESS, i2c_registers, sizeof(i2c_registers) / sizeof(i2c_registers[0])); return ACCEL_I2C_CLASS::writeRegistersBulk(SC7A20_ADDRESS, i2c_registers, sizeof(i2c_registers) / sizeof(i2c_registers[0]));
} }
} }
@@ -93,7 +94,7 @@ void SC7A20::getAxisReadings(int16_t &x, int16_t &y, int16_t &z) {
// We can tell the accelerometer to output in LE mode which makes this simple // We can tell the accelerometer to output in LE mode which makes this simple
uint16_t sensorData[3] = {0, 0, 0}; uint16_t sensorData[3] = {0, 0, 0};
if (FRToSI2C::Mem_Read(isInImitationMode ? SC7A20_ADDRESS2 : SC7A20_ADDRESS, isInImitationMode ? SC7A20_OUT_X_L_ALT : SC7A20_OUT_X_L, (uint8_t *)sensorData, 6) == false) { if (ACCEL_I2C_CLASS::Mem_Read(isInImitationMode ? SC7A20_ADDRESS2 : SC7A20_ADDRESS, isInImitationMode ? SC7A20_OUT_X_L_ALT : SC7A20_OUT_X_L, (uint8_t *)sensorData, 6) == false) {
x = y = z = 0; x = y = z = 0;
return; return;
} }

View File

@@ -10,6 +10,7 @@
#include "BSP.h" #include "BSP.h"
#include "I2C_Wrapper.hpp" #include "I2C_Wrapper.hpp"
#include "SC7A20_defines.h" #include "SC7A20_defines.h"
#include "accelerometers_common.h"
class SC7A20 { class SC7A20 {
public: public:
@@ -17,7 +18,7 @@ public:
static bool initalize(); static bool initalize();
// 1 = rh, 2,=lh, 8=flat // 1 = rh, 2,=lh, 8=flat
static Orientation getOrientation() { static Orientation getOrientation() {
uint8_t val = ((FRToSI2C::I2C_RegisterRead(isInImitationMode ? SC7A20_ADDRESS2 : SC7A20_ADDRESS, SC7A20_INT2_SOURCE) >> 2) - 1); uint8_t val = ((ACCEL_I2C_CLASS::I2C_RegisterRead(isInImitationMode ? SC7A20_ADDRESS2 : SC7A20_ADDRESS, SC7A20_INT2_SOURCE) >> 2) - 1);
if (val == 1) { if (val == 1) {
#ifdef SC7_ORI_FLIP #ifdef SC7_ORI_FLIP
return Orientation::ORIENTATION_RIGHT_HAND; return Orientation::ORIENTATION_RIGHT_HAND;

View File

@@ -10,17 +10,17 @@
* This class is licensed as MIT to match this code base * This class is licensed as MIT to match this code base
*/ */
#include "I2C_Wrapper.hpp"
#include "Si7210_defines.h" #include "Si7210_defines.h"
#include "accelerometers_common.h"
#include <Si7210.h> #include <Si7210.h>
bool Si7210::detect() { return FRToSI2C::wakePart(SI7210_ADDRESS); } bool Si7210::detect() { return ACCEL_I2C_CLASS::wakePart(SI7210_ADDRESS); }
bool Si7210::init() { bool Si7210::init() {
// Turn on auto increment and sanity check ID // Turn on auto increment and sanity check ID
// Load OTP cal // Load OTP cal
uint8_t temp; uint8_t temp;
if (FRToSI2C::Mem_Read(SI7210_ADDRESS, SI7210_REG_ID, &temp, 1)) { if (ACCEL_I2C_CLASS::Mem_Read(SI7210_ADDRESS, SI7210_REG_ID, &temp, 1)) {
// We don't really care what model it is etc, just probing to check its probably this iC // We don't really care what model it is etc, just probing to check its probably this iC
if (temp != 0x00 && temp != 0xFF) { if (temp != 0x00 && temp != 0xFF) {
temp = 0x00; temp = 0x00;
@@ -77,10 +77,10 @@ bool Si7210::write_reg(const uint8_t reg, const uint8_t mask, const uint8_t val)
temp &= mask; temp &= mask;
} }
temp |= val; temp |= val;
return FRToSI2C::Mem_Write(SI7210_ADDRESS, reg, &temp, 1); return ACCEL_I2C_CLASS::Mem_Write(SI7210_ADDRESS, reg, &temp, 1);
} }
bool Si7210::read_reg(const uint8_t reg, uint8_t *val) { return FRToSI2C::Mem_Read(SI7210_ADDRESS, reg, val, 1); } bool Si7210::read_reg(const uint8_t reg, uint8_t *val) { return ACCEL_I2C_CLASS::Mem_Read(SI7210_ADDRESS, reg, val, 1); }
bool Si7210::start_periodic_measurement() { bool Si7210::start_periodic_measurement() {
/* Enable periodic wakeup */ /* Enable periodic wakeup */
@@ -95,7 +95,7 @@ bool Si7210::start_periodic_measurement() {
bool Si7210::get_field_strength(int16_t *field) { bool Si7210::get_field_strength(int16_t *field) {
*field = 0; *field = 0;
uint8_t val = 0; uint8_t val = 0;
FRToSI2C::wakePart(SI7210_ADDRESS); ACCEL_I2C_CLASS::wakePart(SI7210_ADDRESS);
if (!write_reg(SI7210_POWER_CTRL, MEAS_MASK | USESTORE_MASK, STOP_MASK)) if (!write_reg(SI7210_POWER_CTRL, MEAS_MASK | USESTORE_MASK, STOP_MASK))
return false; return false;

View File

@@ -8,6 +8,7 @@
#include "TipThermoModel.h" #include "TipThermoModel.h"
#include "BSP.h" #include "BSP.h"
#include "Settings.h" #include "Settings.h"
#include "Types.h"
#include "Utils.h" #include "Utils.h"
#include "configuration.h" #include "configuration.h"
#include "main.hpp" #include "main.hpp"
@@ -54,45 +55,41 @@ uint32_t TipThermoModel::convertTipRawADCTouV(uint16_t rawADC, bool ski
return valueuV; return valueuV;
} }
uint32_t TipThermoModel::convertTipRawADCToDegC(uint16_t rawADC) { return convertuVToDegC(convertTipRawADCTouV(rawADC)); } TemperatureType_t TipThermoModel::convertTipRawADCToDegC(uint16_t rawADC) { return convertuVToDegC(convertTipRawADCTouV(rawADC)); }
uint32_t TipThermoModel::convertTipRawADCToDegF(uint16_t rawADC) { return convertuVToDegF(convertTipRawADCTouV(rawADC)); } TemperatureType_t TipThermoModel::convertTipRawADCToDegF(uint16_t rawADC) { return convertuVToDegF(convertTipRawADCTouV(rawADC)); }
uint32_t TipThermoModel::convertuVToDegF(uint32_t tipuVDelta) { return convertCtoF(convertuVToDegC(tipuVDelta)); } TemperatureType_t TipThermoModel::convertuVToDegF(uint32_t tipuVDelta) { return convertCtoF(convertuVToDegC(tipuVDelta)); }
uint32_t TipThermoModel::convertCtoF(uint32_t degC) { TemperatureType_t TipThermoModel::convertCtoF(TemperatureType_t degC) {
//(Y °C × 9/5) + 32 =Y°F //(Y °C × 9/5) + 32 =Y°F
return (32 + ((degC * 9) / 5)); return (32 + ((degC * 9) / 5));
} }
uint32_t TipThermoModel::convertFtoC(uint32_t degF) { TemperatureType_t TipThermoModel::convertFtoC(TemperatureType_t degF) {
//(Y°F 32) × 5/9 = Y°C //(Y°F 32) × 5/9 = Y°C
if (degF < 32) { if (degF < 32) {
return 0; return 0;
} }
return ((degF - 32) * 5) / 9; return ((degF - 32) * 5) / 9;
} }
uint32_t TipThermoModel::getTipInC(bool sampleNow) { TemperatureType_t TipThermoModel::getTipInC(bool sampleNow) {
int32_t currentTipTempInC = TipThermoModel::convertTipRawADCToDegC(getTipRawTemp(sampleNow)); TemperatureType_t currentTipTempInC = TipThermoModel::convertTipRawADCToDegC(getTipRawTemp(sampleNow));
currentTipTempInC += getHandleTemperature(sampleNow) / 10; // Add handle offset currentTipTempInC += getHandleTemperature(sampleNow) / 10; // Add handle offset
// Power usage indicates that our tip temp is lower than our thermocouple temp.
// I found a number that doesn't unbalance the existing PID, causing overshoot.
// This could be tuned in concert with PID parameters...
if (currentTipTempInC < 0) { if (currentTipTempInC < 0) {
return 0; return 0;
} }
return currentTipTempInC; return currentTipTempInC;
} }
uint32_t TipThermoModel::getTipInF(bool sampleNow) { TemperatureType_t TipThermoModel::getTipInF(bool sampleNow) {
uint32_t currentTipTempInF = getTipInC(sampleNow); TemperatureType_t currentTipTempInF = getTipInC(sampleNow);
currentTipTempInF = convertCtoF(currentTipTempInF); currentTipTempInF = convertCtoF(currentTipTempInF);
return currentTipTempInF; return currentTipTempInF;
} }
uint32_t TipThermoModel::getTipMaxInC() { TemperatureType_t TipThermoModel::getTipMaxInC() {
uint32_t maximumTipTemp = TipThermoModel::convertTipRawADCToDegC(ADC_MAX_READING - 1); TemperatureType_t maximumTipTemp = TipThermoModel::convertTipRawADCToDegC(ADC_MAX_READING - 1);
maximumTipTemp += getHandleTemperature(0) / 10; // Add handle offset maximumTipTemp += getHandleTemperature(0) / 10; // Add handle offset
return maximumTipTemp - 1; return maximumTipTemp - 1;
} }

View File

@@ -8,26 +8,27 @@
#ifndef SRC_TIPTHERMOMODEL_H_ #ifndef SRC_TIPTHERMOMODEL_H_
#define SRC_TIPTHERMOMODEL_H_ #define SRC_TIPTHERMOMODEL_H_
#include "BSP.h" #include "BSP.h"
#include "Types.h"
#include "stdint.h" #include "stdint.h"
class TipThermoModel { class TipThermoModel {
public: public:
// These are the main two functions // These are the main two functions
static uint32_t getTipInC(bool sampleNow = false); static TemperatureType_t getTipInC(bool sampleNow = false);
static uint32_t getTipInF(bool sampleNow = false); static TemperatureType_t getTipInF(bool sampleNow = false);
// Calculates the maximum temperature can can be read by the ADC range // Calculates the maximum temperature can can be read by the ADC range
static uint32_t getTipMaxInC(); static TemperatureType_t getTipMaxInC();
static uint32_t convertTipRawADCToDegC(uint16_t rawADC); static TemperatureType_t convertTipRawADCToDegC(uint16_t rawADC);
static uint32_t convertTipRawADCToDegF(uint16_t rawADC); static TemperatureType_t convertTipRawADCToDegF(uint16_t rawADC);
// Returns the uV of the tip reading before the op-amp compensating for pullups // Returns the uV of the tip reading before the op-amp compensating for pullups
static uint32_t convertTipRawADCTouV(uint16_t rawADC, bool skipCalOffset = false); static uint32_t convertTipRawADCTouV(uint16_t rawADC, bool skipCalOffset = false);
static uint32_t convertCtoF(uint32_t degC); static TemperatureType_t convertCtoF(TemperatureType_t degC);
static uint32_t convertFtoC(uint32_t degF); static TemperatureType_t convertFtoC(TemperatureType_t degF);
private: private:
static uint32_t convertuVToDegC(uint32_t tipuVDelta); static TemperatureType_t convertuVToDegC(uint32_t tipuVDelta);
static uint32_t convertuVToDegF(uint32_t tipuVDelta); static TemperatureType_t convertuVToDegF(uint32_t tipuVDelta);
}; };
#endif /* SRC_TIPTHERMOMODEL_H_ */ #endif /* SRC_TIPTHERMOMODEL_H_ */

View File

@@ -123,7 +123,8 @@ bool parseCapabilitiesArray(const uint8_t numCaps, uint8_t *bestIndex, uint16_t
*bestIndex = 0xFF; // Mark unselected *bestIndex = 0xFF; // Mark unselected
*bestVoltage = 5000; // Default 5V *bestVoltage = 5000; // Default 5V
uint8_t tipResistance = getTipResistanceX10(); // Fudge of 0.5 ohms to round up a little to account for us always having off periods in PWM
uint8_t tipResistance = getTipResistanceX10() + 5;
#ifdef MODEL_HAS_DCDC #ifdef MODEL_HAS_DCDC
// If this device has step down DC/DC inductor to smooth out current spikes // If this device has step down DC/DC inductor to smooth out current spikes
// We can instead ignore resistance and go for max voltage we can accept; and rely on the DC/DC regulation to keep under current limit // We can instead ignore resistance and go for max voltage we can accept; and rely on the DC/DC regulation to keep under current limit

View File

@@ -1,6 +1,6 @@
#ifndef CORE_DRIVERS_ACCELEROMTERS_COMMON_H_ #ifndef CORE_DRIVERS_ACCELEROMTERS_COMMON_H_
#define CORE_DRIVERS_ACCELEROMTERS_COMMON_H_ #define CORE_DRIVERS_ACCELEROMTERS_COMMON_H_
#include "configuration.h"
#if defined(ACCEL_I2CBB2) #if defined(ACCEL_I2CBB2)
#include "I2CBB2.hpp" #include "I2CBB2.hpp"
#define ACCEL_I2C_CLASS I2CBB2 #define ACCEL_I2C_CLASS I2CBB2

10
source/Core/Inc/Types.h Normal file
View File

@@ -0,0 +1,10 @@
#ifndef TYPES_H_
#define TYPES_H_
#include <stddef.h>
// Used for temperature represented in C or x10C.
//
typedef int32_t TemperatureType_t;
#endif

View File

@@ -2,10 +2,11 @@
#define __MAIN_H #define __MAIN_H
#include "OLED.hpp" #include "OLED.hpp"
#include "Setup.h" #include "Setup.h"
#include "Types.h"
#include <stdint.h> #include <stdint.h>
extern volatile uint32_t currentTempTargetDegC; extern volatile TemperatureType_t currentTempTargetDegC;
extern bool settingsWereReset; extern bool settingsWereReset;
extern bool usb_pd_available; extern bool usb_pd_available;
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif

View File

@@ -23,7 +23,6 @@ const uint8_t wattHistoryFilter = 24; //
extern expMovingAverage<uint32_t, wattHistoryFilter> x10WattHistory; extern expMovingAverage<uint32_t, wattHistoryFilter> x10WattHistory;
uint32_t availableW10(uint8_t sample); uint32_t availableW10(uint8_t sample);
int32_t tempToX10Watts(int32_t rawTemp);
void setTipX10Watts(int32_t mw); void setTipX10Watts(int32_t mw);
uint8_t X10WattsToPWM(int32_t milliWatts, uint8_t sample = 0); uint8_t X10WattsToPWM(int32_t milliWatts, uint8_t sample = 0);
#endif /* POWER_HPP_ */ #endif /* POWER_HPP_ */

View File

@@ -60,7 +60,7 @@ extern "C" {
/*#define HAL_ETH_MODULE_ENABLED */ /*#define HAL_ETH_MODULE_ENABLED */
/*#define HAL_FLASH_MODULE_ENABLED */ /*#define HAL_FLASH_MODULE_ENABLED */
#define HAL_GPIO_MODULE_ENABLED #define HAL_GPIO_MODULE_ENABLED
#define HAL_I2C_MODULE_ENABLED /* #define HAL_I2C_MODULE_ENABLED */
/*#define HAL_I2S_MODULE_ENABLED */ /*#define HAL_I2S_MODULE_ENABLED */
/*#define HAL_IRDA_MODULE_ENABLED */ /*#define HAL_IRDA_MODULE_ENABLED */
#define HAL_IWDG_MODULE_ENABLED #define HAL_IWDG_MODULE_ENABLED

View File

@@ -27,14 +27,6 @@ bool shouldBeUsingFastPWMMode(const uint8_t pwmTicks) {
return lastPWMWasFast; return lastPWMWasFast;
} }
int32_t tempToX10Watts(int32_t rawTemp) {
// mass is in x10J/*C, rawC is raw per degree C
// returns x10Watts needed to raise/lower a mass by rawTemp
// degrees in one cycle.
int32_t x10Watts = TIP_THERMAL_MASS * rawTemp;
return x10Watts;
}
void setTipX10Watts(int32_t mw) { void setTipX10Watts(int32_t mw) {
int32_t outputPWMLevel = X10WattsToPWM(mw, 1); int32_t outputPWMLevel = X10WattsToPWM(mw, 1);
const bool shouldUseFastPWM = shouldBeUsingFastPWMMode(outputPWMLevel); const bool shouldUseFastPWM = shouldBeUsingFastPWMMode(outputPWMLevel);

View File

@@ -10,6 +10,7 @@ extern "C" {
#include "Settings.h" #include "Settings.h"
#include "TipThermoModel.h" #include "TipThermoModel.h"
#include "Translation.h" #include "Translation.h"
#include "Types.h"
#include "cmsis_os.h" #include "cmsis_os.h"
#include "configuration.h" #include "configuration.h"
#include "history.hpp" #include "history.hpp"
@@ -25,12 +26,12 @@ extern "C" {
// Exposed modes // Exposed modes
enum OperatingMode { enum OperatingMode {
idle = 0, idle = 0,
soldering = 1, soldering = 1,
boost = 2, boost = 2,
sleeping = 3, sleeping = 3,
settings = 4, settings = 4,
debug = 5 debug = 5
}; };
// Main functions // Main functions
@@ -46,6 +47,6 @@ void drawHomeScreen(bool buttonLockout) __attribute__((noreturn)); // IDLE / Hom
void renderHomeScreenAssets(void); // Called to act as start delay and used to render out flipped images for home screen graphics void renderHomeScreenAssets(void); // Called to act as start delay and used to render out flipped images for home screen graphics
// Common helpers // Common helpers
int8_t getPowerSourceNumber(void); // Returns number ID of power source int8_t getPowerSourceNumber(void); // Returns number ID of power source
uint16_t getTipTemp(void); // Returns temperature of the tip in *C/*F (based on user settings) TemperatureType_t getTipTemp(void); // Returns temperature of the tip in *C/*F (based on user settings)
#endif #endif

View File

@@ -25,7 +25,7 @@ int gui_SolderingSleepingMode(bool stayOff, bool autoStarted) {
} }
// draw the lcd // draw the lcd
uint16_t tipTemp = getTipTemp(); TemperatureType_t tipTemp = getTipTemp();
OLED::clearScreen(); OLED::clearScreen();
OLED::setCursor(0, 0); OLED::setCursor(0, 0);

View File

@@ -4,7 +4,7 @@
void gui_drawTipTemp(bool symbol, const FontStyle font) { void gui_drawTipTemp(bool symbol, const FontStyle font) {
// Draw tip temp handling unit conversion & tolerance near setpoint // Draw tip temp handling unit conversion & tolerance near setpoint
uint16_t Temp = getTipTemp(); TemperatureType_t Temp = getTipTemp();
OLED::printNumber(Temp, 3, font); // Draw the tip temp out OLED::printNumber(Temp, 3, font); // Draw the tip temp out
if (symbol) { if (symbol) {

View File

@@ -4,6 +4,8 @@
#include "SolderingCommon.h" #include "SolderingCommon.h"
#include "OperatingModes.h" #include "OperatingModes.h"
#include "configuration.h"
#include "history.hpp"
extern bool heaterThermalRunaway; extern bool heaterThermalRunaway;
@@ -166,4 +168,14 @@ int8_t getPowerSourceNumber(void) {
} }
// Returns temperature of the tip in *C/*F (based on user settings) // Returns temperature of the tip in *C/*F (based on user settings)
uint16_t getTipTemp(void) { return getSettingValue(SettingsOptions::TemperatureInF) ? TipThermoModel::getTipInF() : TipThermoModel::getTipInC(); } TemperatureType_t getTipTemp(void) {
#ifdef FILTER_DISPLAYED_TIP_TEMP
static history<TemperatureType_t, FILTER_DISPLAYED_TIP_TEMP> Filter_Temp;
TemperatureType_t reading = getSettingValue(SettingsOptions::TemperatureInF) ? TipThermoModel::getTipInF() : TipThermoModel::getTipInC();
Filter_Temp.update(reading);
return Filter_Temp.average();
#else
return getSettingValue(SettingsOptions::TemperatureInF) ? TipThermoModel::getTipInF() : TipThermoModel::getTipInC();
#endif
}

View File

@@ -2,7 +2,7 @@
#include "OperatingModeUtilities.h" #include "OperatingModeUtilities.h"
#include "configuration.h" #include "configuration.h"
#ifdef POW_DC #ifdef POW_DC
extern volatile uint32_t currentTempTargetDegC; extern volatile TemperatureType_t currentTempTargetDegC;
// returns true if undervoltage has occured // returns true if undervoltage has occured
bool checkForUnderVoltage(void) { bool checkForUnderVoltage(void) {
if (!getIsPoweredByDCIN()) { if (!getIsPoweredByDCIN()) {

View File

@@ -10,20 +10,21 @@
#include "Settings.h" #include "Settings.h"
#include "TipThermoModel.h" #include "TipThermoModel.h"
#include "cmsis_os.h" #include "cmsis_os.h"
#include "configuration.h"
#include "history.hpp" #include "history.hpp"
#include "main.hpp" #include "main.hpp"
#include "power.hpp" #include "power.hpp"
#include "task.h" #include "task.h"
static TickType_t powerPulseWaitUnit = 25 * TICKS_100MS; // 2.5 s static TickType_t powerPulseWaitUnit = 25 * TICKS_100MS; // 2.5 s
static TickType_t powerPulseDurationUnit = (5 * TICKS_100MS) / 2; // 250 ms static TickType_t powerPulseDurationUnit = (5 * TICKS_100MS) / 2; // 250 ms
TaskHandle_t pidTaskNotification = NULL; TaskHandle_t pidTaskNotification = NULL;
volatile uint32_t currentTempTargetDegC = 0; // Current temperature target in C volatile TemperatureType_t currentTempTargetDegC = 0; // Current temperature target in C
int32_t powerSupplyWattageLimit = 0; int32_t powerSupplyWattageLimit = 0;
bool heaterThermalRunaway = false; bool heaterThermalRunaway = false;
static int32_t getPIDResultX10Watts(int32_t tError); static int32_t getPIDResultX10Watts(TemperatureType_t set_point, TemperatureType_t current_value);
static void detectThermalRunaway(const int16_t currentTipTempInC, const int tError); static void detectThermalRunaway(const TemperatureType_t currentTipTempInC, const TemperatureType_t tError);
static void setOutputx10WattsViaFilters(int32_t x10Watts); static void setOutputx10WattsViaFilters(int32_t x10Watts);
static int32_t getX10WattageLimits(); static int32_t getX10WattageLimits();
@@ -37,8 +38,8 @@ void startPIDTask(void const *argument __unused) {
currentTempTargetDegC = 0; // Force start with no output (off). If in sleep / soldering this will currentTempTargetDegC = 0; // Force start with no output (off). If in sleep / soldering this will
// be over-ridden rapidly // be over-ridden rapidly
pidTaskNotification = xTaskGetCurrentTaskHandle(); pidTaskNotification = xTaskGetCurrentTaskHandle();
uint32_t PIDTempTarget = 0; TemperatureType_t PIDTempTarget = 0;
// Pre-seed the adc filters // Pre-seed the adc filters
for (int i = 0; i < 32; i++) { for (int i = 0; i < 32; i++) {
ulTaskNotifyTake(pdTRUE, 5); ulTaskNotifyTake(pdTRUE, 5);
@@ -58,22 +59,22 @@ void startPIDTask(void const *argument __unused) {
// This is a call to block this thread until the ADC does its samples // This is a call to block this thread until the ADC does its samples
if (ulTaskNotifyTake(pdTRUE, TICKS_SECOND * 2)) { if (ulTaskNotifyTake(pdTRUE, TICKS_SECOND * 2)) {
// Do the reading here to keep the temp calculations churning along // Do the reading here to keep the temp calculations churning along
uint32_t currentTipTempInC = TipThermoModel::getTipInC(true); TemperatureType_t currentTipTempInC = TipThermoModel::getTipInC(true);
PIDTempTarget = currentTempTargetDegC;
PIDTempTarget = currentTempTargetDegC;
if (PIDTempTarget > 0) { if (PIDTempTarget > 0) {
// Cap the max set point to 450C // Cap the max set point to 450C
if (PIDTempTarget > (450)) { if (PIDTempTarget > 450) {
// Maximum allowed output // Maximum allowed output
PIDTempTarget = (450); PIDTempTarget = 450;
} }
// Safety check that not aiming higher than current tip can measure // Safety check that not aiming higher than current tip can measure
if (PIDTempTarget > TipThermoModel::getTipMaxInC()) { if (PIDTempTarget > TipThermoModel::getTipMaxInC()) {
PIDTempTarget = TipThermoModel::getTipMaxInC(); PIDTempTarget = TipThermoModel::getTipMaxInC();
} }
int32_t tError = PIDTempTarget - currentTipTempInC;
detectThermalRunaway(currentTipTempInC, tError); detectThermalRunaway(currentTipTempInC, PIDTempTarget - currentTipTempInC);
x10WattsOut = getPIDResultX10Watts(tError); x10WattsOut = getPIDResultX10Watts(PIDTempTarget, currentTipTempInC);
} else { } else {
detectThermalRunaway(currentTipTempInC, 0); detectThermalRunaway(currentTipTempInC, 0);
} }
@@ -88,7 +89,54 @@ void startPIDTask(void const *argument __unused) {
} }
} }
template <class T = int32_t> struct Integrator { #ifdef TIP_CONTROL_PID
template <class T, T Kp, T Ki, T Kd, T integral_limit_scale> struct PID {
T previous_error_term;
T integration_running_sum;
T update(const T set_point, const T new_reading, const TickType_t interval_ms, const T max_output) {
const T target_delta = set_point - new_reading;
// Proportional term
const T kp_result = Kp * target_delta;
// Integral term as we use mixed sampling rates, we cant assume a constant sample interval
// Thus we multiply this out by the interval time to ~= dv/dt
// Then the shift by 1000 is ms -> Seconds
integration_running_sum += (target_delta * interval_ms * Ki) / 1000;
// We constrain integration_running_sum to limit windup
// This is not overly required for most use cases but can prevent large overshoot in constrained implementations
if (integration_running_sum > integral_limit_scale * max_output) {
integration_running_sum = integral_limit_scale * max_output;
} else if (integration_running_sum < -integral_limit_scale * max_output) {
integration_running_sum = -integral_limit_scale * max_output;
}
// Calculate the integral term, we use a shift 100 to get precision in integral as we often need small amounts
T ki_result = integration_running_sum / 100;
// Derivative term
T derivative = (target_delta - previous_error_term);
T kd_result = ((Kd * derivative) / (T)(interval_ms));
// Summation of the outputs
T output = kp_result + ki_result + kd_result;
// Restrict to max / 0
if (output > max_output)
output = max_output;
else if (output < 0)
output = 0;
// Save target_delta to previous target_delta
previous_error_term = target_delta;
return output;
}
};
#else
template <class T = TemperatureType_t> struct Integrator {
T sum; T sum;
T update(const T val, const int32_t inertia, const int32_t gain, const int32_t rate, const int32_t limit) { T update(const T val, const int32_t inertia, const int32_t gain, const int32_t rate, const int32_t limit) {
@@ -99,11 +147,12 @@ template <class T = int32_t> struct Integrator {
// Add the new value x integration interval ( 1 / rate) // Add the new value x integration interval ( 1 / rate)
sum += (gain * val) / rate; sum += (gain * val) / rate;
// limit the output // constrain the output between +- our max power output, this limits windup when doing the inital heatup or when solding something large
if (sum > limit) if (sum > limit) {
sum = limit; sum = limit;
else if (sum < -limit) } else if (sum < -limit) {
sum = -limit; sum = -limit;
}
return sum; return sum;
} }
@@ -112,15 +161,23 @@ template <class T = int32_t> struct Integrator {
T get(bool positiveOnly = true) const { return (positiveOnly) ? ((sum > 0) ? sum : 0) : sum; } T get(bool positiveOnly = true) const { return (positiveOnly) ? ((sum > 0) ? sum : 0) : sum; }
}; };
int32_t getPIDResultX10Watts(int32_t setpointDelta) { #endif
static TickType_t lastCall = 0; int32_t getPIDResultX10Watts(TemperatureType_t set_point, TemperatureType_t current_reading) {
static Integrator<int32_t> powerStore = {0}; static TickType_t lastCall = 0;
const TickType_t rate = TICKS_SECOND / (xTaskGetTickCount() - lastCall); #ifdef TIP_CONTROL_PID
lastCall = xTaskGetTickCount(); static PID<TemperatureType_t, TIP_PID_KP, TIP_PID_KI, TIP_PID_KD, 5> pid = {0, 0};
const TickType_t interval = (xTaskGetTickCount() - lastCall);
#else
static Integrator<TemperatureType_t> powerStore = {0};
const TickType_t rate = TICKS_SECOND / (xTaskGetTickCount() - lastCall);
#endif
lastCall = xTaskGetTickCount();
// Sandman note: // Sandman note:
// PID Challenge - we have a small thermal mass that we to want heat up as fast as possible but we don't // PID Challenge - we have a small thermal mass that we to want heat up as fast as possible but we don't
// want to overshot excessively (if at all) the setpoint temperature. In the same time we have 'imprecise' // want to overshot excessively (if at all) the set point temperature. In the same time we have 'imprecise'
// instant temperature measurements. The nature of temperature reading imprecision is not necessarily // instant temperature measurements. The nature of temperature reading imprecision is not necessarily
// related to the sensor (thermocouple) or DAQ system, that otherwise are fairly decent. The real issue is // related to the sensor (thermocouple) or DAQ system, that otherwise are fairly decent. The real issue is
// the thermal inertia. We basically read the temperature in the window between two heating sessions when // the thermal inertia. We basically read the temperature in the window between two heating sessions when
@@ -130,7 +187,7 @@ int32_t getPIDResultX10Watts(int32_t setpointDelta) {
// negative side effects. As a result, we can only rely on the I term but with a twist. Instead of a simple // negative side effects. As a result, we can only rely on the I term but with a twist. Instead of a simple
// integrator we are going to use a self decaying integrator that acts more like a dual I term / P term // integrator we are going to use a self decaying integrator that acts more like a dual I term / P term
// rather than a plain I term. Depending on the circumstances, like when the delta temperature is large, // rather than a plain I term. Depending on the circumstances, like when the delta temperature is large,
// it acts more like a P term whereas on closing to setpoint it acts increasingly closer to a plain I term. // it acts more like a P term whereas on closing to set point it acts increasingly closer to a plain I term.
// So in a sense, we have a bit of both. // So in a sense, we have a bit of both.
// So there we go... // So there we go...
@@ -138,20 +195,22 @@ int32_t getPIDResultX10Watts(int32_t setpointDelta) {
// delta temperature is in °C. The result is the power in X10 W needed to raise (or decrease!) the // delta temperature is in °C. The result is the power in X10 W needed to raise (or decrease!) the
// tip temperature with (Delta Temperature ) °C in 1 second. // tip temperature with (Delta Temperature ) °C in 1 second.
// Note on powerStore. On update, if the value is provided in X10 (W) units then inertia shall be provided // Note on powerStore. On update, if the value is provided in X10 (W) units then inertia shall be provided
// in X10 (J / °C) units as well. Also, powerStore is updated with a gain of 2. Where this comes from: The actual // in X10 (J / °C) units as well.
// power CMOS is controlled by TIM3->CTR1 (that is software modulated - on/off - by TIM2-CTR4 interrupts). However,
// TIM3->CTR1 is configured with a duty cycle of 50% so, in real, we get only 50% of the presumed power output #ifdef TIP_CONTROL_PID
// so we basically double the need (gain = 2) to get what we want. return pid.update(set_point, current_reading, interval, getX10WattageLimits());
return powerStore.update(getTipThermalMass() * setpointDelta, // the required power #else
getTipInertia(), // Inertia, smaller numbers increase dominance of the previous value return powerStore.update(((TemperatureType_t)getTipThermalMass()) * (set_point - current_reading), // the required power
2, // gain getTipInertia(), // Inertia, smaller numbers increase dominance of the previous value
rate, // PID cycle frequency 2, // gain
rate, // PID cycle frequency
getX10WattageLimits()); getX10WattageLimits());
#endif
} }
void detectThermalRunaway(const int16_t currentTipTempInC, const int tError) { void detectThermalRunaway(const TemperatureType_t currentTipTempInC, const TemperatureType_t tError) {
static uint16_t tipTempCRunawayTemp = 0; static TemperatureType_t tipTempCRunawayTemp = 0;
static TickType_t runawaylastChangeTime = 0; static TickType_t runawaylastChangeTime = 0;
// Check for thermal runaway, where it has been x seconds with negligible (y) temp rise // Check for thermal runaway, where it has been x seconds with negligible (y) temp rise
// While trying to actively heat // While trying to actively heat
@@ -160,7 +219,7 @@ void detectThermalRunaway(const int16_t currentTipTempInC, const int tError) {
if ((tError > THERMAL_RUNAWAY_TEMP_C)) { if ((tError > THERMAL_RUNAWAY_TEMP_C)) {
// If we have heated up by more than 20C since last sample point, snapshot time and tip temp // If we have heated up by more than 20C since last sample point, snapshot time and tip temp
int16_t delta = (int16_t)currentTipTempInC - (int16_t)tipTempCRunawayTemp; TemperatureType_t delta = currentTipTempInC - tipTempCRunawayTemp;
if (delta > THERMAL_RUNAWAY_TEMP_C) { if (delta > THERMAL_RUNAWAY_TEMP_C) {
// We have heated up more than the threshold, reset the timer // We have heated up more than the threshold, reset the timer
tipTempCRunawayTemp = currentTipTempInC; tipTempCRunawayTemp = currentTipTempInC;

View File

@@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -e set -e
TRANSLATION_DIR="../Translations" TRANSLATION_DIR="../Translations"
#TRANSLATION_SCRIPT="make_translation.py" #TRANSLATION_SCRIPT="make_translation.py"
@@ -91,14 +91,10 @@ while getopts "h:l:m:" option; do
usage usage
;; ;;
l) l)
set -f IFS=' ' read -r -a largs <<< "${OPTARG}"
IFS=' '
largs=($OPTARG)
;; ;;
m) m)
set -f IFS=' ' read -r -a margs <<< "${OPTARG}"
IFS=' '
margs=($OPTARG)
;; ;;
*) *)
usage usage
@@ -124,7 +120,7 @@ if ((${#largs[@]})); then
done done
echo "" echo ""
fi fi
if [ -z "$BUILD_LANGUAGES" ]; then if [ -z "${BUILD_LANGUAGES[*]}" ]; then
echo " No custom languages selected." echo " No custom languages selected."
echo " Building: [ALL LANGUAGES]" echo " Building: [ALL LANGUAGES]"
BUILD_LANGUAGES+=("${AVAILABLE_LANGUAGES[@]}") BUILD_LANGUAGES+=("${AVAILABLE_LANGUAGES[@]}")
@@ -137,11 +133,11 @@ echo " ${AVAILABLE_MODELS[*]}"
echo -n "Requested models : " echo -n "Requested models : "
if ((${#margs[@]})); then if ((${#margs[@]})); then
for i in "${margs[@]}"; do for i in "${margs[@]}"; do
if [[ "$i" != "Pinecil" ]] && [[ "$i" != "Pinecilv2" ]]; then # Dirty. Need to adapt the Build process to use upper cases only if [[ "$i" != "Pinecil" ]] && [[ "$i" != "Pinecilv2" ]]; then # Dirty. Need to adapt the Build process to use upper cases only
i=$(echo "${i}" | tr '[:lower:]' '[:upper:]') i=$(echo "${i}" | tr '[:lower:]' '[:upper:]')
fi fi
if isInArray "$i" "${AVAILABLE_MODELS[@]}"; then if isInArray "$i" "${AVAILABLE_MODELS[@]}"; then
echo -n "$i " echo -n "$i "
BUILD_MODELS+=("$i") BUILD_MODELS+=("$i")
@@ -152,7 +148,7 @@ if ((${#margs[@]})); then
echo "" echo ""
fi fi
if [ -z "$BUILD_MODELS" ]; then if [ -z "${BUILD_MODELS[*]}" ]; then
echo " No custom models selected." echo " No custom models selected."
echo " Building: [ALL MODELS]" echo " Building: [ALL MODELS]"
BUILD_MODELS+=("${AVAILABLE_MODELS[@]}") BUILD_MODELS+=("${AVAILABLE_MODELS[@]}")

View File

@@ -35,7 +35,10 @@ def load_json(filename: str):
return json.loads(f.read()) return json.loads(f.read())
def read_git_tag(): def read_git_tag():
return f"{subprocess.check_output(['git', 'rev-parse', '--short=7', 'HEAD']).strip().decode('ascii').upper()}" if os.environ.get("GITHUB_CI_PR_SHA", "") != "":
return os.environ["GITHUB_CI_PR_SHA"][:7].upper()
else:
return f"{subprocess.check_output(['git', 'rev-parse', '--short=7', 'HEAD']).strip().decode('ascii').upper()}"
def read_version(): def read_version():
with open(HERE / "version.h") as version_file: with open(HERE / "version.h") as version_file: