-
Notifications
You must be signed in to change notification settings - Fork 5
Updating spi,serial modules to use embedded-hal 1.0 #4
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
Conversation
Added dma. Removed critical sections from gpio pins as this is really os dependent. Commented out modules: adc, i2c, pwm, timers, watchdog as they aren't yet converted. modules gpio, serial, spi are converted to embedded hal 1.0
Added embedded-hal 1.0, embedded-hal-nb 1.0, embedded-io 0.6 Renamed embedded-hal 0.2.7 to embedded-hal-02 Added 'with-dma' feature to ease code use with dma module adc module now uses embedded-hal-02 only delay module uses embedded-hal-02 only Added peripheral mapping to dma module Fixed bug with clearing DMA flags for a channel Changed types of DMA channels to use channel numbers from 1-3 instead of the array offsets 0-2, eases downstream code use Converted gpio mod to use embedded-hal 1 and 0.2 both Added EXTI interrupt code to gpio mod. Added port identifier to Pin structs for use in EXTI setup i2c module uses embedded-hal-02 only Adjusted prelude mod to remove embedded-hal traits pwm mod uses embedded-hal-02 only Added enable mod to rcc mod. Added traits BusClock, BusTimerClock, Enable, Reset to rcc mod enable module also seals all peripherals serial mod uses embedded-hal 1 and 0.2 both, and can use DMA spi mod uses embedded-hal 1 and 0.2 both, and can use DMA spi now has slave functions, but not tested timers mod uses embedded-hal 0.2 only watchdog mod uses embedded-hal 0.2 only
adc mod uses enable and reset added hal_02 module to gpio i2c mod implements Instance trait, uses enable, reset, busclock pwm mod uses enable and reset, bustimerclock added hal_02 module to spi timers mod implements Instance trait, uses enable, reset bustimerclock All examples updated to compile with no warnings
Fixed docs in mod serial and mod spi
Fixed typo in adc_values example Added listen/unlisten to dma Transfers so interrupts can be used Removed unused parameter in gpio! macro
Filled out CHANGELOG.md Altered examples to use changed gpio module Added module rtc and 2 examples Added 'disable_dbg' method to Rcc
Deleted timers and delay modules, functionality in new modules time module converted to use fugit All code converted to use fugit rates instead of old time module functions
Great, these changes will make this crate even better.
Yes, it would be better to mention it in the readme. In addition, since I no longer use this series of chips, it is difficult to have time to maintain and test these code, and I would like to add you to the collaborators. In my opinion, your coding and maintenance skills are better than mine, and you can maintain them better. I can put these two repositories into a new organization, do you have any ideas? |
Creating an organization would work. I have time to do the maintenance work for now at least. I don't agree that my coding and maintenance skills are better, I just merged the stm32f1xx-hal with what you had done. The 2 chip families are very similar, clearly Puya used stm32 as a guide. Rust is not an easy language for a person with a lot of experience in the 'old' way, Ha Ha. Even in computer science there is progress over time. |
Fixed typos in Changelog Updated edition to 2021 Fixed authors in Cargo.toml
Fixed chip feature in tools/capture* scripts Fixed tools/check.py Updated README.md Deleted build.rs as it doesn't work with current features Fixed github actions that didn't work
Set SYST clock source to sysclk for configure function Fixed Clocks.sysclk initialization Adjusted all examples to remove if let, and loop construct, the compiler was optimizing out a lot of the example functionality due to that code construction
The visible changes to existing code would be removing the atomic context from gpio pin type creation, as this is dependent on what operating system you are using, plus using that idiom would require using it in a lot of other calls as well, not just gpio. Also how serial and spi hal structs are created. The embedded-hal traits were removed from prelude.rs, as it depends on what one you want to use.
I intend to work on the timers also, as there is a lot of stuff missing.
The authors in Cargo.toml don't have anything to do with this repo, correct? They are there because you started out from an existing repository? I think that mentioning that this repo is based on their work, and referencing that in the README would be better. I based a lot of my changes on the stm32f1xx-hal github repo, as I had used that one previously and it worked ok. I didn't mention that anywhere in my changes, even though it should be mentioned as it is based on that work.