Skip to content

Conversation

@usbalbin
Copy link
Owner

@usbalbin usbalbin commented Nov 7, 2023

Lots of changes

usbalbin and others added 30 commits June 7, 2023 13:41
* 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
* Add g491 and 4a1 to ci, check examples, check with different feature sets

* Add todo

* Remove unused feature embedded-can-03

* Remove feature unstable-defmt from ci

* Add clippy to ci

* Fix warning

* g91 and 4a1 support does not seem quite ready yet
* 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`
usbalbin and others added 30 commits November 8, 2023 18:20
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants