fix(examples): align OTG usage with datasheet; update API; fix stm32g4 build - #1
Merged
Merged
Conversation
Update bits [7:6] for VBUSREF_[IE]_SET2 and preserve [5:0].
Add FeedbackMode enum and set_feedback_mode()/get_feedback_mode() to control FB_SEL independently.
Program RATIO.VBUS_RATIO in configure_device and update ADC config; add VbusRatio type.
Use driver-configured VBUS_RATIO and adc_config.vbus_ratio. Do not write RATIO in setter; only program reference.
Use cached adc_config.vbus_ratio; align with set_vbus_internal_voltage API simplification.
Voltage reads now rely on cached ADC ratio config for both VBUS and VBAT.
VINREG is charge-path only; honor project policy to not touch VINREG for discharging/OTG.
Remove VINREG config from OTG paths (ignored in discharging mode). Use set_vbus_internal_voltage() for OTG output voltage. Add notes to avoid confusion between OTG and charging. docs(otg): clarify output voltage and current limits in example README. docs(lib): update OTG example in src/lib.rs. build(stm32g4): add missing vbus_ratio to fix E0063 on thumbv7em-none-eabihf. Verification: built lib and examples for thumbv6m and thumbv7em targets.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Build & Verify
Changes