595: stm32f3: fix nonexistent cfg tests r=Dirbaio a=unrelentingtech
The rcc code was taken from stm32-rs which uses 'x' features, but embassy uses features with full chip names.
Add these 'x' wildcards as cfgs and use them in rcc. They will be useful for USB #580 too.
---
I don't have any F3 boards, so this is not tested. But the original cfg clearly doesn't look right…
Co-authored-by: Greg V <greg@unrelenting.technology>
The rcc code was taken from stm32-rs which uses 'x' features, but
embassy uses features with full chip names.
Add these 'x' wildcards as cfgs and use them in rcc.
They will be useful for USB too.
This approach owns the sequence buffers which, while introducing an extra move, it eliminates the need to guard the lifetime of the sequence buffer. Given ownership, the buffer will be retained until the PWM sequence task is stopped.
Demonstrates how to set the colour of a WS2812B to blue using PWM, and the use of multiple sequences along with their own config. This required an API change.
592: Initial work on unstable-trait feature for stm32 r=lulf a=lulf
Implements async traits for exti for now.
Co-authored-by: Ulf Lilleengen <lulf@redhat.com>
589: stm32/i2c: allow empty writes r=Dirbaio a=darkwater
The Senseair Sunrise CO2 sensor expects a wake-up packet in the form of (START, address, STOP), which looks like a `write(addr, &[])`, but this assertion prevents sending that.
I'm not sure why the assertion is there. Sending empty packets works fine in my limited testing, at least.
Co-authored-by: Sam Lakerveld <dark@dark.red>
590: Stop PWM before assigning the new sequence r=huntc a=huntc
I had introduced a small bug in my last PR where I assigned the sequence before stopping the PWM. I now stop the PWM before doing that now.
Also, corrected a math comment.
Co-authored-by: huntc <huntchr@gmail.com>
I had introduced a small bug in my last PR where I assigned the sequence before stopping the PWM. I now stop the PWM before doing that now.
Also, corrected a math comment.
585: Permit many sequences to be passed r=huntc a=huntc
Sequences are now passed in via the start method to avoid having to stop the PWM and restart it. Sequences continue to be constrained with the same lifetime of the Pwm struct itself. The pwm_sequence example has been extended to illustrate multiple sequences being passed around.
Co-authored-by: huntc <huntchr@gmail.com>
586: stm32: add `time-driver-any` cargo feature that automatically picks one. r=Dirbaio a=Dirbaio
Most of the time you don't care which one gets used, so this is easier! :)
It also helps for building docs for all chips, it reduces the feature changes needed.
Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net>
Sequences are now passed in via the start method to avoid having to stop the PWM and restart it. Sequences continue to be constrained with the same lifetime of the Pwm object itself. The pwm_sequence example has been extended to illustrate multiple sequences being passed around.
581: stm32: expose all functionality as inherent methods. r=Dirbaio a=Dirbaio
This is the previous step to implementing both the embedded-hal 0.2 and embedded-hal 1.0 + embedded-hal-async traits.
The equivalent in nrf was done in #552
- Removes need for `unwrap` in gpio.
- Removes need for `use embedded_hal::whatever` in all cases.
Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net>
582: Make advanced timer trait not require general purpose timer trait as … r=Dirbaio a=matoushybl
…the timers are too different.
When developing pwm driver, I originally used T: GeneralPurpose16bitTimer as it could support both GP timers and advanced timer, but advanced timer requires further modifications in registers accessible only in it (BDTR - bit AOE).
This PR makes advanced timers depend on Basic16bitTimer instead, which should hopefully improve type safety and allow for better timer drivers that can distinguish between advanced timers and general purpose ones.
Co-authored-by: Matous Hybl <hyblmatous@gmail.com>
574: Add the possibility to reconfigure Spi mode and bit order configurati… r=matoushybl a=matoushybl
…on on the fly.
I have not tested these changes. I am also not sure if the peripheral should be disabled when changing these settings. What do you think `@Dirbaio` ?
Co-authored-by: Matous Hybl <hyblmatous@gmail.com>