embassy-stm32: Simplify time

- Remove unused `MilliSeconds`, `MicroSeconds`, and `NanoSeconds` types
- Remove `Bps`, `KiloHertz`, and `MegaHertz` types that were only used
for converting to `Hertz`
- Replace all instances of `impl Into<Hertz>` with `Hertz`
- Add `hz`, `khz`, and `mhz` methods to `Hertz`, as well as
free function shortcuts
- Remove `U32Ext` extension trait
This commit is contained in:
Grant Miller
2022-07-10 17:36:10 -05:00
parent 9753f76794
commit 5ecbe5c918
34 changed files with 211 additions and 321 deletions

View File

@ -11,7 +11,7 @@ use embassy_lora::LoraTimer;
use embassy_stm32::exti::ExtiInput;
use embassy_stm32::gpio::{Input, Level, Output, Pull, Speed};
use embassy_stm32::rng::Rng;
use embassy_stm32::time::U32Ext;
use embassy_stm32::time::khz;
use embassy_stm32::{spi, Peripherals};
use lorawan::default_crypto::DefaultFactory as Crypto;
use lorawan_device::async_device::{region, Device, JoinMode};
@ -34,7 +34,7 @@ async fn main(_spawner: embassy::executor::Spawner, p: Peripherals) {
p.PA6,
p.DMA1_CH3,
p.DMA1_CH2,
200_000.hz(),
khz(200),
spi::Config::default(),
);