876: Add defmt support to embassy-embedded-hal errors r=Dirbaio a=matoushybl
`defmt::unwrap!()` should now work with shared buses. I tested it only with I2C as I don't have SPI in the target project.
Co-authored-by: Matous Hybl <hyblmatous@gmail.com>
856: embassy-stm32/pwm: Generalize channel selection r=Dirbaio a=bgamari
550da471be previously refactored the STM32
PWM logic in such a way to preclude use of non-contiguous channels (e.g.
channel 2 but not channel 1). Refactor it yet again to yet again allow
this sort of usage.
Co-authored-by: Ben Gamari <ben@smart-cactus.org>
Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net>
550da471be previously refactored the STM32
PWM logic in such a way to preclude use of non-contiguous channels (e.g.
channel 2 but not channel 1). Refactor it yet again to yet again allow
this sort of usage.
842: WIP: Make unborrow safe to use r=Dirbaio a=GrantM11235
The basic idea is that `Unborrow::unborrow` is now safe to call and returns an `Unborrowed<'a, T>` which impls `Deref` and `DerefMut`
```rust
/// This is essentially a `&mut T`, but it is the size of `T` not the size
/// of a pointer. This is useful if T is a zero sized type.
pub struct Unborrowed<'a, T> {
inner: T,
_lifetime: PhantomData<&'a mut T>,
}
```
## Todo
- [x] Update other crates
- [x] embassy-cortex-m
- [x] embassy-hal-common
- [x] embassy-lora
- [x] embassy-nrf
- [x] embassy-rp
- [x] embassy-stm32
- [x] Remove usage of the unsafe `into_inner` method if possible
- [x] Review and amend docs for `Unborrow` and `Unborrowed`
Co-authored-by: Grant Miller <GrantM11235@gmail.com>
Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net>
871: nrf/saadc: add type-erased AnyInput. r=Dirbaio a=Dirbaio
872: nrf/usb: prevent user code from constructing a PowerUsb directly. r=Dirbaio a=Dirbaio
PowerUsb must be constructed through `new()` so that it sets up the IRQ.
It must have at least one private field, otherwise user code can construct
it directly with `PowerUsb{}`.
Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net>
874: Add inline attribute to embassy-rp async functions r=Dirbaio a=danbev
This commit adds the inline attribute to the recently added async gpio
functions. This is to enable cross-crate inlining and to be consistent
with the other functions implemented for Input and Flex.
Co-authored-by: Daniel Bevenius <daniel.bevenius@gmail.com>
This commit adds the inline attribute to the recently added async gpio
functions. This is to enable cross-crate inlining and to be consistent
with the other functions implemented for Input and Flex.
PowerUsb must be constructed through `new()` so that it sets up the IRQ.
It must have at least one private field, otherwise user code can construct
it directly with `PowerUsb{}`.
868: Rename XXBusDevice to XXDevice. r=Dirbaio a=Dirbaio
I think the current naming is a bit odd, the EH traits are organized as "Bus" vs "Device", and XxxBusDevice is a Device (not a Bus, not both)
`@kalkyl`
Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net>
853: Add embedded_hal_async support for embassy-rp r=Dirbaio a=danbev
This commit adds support for embedded-hal-async to the Embassy
Raspberry PI crate.
Co-authored-by: Daniel Bevenius <daniel.bevenius@gmail.com>
866: F4 flash fixes r=Dirbaio a=chemicstry
This discontinuous flash sector layout is too cursed and I left some mistakes in last PR. Erasing last sector did not work and it wasn't possible to erase between memory banks for 1MB dual-bank devices. So I changed the erase function to iterate over memory addresses (which is continuous) instead of sector numbers.
It should also be possible to implement erase across memory banks for H7, but it requires special handling for write too. I don't have an H7 to test now so left it as is.
I wasn't sure how to add tests to `embassy-stm32` and it seems that there are none, except for `subghz`, but no test runner? Anyway, I tested the `get_sector` on playground: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=13b59339fe6c70a3249e6183e81f869e
Also fixed erase alignment requirements on `Flash::blocking_erase()`, as it previously only checked alignment on size, but not on offsets.
P.S. the diff is a bit messed up, I recommend looking at files directly
Co-authored-by: chemicstry <chemicstry@gmail.com>