forked from stm32-rs/stm32g4xx-hal
-
Notifications
You must be signed in to change notification settings - Fork 0
Lots of changes #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
usbalbin
wants to merge
91
commits into
main
Choose a base branch
from
hrtim2
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Lots of changes #10
Conversation
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
* Use fugit for time related types to make the crate more consistent with stm32g0xx-hal * fmt
* Fix all warnings * Fix all warnings in examples * fmt * More clippy warnings * Fix more warnings
* Fix defmt examples * fmt * Make panic example compile without defmt
* WIP * WIP2 * Add PGA mode to opamp * Add TODO * opamp in pga-mode seems to work * Minor fixes * Clean up example * More clean up of example * Fix example for smaller processors * g471 only has 3 opamps
* Add modified src/dac.rs and src/comparator.rs from g0xx-hal * Both examples/comp.rs and examples/dac.rs seems to be working * Examples fixed, tested and seems to work * Add support for comparator to take signal from dac as input * Added example for using dac as input to comparator * Prevent using dac with incorrect mode as input to comparator * Update comments and fmt * Clean up examples * Comment out unused code * Comment out more unused code * Comment out more unused code - fix * Remove comp impl of devices other than g474 * Adjust to fugit * fmt
* Rcc enable is now handled for the entire HRTIM peripheral by dp.HRTIM_COMMON.hr_control() instead of by every timer * HRTIM calibration is now mandatory, also handled by `dp.HRTIM_COMMON.hr_control()` but also by running on that result `_.wait_for_calibration(). * Add `get_state` for `HrOutput` to check what state an output is in: `Idle`, `Running` or `Fault`
Specifically we cast *const T to *const UnsafeCell<T> then use the [UnsafeCell::raw_get](https://doc.rust-lang.org/stable/std/cell/struct.UnsafeCell.html#method.raw_get) method
- FlashWriter for certain chips requires the PAGE_SIZE_KB to be passed in. Some chips are single bank with 4096kB page size and some chips are dual bank with 2048kB page size. It seems this should be an option easily configured by the user. - Can unlock the Options register (at your own risk) - Changed Flash write to write 2 32-bit words as per the manual. - Can write arbitrary array lengths to flash. If data is < 8 bytes (2 32-bit words), the data is padded with 0xFF. - page_erase was fixed. Writing to the pnb() register was wiping the per() bit. Changed register access from write -> modify - Verify now checks the 2 32-bit words.
- Linter fixes - Added code comment that clarifies the need to write double words - Added an example called flash_with_rtic.rs to show flash memory use case.
- FlashWriter.write used to automatically pad incoming data such that is was divisible by 8, a requirement of the STM32 flash hardware. A colleague suggested this could cause confusion during subsequent writes. FlashWriter.write now forces the user to acknowledge this with the `force_data_padding` flag. If true, the data will be padded automatically to be divisible by 8. If false and the data is not divisible by 8, an error is thrown. - Added new error ArrayMustBeDivisibleBy8 - Modified the flash example based on the above updates
- Added logging and const test address location to flash_with_rtic.rs - Changed type formatting on a buffer array in flash.rs - Removed //TODO and #[allow(dead_code)] from flash register structure Parts.
…b55029f03cedcf54495dd3a9eb83a59634
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.
Lots of changes