diff options
| author | Dario Nieuwenhuis <[email protected]> | 2025-10-06 22:56:31 +0200 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2025-10-06 23:19:53 +0200 |
| commit | 8730a013c395cf0bf4c2fa8eeb7f138288103039 (patch) | |
| tree | 39eca5fbc4570bd0129c9a291f134de5dab98820 | |
| parent | abc8e450f936567ad42cb34b5d2a7941b206aa5d (diff) | |
Rustfmt for edition 2024.
509 files changed, 943 insertions, 967 deletions
diff --git a/cyw43-pio/src/lib.rs b/cyw43-pio/src/lib.rs index b0be19358..41ac6816d 100644 --- a/cyw43-pio/src/lib.rs +++ b/cyw43-pio/src/lib.rs | |||
| @@ -6,13 +6,13 @@ | |||
| 6 | use core::slice; | 6 | use core::slice; |
| 7 | 7 | ||
| 8 | use cyw43::SpiBusCyw43; | 8 | use cyw43::SpiBusCyw43; |
| 9 | use embassy_rp::Peri; | ||
| 9 | use embassy_rp::dma::Channel; | 10 | use embassy_rp::dma::Channel; |
| 10 | use embassy_rp::gpio::{Drive, Level, Output, Pull, SlewRate}; | 11 | use embassy_rp::gpio::{Drive, Level, Output, Pull, SlewRate}; |
| 11 | use embassy_rp::pio::program::pio_asm; | 12 | use embassy_rp::pio::program::pio_asm; |
| 12 | use embassy_rp::pio::{Common, Config, Direction, Instance, Irq, PioPin, ShiftDirection, StateMachine}; | 13 | use embassy_rp::pio::{Common, Config, Direction, Instance, Irq, PioPin, ShiftDirection, StateMachine}; |
| 13 | use embassy_rp::Peri; | ||
| 14 | use fixed::types::extra::U8; | ||
| 15 | use fixed::FixedU32; | 14 | use fixed::FixedU32; |
| 15 | use fixed::types::extra::U8; | ||
| 16 | 16 | ||
| 17 | /// SPI comms driven by PIO. | 17 | /// SPI comms driven by PIO. |
| 18 | pub struct PioSpi<'d, PIO: Instance, const SM: usize, DMA: Channel> { | 18 | pub struct PioSpi<'d, PIO: Instance, const SM: usize, DMA: Channel> { |
diff --git a/cyw43/src/bluetooth.rs b/cyw43/src/bluetooth.rs index d176c4b09..332b7048d 100644 --- a/cyw43/src/bluetooth.rs +++ b/cyw43/src/bluetooth.rs | |||
| @@ -15,7 +15,7 @@ use crate::bus::Bus; | |||
| 15 | pub use crate::bus::SpiBusCyw43; | 15 | pub use crate::bus::SpiBusCyw43; |
| 16 | use crate::consts::*; | 16 | use crate::consts::*; |
| 17 | use crate::util::round_up; | 17 | use crate::util::round_up; |
| 18 | use crate::{util, CHIP}; | 18 | use crate::{CHIP, util}; |
| 19 | 19 | ||
| 20 | pub(crate) struct BtState { | 20 | pub(crate) struct BtState { |
| 21 | rx: [BtPacketBuf; 4], | 21 | rx: [BtPacketBuf; 4], |
diff --git a/cyw43/src/bus.rs b/cyw43/src/bus.rs index 8a53484d5..aa2b66a40 100644 --- a/cyw43/src/bus.rs +++ b/cyw43/src/bus.rs | |||
| @@ -340,11 +340,7 @@ where | |||
| 340 | self.status = self.spi.cmd_read(cmd, &mut buf[..len]).await; | 340 | self.status = self.spi.cmd_read(cmd, &mut buf[..len]).await; |
| 341 | 341 | ||
| 342 | // if we read from the backplane, the result is in the second word, after the response delay | 342 | // if we read from the backplane, the result is in the second word, after the response delay |
| 343 | if func == FUNC_BACKPLANE { | 343 | if func == FUNC_BACKPLANE { buf[1] } else { buf[0] } |
| 344 | buf[1] | ||
| 345 | } else { | ||
| 346 | buf[0] | ||
| 347 | } | ||
| 348 | } | 344 | } |
| 349 | 345 | ||
| 350 | async fn writen(&mut self, func: u32, addr: u32, val: u32, len: u32) { | 346 | async fn writen(&mut self, func: u32, addr: u32, val: u32, len: u32) { |
diff --git a/cyw43/src/control.rs b/cyw43/src/control.rs index fd0d4d532..49e3faee4 100644 --- a/cyw43/src/control.rs +++ b/cyw43/src/control.rs | |||
| @@ -10,7 +10,7 @@ use crate::events::{Event, EventSubscriber, Events}; | |||
| 10 | use crate::fmt::Bytes; | 10 | use crate::fmt::Bytes; |
| 11 | use crate::ioctl::{IoctlState, IoctlType}; | 11 | use crate::ioctl::{IoctlState, IoctlType}; |
| 12 | use crate::structs::*; | 12 | use crate::structs::*; |
| 13 | use crate::{countries, events, PowerManagementMode}; | 13 | use crate::{PowerManagementMode, countries, events}; |
| 14 | 14 | ||
| 15 | /// Control errors. | 15 | /// Control errors. |
| 16 | #[derive(Debug)] | 16 | #[derive(Debug)] |
diff --git a/cyw43/src/ioctl.rs b/cyw43/src/ioctl.rs index 35135e296..deccc945d 100644 --- a/cyw43/src/ioctl.rs +++ b/cyw43/src/ioctl.rs | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | use core::cell::{Cell, RefCell}; | 1 | use core::cell::{Cell, RefCell}; |
| 2 | use core::future::{poll_fn, Future}; | 2 | use core::future::{Future, poll_fn}; |
| 3 | use core::task::{Poll, Waker}; | 3 | use core::task::{Poll, Waker}; |
| 4 | 4 | ||
| 5 | use embassy_sync::waitqueue::WakerRegistration; | 5 | use embassy_sync::waitqueue::WakerRegistration; |
diff --git a/cyw43/src/runner.rs b/cyw43/src/runner.rs index 77910b281..7c38be24a 100644 --- a/cyw43/src/runner.rs +++ b/cyw43/src/runner.rs | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | use embassy_futures::select::{select4, Either4}; | 1 | use embassy_futures::select::{Either4, select4}; |
| 2 | use embassy_net_driver_channel as ch; | 2 | use embassy_net_driver_channel as ch; |
| 3 | use embassy_time::{block_for, Duration, Timer}; | 3 | use embassy_time::{Duration, Timer, block_for}; |
| 4 | use embedded_hal_1::digital::OutputPin; | 4 | use embedded_hal_1::digital::OutputPin; |
| 5 | 5 | ||
| 6 | use crate::bus::Bus; | 6 | use crate::bus::Bus; |
| @@ -12,7 +12,7 @@ use crate::ioctl::{IoctlState, IoctlType, PendingIoctl}; | |||
| 12 | use crate::nvram::NVRAM; | 12 | use crate::nvram::NVRAM; |
| 13 | use crate::structs::*; | 13 | use crate::structs::*; |
| 14 | use crate::util::slice8_mut; | 14 | use crate::util::slice8_mut; |
| 15 | use crate::{events, Core, CHIP, MTU}; | 15 | use crate::{CHIP, Core, MTU, events}; |
| 16 | 16 | ||
| 17 | #[cfg(feature = "firmware-logs")] | 17 | #[cfg(feature = "firmware-logs")] |
| 18 | struct LogState { | 18 | struct LogState { |
diff --git a/embassy-boot-nrf/src/lib.rs b/embassy-boot-nrf/src/lib.rs index 3b3434e2c..b4c3c1151 100644 --- a/embassy-boot-nrf/src/lib.rs +++ b/embassy-boot-nrf/src/lib.rs | |||
| @@ -9,7 +9,7 @@ pub use embassy_boot::{ | |||
| 9 | FirmwareUpdater, FirmwareUpdaterConfig, | 9 | FirmwareUpdater, FirmwareUpdaterConfig, |
| 10 | }; | 10 | }; |
| 11 | use embassy_nrf::nvmc::PAGE_SIZE; | 11 | use embassy_nrf::nvmc::PAGE_SIZE; |
| 12 | use embassy_nrf::{wdt, Peri}; | 12 | use embassy_nrf::{Peri, wdt}; |
| 13 | use embedded_storage::nor_flash::{ErrorType, NorFlash, ReadNorFlash}; | 13 | use embedded_storage::nor_flash::{ErrorType, NorFlash, ReadNorFlash}; |
| 14 | 14 | ||
| 15 | /// A bootloader for nRF devices. | 15 | /// A bootloader for nRF devices. |
diff --git a/embassy-boot-rp/src/lib.rs b/embassy-boot-rp/src/lib.rs index dd049851a..d090aee49 100644 --- a/embassy-boot-rp/src/lib.rs +++ b/embassy-boot-rp/src/lib.rs | |||
| @@ -8,10 +8,10 @@ pub use embassy_boot::{ | |||
| 8 | AlignedBuffer, BlockingFirmwareState, BlockingFirmwareUpdater, BootError, BootLoaderConfig, FirmwareState, | 8 | AlignedBuffer, BlockingFirmwareState, BlockingFirmwareUpdater, BootError, BootLoaderConfig, FirmwareState, |
| 9 | FirmwareUpdater, FirmwareUpdaterConfig, State, | 9 | FirmwareUpdater, FirmwareUpdaterConfig, State, |
| 10 | }; | 10 | }; |
| 11 | use embassy_rp::flash::{Blocking, Flash, ERASE_SIZE}; | 11 | use embassy_rp::Peri; |
| 12 | use embassy_rp::flash::{Blocking, ERASE_SIZE, Flash}; | ||
| 12 | use embassy_rp::peripherals::{FLASH, WATCHDOG}; | 13 | use embassy_rp::peripherals::{FLASH, WATCHDOG}; |
| 13 | use embassy_rp::watchdog::Watchdog; | 14 | use embassy_rp::watchdog::Watchdog; |
| 14 | use embassy_rp::Peri; | ||
| 15 | use embassy_time::Duration; | 15 | use embassy_time::Duration; |
| 16 | use embedded_storage::nor_flash::{ErrorType, NorFlash, ReadNorFlash}; | 16 | use embedded_storage::nor_flash::{ErrorType, NorFlash, ReadNorFlash}; |
| 17 | 17 | ||
diff --git a/embassy-boot/src/boot_loader.rs b/embassy-boot/src/boot_loader.rs index 8d97882ea..c38940d6e 100644 --- a/embassy-boot/src/boot_loader.rs +++ b/embassy-boot/src/boot_loader.rs | |||
| @@ -1,11 +1,11 @@ | |||
| 1 | use core::cell::RefCell; | 1 | use core::cell::RefCell; |
| 2 | 2 | ||
| 3 | use embassy_embedded_hal::flash::partition::BlockingPartition; | 3 | use embassy_embedded_hal::flash::partition::BlockingPartition; |
| 4 | use embassy_sync::blocking_mutex::raw::NoopRawMutex; | ||
| 5 | use embassy_sync::blocking_mutex::Mutex; | 4 | use embassy_sync::blocking_mutex::Mutex; |
| 5 | use embassy_sync::blocking_mutex::raw::NoopRawMutex; | ||
| 6 | use embedded_storage::nor_flash::{NorFlash, NorFlashError, NorFlashErrorKind}; | 6 | use embedded_storage::nor_flash::{NorFlash, NorFlashError, NorFlashErrorKind}; |
| 7 | 7 | ||
| 8 | use crate::{State, DFU_DETACH_MAGIC, REVERT_MAGIC, STATE_ERASE_VALUE, SWAP_MAGIC}; | 8 | use crate::{DFU_DETACH_MAGIC, REVERT_MAGIC, STATE_ERASE_VALUE, SWAP_MAGIC, State}; |
| 9 | 9 | ||
| 10 | /// Errors returned by bootloader | 10 | /// Errors returned by bootloader |
| 11 | #[derive(PartialEq, Eq, Debug)] | 11 | #[derive(PartialEq, Eq, Debug)] |
diff --git a/embassy-boot/src/firmware_updater/asynch.rs b/embassy-boot/src/firmware_updater/asynch.rs index fd02fa526..26d4d39bd 100644 --- a/embassy-boot/src/firmware_updater/asynch.rs +++ b/embassy-boot/src/firmware_updater/asynch.rs | |||
| @@ -6,7 +6,7 @@ use embassy_sync::blocking_mutex::raw::NoopRawMutex; | |||
| 6 | use embedded_storage_async::nor_flash::NorFlash; | 6 | use embedded_storage_async::nor_flash::NorFlash; |
| 7 | 7 | ||
| 8 | use super::FirmwareUpdaterConfig; | 8 | use super::FirmwareUpdaterConfig; |
| 9 | use crate::{FirmwareUpdaterError, State, BOOT_MAGIC, DFU_DETACH_MAGIC, STATE_ERASE_VALUE, SWAP_MAGIC}; | 9 | use crate::{BOOT_MAGIC, DFU_DETACH_MAGIC, FirmwareUpdaterError, STATE_ERASE_VALUE, SWAP_MAGIC, State}; |
| 10 | 10 | ||
| 11 | /// FirmwareUpdater is an application API for interacting with the BootLoader without the ability to | 11 | /// FirmwareUpdater is an application API for interacting with the BootLoader without the ability to |
| 12 | /// 'mess up' the internal bootloader state | 12 | /// 'mess up' the internal bootloader state |
diff --git a/embassy-boot/src/firmware_updater/blocking.rs b/embassy-boot/src/firmware_updater/blocking.rs index 44550e795..5554025fc 100644 --- a/embassy-boot/src/firmware_updater/blocking.rs +++ b/embassy-boot/src/firmware_updater/blocking.rs | |||
| @@ -6,7 +6,7 @@ use embassy_sync::blocking_mutex::raw::NoopRawMutex; | |||
| 6 | use embedded_storage::nor_flash::NorFlash; | 6 | use embedded_storage::nor_flash::NorFlash; |
| 7 | 7 | ||
| 8 | use super::FirmwareUpdaterConfig; | 8 | use super::FirmwareUpdaterConfig; |
| 9 | use crate::{FirmwareUpdaterError, State, BOOT_MAGIC, DFU_DETACH_MAGIC, STATE_ERASE_VALUE, SWAP_MAGIC}; | 9 | use crate::{BOOT_MAGIC, DFU_DETACH_MAGIC, FirmwareUpdaterError, STATE_ERASE_VALUE, SWAP_MAGIC, State}; |
| 10 | 10 | ||
| 11 | /// Blocking FirmwareUpdater is an application API for interacting with the BootLoader without the ability to | 11 | /// Blocking FirmwareUpdater is an application API for interacting with the BootLoader without the ability to |
| 12 | /// 'mess up' the internal bootloader state | 12 | /// 'mess up' the internal bootloader state |
| @@ -399,8 +399,8 @@ mod tests { | |||
| 399 | use core::cell::RefCell; | 399 | use core::cell::RefCell; |
| 400 | 400 | ||
| 401 | use embassy_embedded_hal::flash::partition::BlockingPartition; | 401 | use embassy_embedded_hal::flash::partition::BlockingPartition; |
| 402 | use embassy_sync::blocking_mutex::raw::NoopRawMutex; | ||
| 403 | use embassy_sync::blocking_mutex::Mutex; | 402 | use embassy_sync::blocking_mutex::Mutex; |
| 403 | use embassy_sync::blocking_mutex::raw::NoopRawMutex; | ||
| 404 | use sha1::{Digest, Sha1}; | 404 | use sha1::{Digest, Sha1}; |
| 405 | 405 | ||
| 406 | use super::*; | 406 | use super::*; |
diff --git a/embassy-boot/src/lib.rs b/embassy-boot/src/lib.rs index 4d7ebfc4f..7dc811f66 100644 --- a/embassy-boot/src/lib.rs +++ b/embassy-boot/src/lib.rs | |||
| @@ -342,11 +342,13 @@ mod tests { | |||
| 342 | &mut aligned, | 342 | &mut aligned, |
| 343 | ); | 343 | ); |
| 344 | 344 | ||
| 345 | assert!(block_on(updater.verify_and_mark_updated( | 345 | assert!( |
| 346 | &public_key.to_bytes(), | 346 | block_on(updater.verify_and_mark_updated( |
| 347 | &signature.to_bytes(), | 347 | &public_key.to_bytes(), |
| 348 | firmware_len as u32, | 348 | &signature.to_bytes(), |
| 349 | )) | 349 | firmware_len as u32, |
| 350 | .is_ok()); | 350 | )) |
| 351 | .is_ok() | ||
| 352 | ); | ||
| 351 | } | 353 | } |
| 352 | } | 354 | } |
diff --git a/embassy-boot/src/test_flash/blocking.rs b/embassy-boot/src/test_flash/blocking.rs index 5ec476c65..7334346fd 100644 --- a/embassy-boot/src/test_flash/blocking.rs +++ b/embassy-boot/src/test_flash/blocking.rs | |||
| @@ -1,8 +1,8 @@ | |||
| 1 | use core::cell::RefCell; | 1 | use core::cell::RefCell; |
| 2 | 2 | ||
| 3 | use embassy_embedded_hal::flash::partition::BlockingPartition; | 3 | use embassy_embedded_hal::flash::partition::BlockingPartition; |
| 4 | use embassy_sync::blocking_mutex::raw::NoopRawMutex; | ||
| 5 | use embassy_sync::blocking_mutex::Mutex; | 4 | use embassy_sync::blocking_mutex::Mutex; |
| 5 | use embassy_sync::blocking_mutex::raw::NoopRawMutex; | ||
| 6 | use embedded_storage::nor_flash::NorFlash; | 6 | use embedded_storage::nor_flash::NorFlash; |
| 7 | 7 | ||
| 8 | use crate::BootLoaderConfig; | 8 | use crate::BootLoaderConfig; |
diff --git a/embassy-embedded-hal/src/flash/partition/blocking.rs b/embassy-embedded-hal/src/flash/partition/blocking.rs index cb30290a8..bd9329e2d 100644 --- a/embassy-embedded-hal/src/flash/partition/blocking.rs +++ b/embassy-embedded-hal/src/flash/partition/blocking.rs | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | use core::cell::RefCell; | 1 | use core::cell::RefCell; |
| 2 | 2 | ||
| 3 | use embassy_sync::blocking_mutex::raw::RawMutex; | ||
| 4 | use embassy_sync::blocking_mutex::Mutex; | 3 | use embassy_sync::blocking_mutex::Mutex; |
| 4 | use embassy_sync::blocking_mutex::raw::RawMutex; | ||
| 5 | use embedded_storage::nor_flash::{ErrorType, MultiwriteNorFlash, NorFlash, ReadNorFlash}; | 5 | use embedded_storage::nor_flash::{ErrorType, MultiwriteNorFlash, NorFlash, ReadNorFlash}; |
| 6 | 6 | ||
| 7 | use super::Error; | 7 | use super::Error; |
diff --git a/embassy-embedded-hal/src/shared_bus/asynch/i2c.rs b/embassy-embedded-hal/src/shared_bus/asynch/i2c.rs index 48246270e..9c7d3ee71 100644 --- a/embassy-embedded-hal/src/shared_bus/asynch/i2c.rs +++ b/embassy-embedded-hal/src/shared_bus/asynch/i2c.rs | |||
| @@ -26,8 +26,8 @@ use embassy_sync::blocking_mutex::raw::RawMutex; | |||
| 26 | use embassy_sync::mutex::Mutex; | 26 | use embassy_sync::mutex::Mutex; |
| 27 | use embedded_hal_async::i2c; | 27 | use embedded_hal_async::i2c; |
| 28 | 28 | ||
| 29 | use crate::shared_bus::I2cDeviceError; | ||
| 30 | use crate::SetConfig; | 29 | use crate::SetConfig; |
| 30 | use crate::shared_bus::I2cDeviceError; | ||
| 31 | 31 | ||
| 32 | /// I2C device on a shared bus. | 32 | /// I2C device on a shared bus. |
| 33 | pub struct I2cDevice<'a, M: RawMutex, BUS> { | 33 | pub struct I2cDevice<'a, M: RawMutex, BUS> { |
diff --git a/embassy-embedded-hal/src/shared_bus/asynch/spi.rs b/embassy-embedded-hal/src/shared_bus/asynch/spi.rs index 0faefbc1e..869a78164 100644 --- a/embassy-embedded-hal/src/shared_bus/asynch/spi.rs +++ b/embassy-embedded-hal/src/shared_bus/asynch/spi.rs | |||
| @@ -32,8 +32,8 @@ use embedded_hal_1::digital::OutputPin; | |||
| 32 | use embedded_hal_1::spi::Operation; | 32 | use embedded_hal_1::spi::Operation; |
| 33 | use embedded_hal_async::spi; | 33 | use embedded_hal_async::spi; |
| 34 | 34 | ||
| 35 | use crate::shared_bus::SpiDeviceError; | ||
| 36 | use crate::SetConfig; | 35 | use crate::SetConfig; |
| 36 | use crate::shared_bus::SpiDeviceError; | ||
| 37 | 37 | ||
| 38 | /// SPI device on a shared bus. | 38 | /// SPI device on a shared bus. |
| 39 | pub struct SpiDevice<'a, M: RawMutex, BUS, CS> { | 39 | pub struct SpiDevice<'a, M: RawMutex, BUS, CS> { |
diff --git a/embassy-embedded-hal/src/shared_bus/blocking/i2c.rs b/embassy-embedded-hal/src/shared_bus/blocking/i2c.rs index dc634a209..49b50f8c1 100644 --- a/embassy-embedded-hal/src/shared_bus/blocking/i2c.rs +++ b/embassy-embedded-hal/src/shared_bus/blocking/i2c.rs | |||
| @@ -17,12 +17,12 @@ | |||
| 17 | 17 | ||
| 18 | use core::cell::RefCell; | 18 | use core::cell::RefCell; |
| 19 | 19 | ||
| 20 | use embassy_sync::blocking_mutex::raw::RawMutex; | ||
| 21 | use embassy_sync::blocking_mutex::Mutex; | 20 | use embassy_sync::blocking_mutex::Mutex; |
| 21 | use embassy_sync::blocking_mutex::raw::RawMutex; | ||
| 22 | use embedded_hal_1::i2c::{ErrorType, I2c, Operation}; | 22 | use embedded_hal_1::i2c::{ErrorType, I2c, Operation}; |
| 23 | 23 | ||
| 24 | use crate::shared_bus::I2cDeviceError; | ||
| 25 | use crate::SetConfig; | 24 | use crate::SetConfig; |
| 25 | use crate::shared_bus::I2cDeviceError; | ||
| 26 | 26 | ||
| 27 | /// I2C device on a shared bus. | 27 | /// I2C device on a shared bus. |
| 28 | pub struct I2cDevice<'a, M: RawMutex, BUS> { | 28 | pub struct I2cDevice<'a, M: RawMutex, BUS> { |
diff --git a/embassy-embedded-hal/src/shared_bus/blocking/spi.rs b/embassy-embedded-hal/src/shared_bus/blocking/spi.rs index ffe2aa1c6..48fe2f4c4 100644 --- a/embassy-embedded-hal/src/shared_bus/blocking/spi.rs +++ b/embassy-embedded-hal/src/shared_bus/blocking/spi.rs | |||
| @@ -19,13 +19,13 @@ | |||
| 19 | 19 | ||
| 20 | use core::cell::RefCell; | 20 | use core::cell::RefCell; |
| 21 | 21 | ||
| 22 | use embassy_sync::blocking_mutex::raw::RawMutex; | ||
| 23 | use embassy_sync::blocking_mutex::Mutex; | 22 | use embassy_sync::blocking_mutex::Mutex; |
| 23 | use embassy_sync::blocking_mutex::raw::RawMutex; | ||
| 24 | use embedded_hal_1::digital::OutputPin; | 24 | use embedded_hal_1::digital::OutputPin; |
| 25 | use embedded_hal_1::spi::{self, Operation, SpiBus}; | 25 | use embedded_hal_1::spi::{self, Operation, SpiBus}; |
| 26 | 26 | ||
| 27 | use crate::shared_bus::SpiDeviceError; | ||
| 28 | use crate::SetConfig; | 27 | use crate::SetConfig; |
| 28 | use crate::shared_bus::SpiDeviceError; | ||
| 29 | 29 | ||
| 30 | /// SPI device on a shared bus. | 30 | /// SPI device on a shared bus. |
| 31 | pub struct SpiDevice<'a, M: RawMutex, BUS, CS> { | 31 | pub struct SpiDevice<'a, M: RawMutex, BUS, CS> { |
diff --git a/embassy-executor-macros/src/macros/main.rs b/embassy-executor-macros/src/macros/main.rs index 3d52ebfe1..c259c003f 100644 --- a/embassy-executor-macros/src/macros/main.rs +++ b/embassy-executor-macros/src/macros/main.rs | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | use std::str::FromStr; | 1 | use std::str::FromStr; |
| 2 | 2 | ||
| 3 | use darling::export::NestedMeta; | ||
| 4 | use darling::FromMeta; | 3 | use darling::FromMeta; |
| 4 | use darling::export::NestedMeta; | ||
| 5 | use proc_macro2::TokenStream; | 5 | use proc_macro2::TokenStream; |
| 6 | use quote::quote; | 6 | use quote::quote; |
| 7 | use syn::{ReturnType, Type}; | 7 | use syn::{ReturnType, Type}; |
diff --git a/embassy-executor-macros/src/macros/task.rs b/embassy-executor-macros/src/macros/task.rs index 755948882..8ce8d6726 100644 --- a/embassy-executor-macros/src/macros/task.rs +++ b/embassy-executor-macros/src/macros/task.rs | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | use std::str::FromStr; | 1 | use std::str::FromStr; |
| 2 | 2 | ||
| 3 | use darling::export::NestedMeta; | ||
| 4 | use darling::FromMeta; | 3 | use darling::FromMeta; |
| 4 | use darling::export::NestedMeta; | ||
| 5 | use proc_macro2::{Span, TokenStream}; | 5 | use proc_macro2::{Span, TokenStream}; |
| 6 | use quote::{format_ident, quote}; | 6 | use quote::{format_ident, quote}; |
| 7 | use syn::visit::{self, Visit}; | 7 | use syn::visit::{self, Visit}; |
| @@ -287,7 +287,11 @@ fn check_arg_ty(errors: &mut TokenStream, ty: &Type) { | |||
| 287 | } | 287 | } |
| 288 | 288 | ||
| 289 | fn visit_type_impl_trait(&mut self, i: &'ast syn::TypeImplTrait) { | 289 | fn visit_type_impl_trait(&mut self, i: &'ast syn::TypeImplTrait) { |
| 290 | error(self.errors, i, "`impl Trait` is not allowed in task arguments. It is syntax sugar for generics, and tasks can't be generic."); | 290 | error( |
| 291 | self.errors, | ||
| 292 | i, | ||
| 293 | "`impl Trait` is not allowed in task arguments. It is syntax sugar for generics, and tasks can't be generic.", | ||
| 294 | ); | ||
| 291 | } | 295 | } |
| 292 | } | 296 | } |
| 293 | 297 | ||
diff --git a/embassy-executor-macros/src/util.rs b/embassy-executor-macros/src/util.rs index ebd032a62..5a13f2121 100644 --- a/embassy-executor-macros/src/util.rs +++ b/embassy-executor-macros/src/util.rs | |||
| @@ -3,7 +3,7 @@ use std::fmt::Display; | |||
| 3 | use proc_macro2::{TokenStream, TokenTree}; | 3 | use proc_macro2::{TokenStream, TokenTree}; |
| 4 | use quote::{ToTokens, TokenStreamExt}; | 4 | use quote::{ToTokens, TokenStreamExt}; |
| 5 | use syn::parse::{Parse, ParseStream}; | 5 | use syn::parse::{Parse, ParseStream}; |
| 6 | use syn::{braced, bracketed, token, AttrStyle, Attribute, Signature, Token, Visibility}; | 6 | use syn::{AttrStyle, Attribute, Signature, Token, Visibility, braced, bracketed, token}; |
| 7 | 7 | ||
| 8 | pub fn token_stream_with_error(mut tokens: TokenStream, error: syn::Error) -> TokenStream { | 8 | pub fn token_stream_with_error(mut tokens: TokenStream, error: syn::Error) -> TokenStream { |
| 9 | tokens.extend(error.into_compile_error()); | 9 | tokens.extend(error.into_compile_error()); |
diff --git a/embassy-executor/src/arch/avr.rs b/embassy-executor/src/arch/avr.rs index 4a19c523a..a841afe15 100644 --- a/embassy-executor/src/arch/avr.rs +++ b/embassy-executor/src/arch/avr.rs | |||
| @@ -10,7 +10,7 @@ mod thread { | |||
| 10 | pub use embassy_executor_macros::main_avr as main; | 10 | pub use embassy_executor_macros::main_avr as main; |
| 11 | use portable_atomic::{AtomicBool, Ordering}; | 11 | use portable_atomic::{AtomicBool, Ordering}; |
| 12 | 12 | ||
| 13 | use crate::{raw, Spawner}; | 13 | use crate::{Spawner, raw}; |
| 14 | 14 | ||
| 15 | static SIGNAL_WORK_THREAD_MODE: AtomicBool = AtomicBool::new(false); | 15 | static SIGNAL_WORK_THREAD_MODE: AtomicBool = AtomicBool::new(false); |
| 16 | 16 | ||
diff --git a/embassy-executor/src/arch/cortex_ar.rs b/embassy-executor/src/arch/cortex_ar.rs index 36d45944a..a9be3d323 100644 --- a/embassy-executor/src/arch/cortex_ar.rs +++ b/embassy-executor/src/arch/cortex_ar.rs | |||
| @@ -26,7 +26,7 @@ mod thread { | |||
| 26 | use cortex_ar::asm::wfe; | 26 | use cortex_ar::asm::wfe; |
| 27 | pub use embassy_executor_macros::main_cortex_ar as main; | 27 | pub use embassy_executor_macros::main_cortex_ar as main; |
| 28 | 28 | ||
| 29 | use crate::{raw, Spawner}; | 29 | use crate::{Spawner, raw}; |
| 30 | 30 | ||
| 31 | /// Thread mode executor, using WFE/SEV. | 31 | /// Thread mode executor, using WFE/SEV. |
| 32 | /// | 32 | /// |
diff --git a/embassy-executor/src/arch/cortex_m.rs b/embassy-executor/src/arch/cortex_m.rs index 9f1081e93..1ce96d1d5 100644 --- a/embassy-executor/src/arch/cortex_m.rs +++ b/embassy-executor/src/arch/cortex_m.rs | |||
| @@ -53,7 +53,7 @@ mod thread { | |||
| 53 | 53 | ||
| 54 | pub use embassy_executor_macros::main_cortex_m as main; | 54 | pub use embassy_executor_macros::main_cortex_m as main; |
| 55 | 55 | ||
| 56 | use crate::{raw, Spawner}; | 56 | use crate::{Spawner, raw}; |
| 57 | 57 | ||
| 58 | /// Thread mode executor, using WFE/SEV. | 58 | /// Thread mode executor, using WFE/SEV. |
| 59 | /// | 59 | /// |
diff --git a/embassy-executor/src/arch/riscv32.rs b/embassy-executor/src/arch/riscv32.rs index 13b93cf02..c70c1344a 100644 --- a/embassy-executor/src/arch/riscv32.rs +++ b/embassy-executor/src/arch/riscv32.rs | |||
| @@ -10,7 +10,7 @@ mod thread { | |||
| 10 | 10 | ||
| 11 | pub use embassy_executor_macros::main_riscv as main; | 11 | pub use embassy_executor_macros::main_riscv as main; |
| 12 | 12 | ||
| 13 | use crate::{raw, Spawner}; | 13 | use crate::{Spawner, raw}; |
| 14 | 14 | ||
| 15 | /// global atomic used to keep track of whether there is work to do since sev() is not available on RISCV | 15 | /// global atomic used to keep track of whether there is work to do since sev() is not available on RISCV |
| 16 | static SIGNAL_WORK_THREAD_MODE: AtomicBool = AtomicBool::new(false); | 16 | static SIGNAL_WORK_THREAD_MODE: AtomicBool = AtomicBool::new(false); |
diff --git a/embassy-executor/src/arch/spin.rs b/embassy-executor/src/arch/spin.rs index 40cb56a09..49f3356a6 100644 --- a/embassy-executor/src/arch/spin.rs +++ b/embassy-executor/src/arch/spin.rs | |||
| @@ -9,7 +9,7 @@ mod thread { | |||
| 9 | 9 | ||
| 10 | pub use embassy_executor_macros::main_spin as main; | 10 | pub use embassy_executor_macros::main_spin as main; |
| 11 | 11 | ||
| 12 | use crate::{raw, Spawner}; | 12 | use crate::{Spawner, raw}; |
| 13 | 13 | ||
| 14 | #[unsafe(export_name = "__pender")] | 14 | #[unsafe(export_name = "__pender")] |
| 15 | fn __pender(_context: *mut ()) {} | 15 | fn __pender(_context: *mut ()) {} |
diff --git a/embassy-executor/src/arch/std.rs b/embassy-executor/src/arch/std.rs index cdb9f7642..c62ab723b 100644 --- a/embassy-executor/src/arch/std.rs +++ b/embassy-executor/src/arch/std.rs | |||
| @@ -10,7 +10,7 @@ mod thread { | |||
| 10 | 10 | ||
| 11 | pub use embassy_executor_macros::main_std as main; | 11 | pub use embassy_executor_macros::main_std as main; |
| 12 | 12 | ||
| 13 | use crate::{raw, Spawner}; | 13 | use crate::{Spawner, raw}; |
| 14 | 14 | ||
| 15 | #[unsafe(export_name = "__pender")] | 15 | #[unsafe(export_name = "__pender")] |
| 16 | fn __pender(context: *mut ()) { | 16 | fn __pender(context: *mut ()) { |
diff --git a/embassy-executor/src/arch/wasm.rs b/embassy-executor/src/arch/wasm.rs index 6b36f8a5b..d2ff2fe51 100644 --- a/embassy-executor/src/arch/wasm.rs +++ b/embassy-executor/src/arch/wasm.rs | |||
| @@ -13,7 +13,7 @@ mod thread { | |||
| 13 | use wasm_bindgen::prelude::*; | 13 | use wasm_bindgen::prelude::*; |
| 14 | 14 | ||
| 15 | use crate::raw::util::UninitCell; | 15 | use crate::raw::util::UninitCell; |
| 16 | use crate::{raw, Spawner}; | 16 | use crate::{Spawner, raw}; |
| 17 | 17 | ||
| 18 | #[unsafe(export_name = "__pender")] | 18 | #[unsafe(export_name = "__pender")] |
| 19 | fn __pender(context: *mut ()) { | 19 | fn __pender(context: *mut ()) { |
diff --git a/embassy-executor/src/metadata.rs b/embassy-executor/src/metadata.rs index bc0df0f83..76504ab0b 100644 --- a/embassy-executor/src/metadata.rs +++ b/embassy-executor/src/metadata.rs | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | #[cfg(feature = "metadata-name")] | 1 | #[cfg(feature = "metadata-name")] |
| 2 | use core::cell::Cell; | 2 | use core::cell::Cell; |
| 3 | use core::future::{poll_fn, Future}; | 3 | use core::future::{Future, poll_fn}; |
| 4 | #[cfg(feature = "scheduler-priority")] | 4 | #[cfg(feature = "scheduler-priority")] |
| 5 | use core::sync::atomic::{AtomicU8, Ordering}; | 5 | use core::sync::atomic::{AtomicU8, Ordering}; |
| 6 | use core::task::Poll; | 6 | use core::task::Poll; |
diff --git a/embassy-executor/src/raw/run_queue.rs b/embassy-executor/src/raw/run_queue.rs index b8b052310..6f2abdbd0 100644 --- a/embassy-executor/src/raw/run_queue.rs +++ b/embassy-executor/src/raw/run_queue.rs | |||
| @@ -1,9 +1,9 @@ | |||
| 1 | use core::ptr::{addr_of_mut, NonNull}; | 1 | use core::ptr::{NonNull, addr_of_mut}; |
| 2 | 2 | ||
| 3 | use cordyceps::sorted_list::Links; | ||
| 4 | use cordyceps::Linked; | 3 | use cordyceps::Linked; |
| 5 | #[cfg(any(feature = "scheduler-priority", feature = "scheduler-deadline"))] | 4 | #[cfg(any(feature = "scheduler-priority", feature = "scheduler-deadline"))] |
| 6 | use cordyceps::SortedList; | 5 | use cordyceps::SortedList; |
| 6 | use cordyceps::sorted_list::Links; | ||
| 7 | 7 | ||
| 8 | #[cfg(target_has_atomic = "ptr")] | 8 | #[cfg(target_has_atomic = "ptr")] |
| 9 | type TransferStack<T> = cordyceps::TransferStack<T>; | 9 | type TransferStack<T> = cordyceps::TransferStack<T>; |
diff --git a/embassy-executor/src/raw/state_atomics_arm.rs b/embassy-executor/src/raw/state_atomics_arm.rs index b743dcc2c..f68de955f 100644 --- a/embassy-executor/src/raw/state_atomics_arm.rs +++ b/embassy-executor/src/raw/state_atomics_arm.rs | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | use core::sync::atomic::{compiler_fence, AtomicBool, AtomicU32, Ordering}; | 1 | use core::sync::atomic::{AtomicBool, AtomicU32, Ordering, compiler_fence}; |
| 2 | 2 | ||
| 3 | #[derive(Clone, Copy)] | 3 | #[derive(Clone, Copy)] |
| 4 | pub(crate) struct Token(()); | 4 | pub(crate) struct Token(()); |
diff --git a/embassy-executor/src/raw/state_critical_section.rs b/embassy-executor/src/raw/state_critical_section.rs index b69a6ac66..8d7ef2892 100644 --- a/embassy-executor/src/raw/state_critical_section.rs +++ b/embassy-executor/src/raw/state_critical_section.rs | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | use core::cell::Cell; | 1 | use core::cell::Cell; |
| 2 | 2 | ||
| 3 | pub(crate) use critical_section::{with as locked, CriticalSection as Token}; | ||
| 4 | use critical_section::{CriticalSection, Mutex}; | 3 | use critical_section::{CriticalSection, Mutex}; |
| 4 | pub(crate) use critical_section::{CriticalSection as Token, with as locked}; | ||
| 5 | 5 | ||
| 6 | #[cfg(target_arch = "avr")] | 6 | #[cfg(target_arch = "avr")] |
| 7 | type StateBits = u8; | 7 | type StateBits = u8; |
diff --git a/embassy-executor/src/raw/trace.rs b/embassy-executor/src/raw/trace.rs index b3086948c..74519b927 100644 --- a/embassy-executor/src/raw/trace.rs +++ b/embassy-executor/src/raw/trace.rs | |||
| @@ -368,11 +368,7 @@ impl rtos_trace::RtosTraceOSCallbacks for crate::raw::SyncExecutor { | |||
| 368 | } | 368 | } |
| 369 | fn time() -> u64 { | 369 | fn time() -> u64 { |
| 370 | const fn gcd(a: u64, b: u64) -> u64 { | 370 | const fn gcd(a: u64, b: u64) -> u64 { |
| 371 | if b == 0 { | 371 | if b == 0 { a } else { gcd(b, a % b) } |
| 372 | a | ||
| 373 | } else { | ||
| 374 | gcd(b, a % b) | ||
| 375 | } | ||
| 376 | } | 372 | } |
| 377 | 373 | ||
| 378 | const GCD_1M: u64 = gcd(embassy_time_driver::TICK_HZ, 1_000_000); | 374 | const GCD_1M: u64 = gcd(embassy_time_driver::TICK_HZ, 1_000_000); |
diff --git a/embassy-executor/src/raw/waker.rs b/embassy-executor/src/raw/waker.rs index d0d7b003d..2706f0fdf 100644 --- a/embassy-executor/src/raw/waker.rs +++ b/embassy-executor/src/raw/waker.rs | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | use core::task::{RawWaker, RawWakerVTable, Waker}; | 1 | use core::task::{RawWaker, RawWakerVTable, Waker}; |
| 2 | 2 | ||
| 3 | use super::{wake_task, TaskHeader, TaskRef}; | 3 | use super::{TaskHeader, TaskRef, wake_task}; |
| 4 | 4 | ||
| 5 | static VTABLE: RawWakerVTable = RawWakerVTable::new(clone, wake, wake, drop); | 5 | static VTABLE: RawWakerVTable = RawWakerVTable::new(clone, wake, wake, drop); |
| 6 | 6 | ||
| @@ -35,7 +35,9 @@ pub fn task_from_waker(waker: &Waker) -> TaskRef { | |||
| 35 | // make sure to compare vtable addresses. Doing `==` on the references | 35 | // make sure to compare vtable addresses. Doing `==` on the references |
| 36 | // will compare the contents, which is slower. | 36 | // will compare the contents, which is slower. |
| 37 | if waker.vtable() as *const _ != &VTABLE as *const _ { | 37 | if waker.vtable() as *const _ != &VTABLE as *const _ { |
| 38 | panic!("Found waker not created by the Embassy executor. `embassy_time::Timer` only works with the Embassy executor.") | 38 | panic!( |
| 39 | "Found waker not created by the Embassy executor. `embassy_time::Timer` only works with the Embassy executor." | ||
| 40 | ) | ||
| 39 | } | 41 | } |
| 40 | // safety: our wakers are always created with `TaskRef::as_ptr` | 42 | // safety: our wakers are always created with `TaskRef::as_ptr` |
| 41 | unsafe { TaskRef::from_ptr(waker.data() as *const TaskHeader) } | 43 | unsafe { TaskRef::from_ptr(waker.data() as *const TaskHeader) } |
diff --git a/embassy-executor/src/raw/waker_turbo.rs b/embassy-executor/src/raw/waker_turbo.rs index 9d0ad35ec..919bcc61a 100644 --- a/embassy-executor/src/raw/waker_turbo.rs +++ b/embassy-executor/src/raw/waker_turbo.rs | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | use core::ptr::NonNull; | 1 | use core::ptr::NonNull; |
| 2 | use core::task::Waker; | 2 | use core::task::Waker; |
| 3 | 3 | ||
| 4 | use super::{wake_task, TaskHeader, TaskRef}; | 4 | use super::{TaskHeader, TaskRef, wake_task}; |
| 5 | 5 | ||
| 6 | pub(crate) unsafe fn from_task(p: TaskRef) -> Waker { | 6 | pub(crate) unsafe fn from_task(p: TaskRef) -> Waker { |
| 7 | Waker::from_turbo_ptr(NonNull::new_unchecked(p.as_ptr() as _)) | 7 | Waker::from_turbo_ptr(NonNull::new_unchecked(p.as_ptr() as _)) |
diff --git a/embassy-executor/src/spawner.rs b/embassy-executor/src/spawner.rs index 83d896b76..b73a1e7c6 100644 --- a/embassy-executor/src/spawner.rs +++ b/embassy-executor/src/spawner.rs | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | use core::future::{poll_fn, Future}; | 1 | use core::future::{Future, poll_fn}; |
| 2 | use core::marker::PhantomData; | 2 | use core::marker::PhantomData; |
| 3 | use core::mem; | 3 | use core::mem; |
| 4 | use core::sync::atomic::Ordering; | 4 | use core::sync::atomic::Ordering; |
| @@ -75,7 +75,10 @@ impl core::fmt::Debug for SpawnError { | |||
| 75 | impl core::fmt::Display for SpawnError { | 75 | impl core::fmt::Display for SpawnError { |
| 76 | fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { | 76 | fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { |
| 77 | match self { | 77 | match self { |
| 78 | SpawnError::Busy => write!(f, "Busy - Too many instances of this task are already running. Check the `pool_size` attribute of the task."), | 78 | SpawnError::Busy => write!( |
| 79 | f, | ||
| 80 | "Busy - Too many instances of this task are already running. Check the `pool_size` attribute of the task." | ||
| 81 | ), | ||
| 79 | } | 82 | } |
| 80 | } | 83 | } |
| 81 | } | 84 | } |
| @@ -84,7 +87,10 @@ impl core::fmt::Display for SpawnError { | |||
| 84 | impl defmt::Format for SpawnError { | 87 | impl defmt::Format for SpawnError { |
| 85 | fn format(&self, f: defmt::Formatter) { | 88 | fn format(&self, f: defmt::Formatter) { |
| 86 | match self { | 89 | match self { |
| 87 | SpawnError::Busy => defmt::write!(f, "Busy - Too many instances of this task are already running. Check the `pool_size` attribute of the task."), | 90 | SpawnError::Busy => defmt::write!( |
| 91 | f, | ||
| 92 | "Busy - Too many instances of this task are already running. Check the `pool_size` attribute of the task." | ||
| 93 | ), | ||
| 88 | } | 94 | } |
| 89 | } | 95 | } |
| 90 | } | 96 | } |
diff --git a/embassy-executor/tests/test.rs b/embassy-executor/tests/test.rs index 6c4783dc1..a99976168 100644 --- a/embassy-executor/tests/test.rs +++ b/embassy-executor/tests/test.rs | |||
| @@ -2,12 +2,12 @@ | |||
| 2 | #![cfg_attr(feature = "nightly", feature(never_type))] | 2 | #![cfg_attr(feature = "nightly", feature(never_type))] |
| 3 | 3 | ||
| 4 | use std::boxed::Box; | 4 | use std::boxed::Box; |
| 5 | use std::future::{poll_fn, Future}; | 5 | use std::future::{Future, poll_fn}; |
| 6 | use std::sync::{Arc, Mutex}; | 6 | use std::sync::{Arc, Mutex}; |
| 7 | use std::task::Poll; | 7 | use std::task::Poll; |
| 8 | 8 | ||
| 9 | use embassy_executor::raw::Executor; | 9 | use embassy_executor::raw::Executor; |
| 10 | use embassy_executor::{task, Spawner}; | 10 | use embassy_executor::{Spawner, task}; |
| 11 | 11 | ||
| 12 | #[unsafe(export_name = "__pender")] | 12 | #[unsafe(export_name = "__pender")] |
| 13 | fn __pender(context: *mut ()) { | 13 | fn __pender(context: *mut ()) { |
diff --git a/embassy-hal-internal/src/interrupt.rs b/embassy-hal-internal/src/interrupt.rs index 5e64dce9d..ce6057e2d 100644 --- a/embassy-hal-internal/src/interrupt.rs +++ b/embassy-hal-internal/src/interrupt.rs | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | //! Interrupt handling for cortex-m devices. | 1 | //! Interrupt handling for cortex-m devices. |
| 2 | use core::mem; | 2 | use core::mem; |
| 3 | use core::sync::atomic::{compiler_fence, Ordering}; | 3 | use core::sync::atomic::{Ordering, compiler_fence}; |
| 4 | 4 | ||
| 5 | use cortex_m::interrupt::InterruptNumber; | 5 | use cortex_m::interrupt::InterruptNumber; |
| 6 | use cortex_m::peripheral::NVIC; | 6 | use cortex_m::peripheral::NVIC; |
diff --git a/embassy-imxrt/src/clocks.rs b/embassy-imxrt/src/clocks.rs index 39c3e6238..22df2686f 100644 --- a/embassy-imxrt/src/clocks.rs +++ b/embassy-imxrt/src/clocks.rs | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | //! Clock configuration for the `RT6xx` | 1 | //! Clock configuration for the `RT6xx` |
| 2 | use core::sync::atomic::{AtomicU32, AtomicU8, Ordering}; | 2 | use core::sync::atomic::{AtomicU8, AtomicU32, Ordering}; |
| 3 | 3 | ||
| 4 | use paste::paste; | 4 | use paste::paste; |
| 5 | 5 | ||
diff --git a/embassy-imxrt/src/crc.rs b/embassy-imxrt/src/crc.rs index 24d6ba5bd..d6f0419d0 100644 --- a/embassy-imxrt/src/crc.rs +++ b/embassy-imxrt/src/crc.rs | |||
| @@ -2,9 +2,9 @@ | |||
| 2 | 2 | ||
| 3 | use core::marker::PhantomData; | 3 | use core::marker::PhantomData; |
| 4 | 4 | ||
| 5 | use crate::clocks::{enable_and_reset, SysconPeripheral}; | 5 | use crate::clocks::{SysconPeripheral, enable_and_reset}; |
| 6 | pub use crate::pac::crc_engine::mode::CrcPolynomial as Polynomial; | 6 | pub use crate::pac::crc_engine::mode::CrcPolynomial as Polynomial; |
| 7 | use crate::{peripherals, Peri, PeripheralType}; | 7 | use crate::{Peri, PeripheralType, peripherals}; |
| 8 | 8 | ||
| 9 | /// CRC driver. | 9 | /// CRC driver. |
| 10 | pub struct Crc<'d> { | 10 | pub struct Crc<'d> { |
diff --git a/embassy-imxrt/src/dma.rs b/embassy-imxrt/src/dma.rs index e141447f3..e71a27e0e 100644 --- a/embassy-imxrt/src/dma.rs +++ b/embassy-imxrt/src/dma.rs | |||
| @@ -2,10 +2,10 @@ | |||
| 2 | 2 | ||
| 3 | use core::future::Future; | 3 | use core::future::Future; |
| 4 | use core::pin::Pin; | 4 | use core::pin::Pin; |
| 5 | use core::sync::atomic::{compiler_fence, Ordering}; | 5 | use core::sync::atomic::{Ordering, compiler_fence}; |
| 6 | use core::task::{Context, Poll}; | 6 | use core::task::{Context, Poll}; |
| 7 | 7 | ||
| 8 | use embassy_hal_internal::{impl_peripheral, Peri, PeripheralType}; | 8 | use embassy_hal_internal::{Peri, PeripheralType, impl_peripheral}; |
| 9 | use embassy_sync::waitqueue::AtomicWaker; | 9 | use embassy_sync::waitqueue::AtomicWaker; |
| 10 | use pac::dma0::channel::cfg::Periphreqen; | 10 | use pac::dma0::channel::cfg::Periphreqen; |
| 11 | use pac::dma0::channel::xfercfg::{Dstinc, Srcinc, Width}; | 11 | use pac::dma0::channel::xfercfg::{Dstinc, Srcinc, Width}; |
| @@ -14,7 +14,7 @@ use crate::clocks::enable_and_reset; | |||
| 14 | use crate::interrupt::InterruptExt; | 14 | use crate::interrupt::InterruptExt; |
| 15 | use crate::peripherals::DMA0; | 15 | use crate::peripherals::DMA0; |
| 16 | use crate::sealed::Sealed; | 16 | use crate::sealed::Sealed; |
| 17 | use crate::{interrupt, pac, peripherals, BitIter}; | 17 | use crate::{BitIter, interrupt, pac, peripherals}; |
| 18 | 18 | ||
| 19 | #[cfg(feature = "rt")] | 19 | #[cfg(feature = "rt")] |
| 20 | #[interrupt] | 20 | #[interrupt] |
diff --git a/embassy-imxrt/src/flexcomm/mod.rs b/embassy-imxrt/src/flexcomm/mod.rs index 4473c9a77..27794042b 100644 --- a/embassy-imxrt/src/flexcomm/mod.rs +++ b/embassy-imxrt/src/flexcomm/mod.rs | |||
| @@ -4,11 +4,11 @@ pub mod uart; | |||
| 4 | 4 | ||
| 5 | use paste::paste; | 5 | use paste::paste; |
| 6 | 6 | ||
| 7 | use crate::clocks::{enable_and_reset, SysconPeripheral}; | 7 | use crate::clocks::{SysconPeripheral, enable_and_reset}; |
| 8 | use crate::peripherals::{ | 8 | use crate::peripherals::{ |
| 9 | FLEXCOMM0, FLEXCOMM1, FLEXCOMM14, FLEXCOMM15, FLEXCOMM2, FLEXCOMM3, FLEXCOMM4, FLEXCOMM5, FLEXCOMM6, FLEXCOMM7, | 9 | FLEXCOMM0, FLEXCOMM1, FLEXCOMM2, FLEXCOMM3, FLEXCOMM4, FLEXCOMM5, FLEXCOMM6, FLEXCOMM7, FLEXCOMM14, FLEXCOMM15, |
| 10 | }; | 10 | }; |
| 11 | use crate::{pac, PeripheralType}; | 11 | use crate::{PeripheralType, pac}; |
| 12 | 12 | ||
| 13 | /// clock selection option | 13 | /// clock selection option |
| 14 | #[derive(Copy, Clone, Debug)] | 14 | #[derive(Copy, Clone, Debug)] |
| @@ -223,9 +223,15 @@ macro_rules! into_mode { | |||
| 223 | } | 223 | } |
| 224 | } | 224 | } |
| 225 | 225 | ||
| 226 | into_mode!(usart, FLEXCOMM0, FLEXCOMM1, FLEXCOMM2, FLEXCOMM3, FLEXCOMM4, FLEXCOMM5, FLEXCOMM6, FLEXCOMM7); | 226 | into_mode!( |
| 227 | into_mode!(spi, FLEXCOMM0, FLEXCOMM1, FLEXCOMM2, FLEXCOMM3, FLEXCOMM4, FLEXCOMM5, FLEXCOMM6, FLEXCOMM7, FLEXCOMM14); | 227 | usart, FLEXCOMM0, FLEXCOMM1, FLEXCOMM2, FLEXCOMM3, FLEXCOMM4, FLEXCOMM5, FLEXCOMM6, FLEXCOMM7 |
| 228 | into_mode!(i2c, FLEXCOMM0, FLEXCOMM1, FLEXCOMM2, FLEXCOMM3, FLEXCOMM4, FLEXCOMM5, FLEXCOMM6, FLEXCOMM7, FLEXCOMM15); | 228 | ); |
| 229 | into_mode!( | ||
| 230 | spi, FLEXCOMM0, FLEXCOMM1, FLEXCOMM2, FLEXCOMM3, FLEXCOMM4, FLEXCOMM5, FLEXCOMM6, FLEXCOMM7, FLEXCOMM14 | ||
| 231 | ); | ||
| 232 | into_mode!( | ||
| 233 | i2c, FLEXCOMM0, FLEXCOMM1, FLEXCOMM2, FLEXCOMM3, FLEXCOMM4, FLEXCOMM5, FLEXCOMM6, FLEXCOMM7, FLEXCOMM15 | ||
| 234 | ); | ||
| 229 | 235 | ||
| 230 | into_mode!( | 236 | into_mode!( |
| 231 | i2s_transmit, | 237 | i2s_transmit, |
diff --git a/embassy-imxrt/src/flexcomm/uart.rs b/embassy-imxrt/src/flexcomm/uart.rs index 230b30d43..2b759ba84 100644 --- a/embassy-imxrt/src/flexcomm/uart.rs +++ b/embassy-imxrt/src/flexcomm/uart.rs | |||
| @@ -2,10 +2,10 @@ | |||
| 2 | 2 | ||
| 3 | use core::future::poll_fn; | 3 | use core::future::poll_fn; |
| 4 | use core::marker::PhantomData; | 4 | use core::marker::PhantomData; |
| 5 | use core::sync::atomic::{compiler_fence, AtomicU8, Ordering}; | 5 | use core::sync::atomic::{AtomicU8, Ordering, compiler_fence}; |
| 6 | use core::task::Poll; | 6 | use core::task::Poll; |
| 7 | 7 | ||
| 8 | use embassy_futures::select::{select, Either}; | 8 | use embassy_futures::select::{Either, select}; |
| 9 | use embassy_hal_internal::drop::OnDrop; | 9 | use embassy_hal_internal::drop::OnDrop; |
| 10 | use embassy_hal_internal::{Peri, PeripheralType}; | 10 | use embassy_hal_internal::{Peri, PeripheralType}; |
| 11 | use embassy_sync::waitqueue::AtomicWaker; | 11 | use embassy_sync::waitqueue::AtomicWaker; |
diff --git a/embassy-imxrt/src/gpio.rs b/embassy-imxrt/src/gpio.rs index e62fde8b1..4a0608e76 100644 --- a/embassy-imxrt/src/gpio.rs +++ b/embassy-imxrt/src/gpio.rs | |||
| @@ -13,7 +13,7 @@ use crate::clocks::enable_and_reset; | |||
| 13 | use crate::iopctl::IopctlPin; | 13 | use crate::iopctl::IopctlPin; |
| 14 | pub use crate::iopctl::{AnyPin, DriveMode, DriveStrength, Function, Inverter, Pull, SlewRate}; | 14 | pub use crate::iopctl::{AnyPin, DriveMode, DriveStrength, Function, Inverter, Pull, SlewRate}; |
| 15 | use crate::sealed::Sealed; | 15 | use crate::sealed::Sealed; |
| 16 | use crate::{interrupt, peripherals, BitIter, Peri, PeripheralType}; | 16 | use crate::{BitIter, Peri, PeripheralType, interrupt, peripherals}; |
| 17 | 17 | ||
| 18 | // This should be unique per IMXRT package | 18 | // This should be unique per IMXRT package |
| 19 | const PORT_COUNT: usize = 8; | 19 | const PORT_COUNT: usize = 8; |
diff --git a/embassy-imxrt/src/iopctl.rs b/embassy-imxrt/src/iopctl.rs index a3b8b14d6..805bf2f1b 100644 --- a/embassy-imxrt/src/iopctl.rs +++ b/embassy-imxrt/src/iopctl.rs | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | //! | 2 | //! |
| 3 | //! Also known as IO Pin Configuration (IOCON) | 3 | //! Also known as IO Pin Configuration (IOCON) |
| 4 | 4 | ||
| 5 | use crate::pac::{iopctl, Iopctl}; | 5 | use crate::pac::{Iopctl, iopctl}; |
| 6 | 6 | ||
| 7 | // A generic pin of any type. | 7 | // A generic pin of any type. |
| 8 | // | 8 | // |
diff --git a/embassy-imxrt/src/lib.rs b/embassy-imxrt/src/lib.rs index 00ac9af29..643dd0c8a 100644 --- a/embassy-imxrt/src/lib.rs +++ b/embassy-imxrt/src/lib.rs | |||
| @@ -40,7 +40,7 @@ pub use chip::interrupts::*; | |||
| 40 | pub use chip::pac; | 40 | pub use chip::pac; |
| 41 | #[cfg(not(feature = "unstable-pac"))] | 41 | #[cfg(not(feature = "unstable-pac"))] |
| 42 | pub(crate) use chip::pac; | 42 | pub(crate) use chip::pac; |
| 43 | pub use chip::{peripherals, Peripherals}; | 43 | pub use chip::{Peripherals, peripherals}; |
| 44 | pub use embassy_hal_internal::{Peri, PeripheralType}; | 44 | pub use embassy_hal_internal::{Peri, PeripheralType}; |
| 45 | 45 | ||
| 46 | #[cfg(feature = "rt")] | 46 | #[cfg(feature = "rt")] |
diff --git a/embassy-imxrt/src/rng.rs b/embassy-imxrt/src/rng.rs index 75f243df9..094418e41 100644 --- a/embassy-imxrt/src/rng.rs +++ b/embassy-imxrt/src/rng.rs | |||
| @@ -7,9 +7,9 @@ use core::task::Poll; | |||
| 7 | use embassy_futures::block_on; | 7 | use embassy_futures::block_on; |
| 8 | use embassy_sync::waitqueue::AtomicWaker; | 8 | use embassy_sync::waitqueue::AtomicWaker; |
| 9 | 9 | ||
| 10 | use crate::clocks::{enable_and_reset, SysconPeripheral}; | 10 | use crate::clocks::{SysconPeripheral, enable_and_reset}; |
| 11 | use crate::interrupt::typelevel::Interrupt; | 11 | use crate::interrupt::typelevel::Interrupt; |
| 12 | use crate::{interrupt, peripherals, Peri, PeripheralType}; | 12 | use crate::{Peri, PeripheralType, interrupt, peripherals}; |
| 13 | 13 | ||
| 14 | static RNG_WAKER: AtomicWaker = AtomicWaker::new(); | 14 | static RNG_WAKER: AtomicWaker = AtomicWaker::new(); |
| 15 | 15 | ||
diff --git a/embassy-imxrt/src/time_driver.rs b/embassy-imxrt/src/time_driver.rs index f127609c8..fbd935b70 100644 --- a/embassy-imxrt/src/time_driver.rs +++ b/embassy-imxrt/src/time_driver.rs | |||
| @@ -1,11 +1,11 @@ | |||
| 1 | //! Time Driver. | 1 | //! Time Driver. |
| 2 | use core::cell::{Cell, RefCell}; | 2 | use core::cell::{Cell, RefCell}; |
| 3 | #[cfg(feature = "time-driver-rtc")] | 3 | #[cfg(feature = "time-driver-rtc")] |
| 4 | use core::sync::atomic::{compiler_fence, AtomicU32, Ordering}; | 4 | use core::sync::atomic::{AtomicU32, Ordering, compiler_fence}; |
| 5 | 5 | ||
| 6 | use critical_section::CriticalSection; | 6 | use critical_section::CriticalSection; |
| 7 | use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex; | ||
| 8 | use embassy_sync::blocking_mutex::Mutex; | 7 | use embassy_sync::blocking_mutex::Mutex; |
| 8 | use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex; | ||
| 9 | use embassy_time_driver::Driver; | 9 | use embassy_time_driver::Driver; |
| 10 | use embassy_time_queue_utils::Queue; | 10 | use embassy_time_queue_utils::Queue; |
| 11 | 11 | ||
diff --git a/embassy-mspm0/src/adc.rs b/embassy-mspm0/src/adc.rs index 5b93e9a6e..948801679 100644 --- a/embassy-mspm0/src/adc.rs +++ b/embassy-mspm0/src/adc.rs | |||
| @@ -4,13 +4,13 @@ use core::future::poll_fn; | |||
| 4 | use core::marker::PhantomData; | 4 | use core::marker::PhantomData; |
| 5 | use core::task::Poll; | 5 | use core::task::Poll; |
| 6 | 6 | ||
| 7 | use embassy_hal_internal::{impl_peripheral, PeripheralType}; | 7 | use embassy_hal_internal::{PeripheralType, impl_peripheral}; |
| 8 | use embassy_sync::waitqueue::AtomicWaker; | 8 | use embassy_sync::waitqueue::AtomicWaker; |
| 9 | 9 | ||
| 10 | use crate::interrupt::{Interrupt, InterruptExt}; | 10 | use crate::interrupt::{Interrupt, InterruptExt}; |
| 11 | use crate::mode::{Async, Blocking, Mode}; | 11 | use crate::mode::{Async, Blocking, Mode}; |
| 12 | use crate::pac::adc::{vals, Adc as Regs}; | 12 | use crate::pac::adc::{Adc as Regs, vals}; |
| 13 | use crate::{interrupt, Peri}; | 13 | use crate::{Peri, interrupt}; |
| 14 | 14 | ||
| 15 | /// Interrupt handler. | 15 | /// Interrupt handler. |
| 16 | pub struct InterruptHandler<T: Instance> { | 16 | pub struct InterruptHandler<T: Instance> { |
diff --git a/embassy-mspm0/src/dma.rs b/embassy-mspm0/src/dma.rs index 66b79709c..58b087761 100644 --- a/embassy-mspm0/src/dma.rs +++ b/embassy-mspm0/src/dma.rs | |||
| @@ -5,18 +5,18 @@ | |||
| 5 | use core::future::Future; | 5 | use core::future::Future; |
| 6 | use core::mem; | 6 | use core::mem; |
| 7 | use core::pin::Pin; | 7 | use core::pin::Pin; |
| 8 | use core::sync::atomic::{compiler_fence, Ordering}; | 8 | use core::sync::atomic::{Ordering, compiler_fence}; |
| 9 | use core::task::{Context, Poll}; | 9 | use core::task::{Context, Poll}; |
| 10 | 10 | ||
| 11 | use critical_section::CriticalSection; | 11 | use critical_section::CriticalSection; |
| 12 | use embassy_hal_internal::interrupt::InterruptExt; | 12 | use embassy_hal_internal::interrupt::InterruptExt; |
| 13 | use embassy_hal_internal::{impl_peripheral, PeripheralType}; | 13 | use embassy_hal_internal::{PeripheralType, impl_peripheral}; |
| 14 | use embassy_sync::waitqueue::AtomicWaker; | 14 | use embassy_sync::waitqueue::AtomicWaker; |
| 15 | use mspm0_metapac::common::{Reg, RW}; | 15 | use mspm0_metapac::common::{RW, Reg}; |
| 16 | use mspm0_metapac::dma::regs; | 16 | use mspm0_metapac::dma::regs; |
| 17 | use mspm0_metapac::dma::vals::{self, Autoen, Em, Incr, Preirq, Wdth}; | 17 | use mspm0_metapac::dma::vals::{self, Autoen, Em, Incr, Preirq, Wdth}; |
| 18 | 18 | ||
| 19 | use crate::{interrupt, pac, Peri}; | 19 | use crate::{Peri, interrupt, pac}; |
| 20 | 20 | ||
| 21 | /// The burst size of a DMA transfer. | 21 | /// The burst size of a DMA transfer. |
| 22 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] | 22 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] |
diff --git a/embassy-mspm0/src/gpio.rs b/embassy-mspm0/src/gpio.rs index 4668262a9..a4d41aa71 100644 --- a/embassy-mspm0/src/gpio.rs +++ b/embassy-mspm0/src/gpio.rs | |||
| @@ -5,7 +5,7 @@ use core::future::Future; | |||
| 5 | use core::pin::Pin as FuturePin; | 5 | use core::pin::Pin as FuturePin; |
| 6 | use core::task::{Context, Poll}; | 6 | use core::task::{Context, Poll}; |
| 7 | 7 | ||
| 8 | use embassy_hal_internal::{impl_peripheral, Peri, PeripheralType}; | 8 | use embassy_hal_internal::{Peri, PeripheralType, impl_peripheral}; |
| 9 | use embassy_sync::waitqueue::AtomicWaker; | 9 | use embassy_sync::waitqueue::AtomicWaker; |
| 10 | 10 | ||
| 11 | use crate::pac::gpio::vals::*; | 11 | use crate::pac::gpio::vals::*; |
diff --git a/embassy-mspm0/src/i2c.rs b/embassy-mspm0/src/i2c.rs index 1906e37ba..a12b4b4a2 100644 --- a/embassy-mspm0/src/i2c.rs +++ b/embassy-mspm0/src/i2c.rs | |||
| @@ -10,13 +10,13 @@ use embassy_hal_internal::PeripheralType; | |||
| 10 | use embassy_sync::waitqueue::AtomicWaker; | 10 | use embassy_sync::waitqueue::AtomicWaker; |
| 11 | use mspm0_metapac::i2c; | 11 | use mspm0_metapac::i2c; |
| 12 | 12 | ||
| 13 | use crate::Peri; | ||
| 13 | use crate::gpio::{AnyPin, PfType, Pull, SealedPin}; | 14 | use crate::gpio::{AnyPin, PfType, Pull, SealedPin}; |
| 14 | use crate::interrupt::typelevel::Binding; | 15 | use crate::interrupt::typelevel::Binding; |
| 15 | use crate::interrupt::{Interrupt, InterruptExt}; | 16 | use crate::interrupt::{Interrupt, InterruptExt}; |
| 16 | use crate::mode::{Async, Blocking, Mode}; | 17 | use crate::mode::{Async, Blocking, Mode}; |
| 17 | use crate::pac::i2c::{vals, I2c as Regs}; | 18 | use crate::pac::i2c::{I2c as Regs, vals}; |
| 18 | use crate::pac::{self}; | 19 | use crate::pac::{self}; |
| 19 | use crate::Peri; | ||
| 20 | 20 | ||
| 21 | /// The clock source for the I2C. | 21 | /// The clock source for the I2C. |
| 22 | #[derive(Clone, Copy, PartialEq, Eq, Debug)] | 22 | #[derive(Clone, Copy, PartialEq, Eq, Debug)] |
diff --git a/embassy-mspm0/src/lib.rs b/embassy-mspm0/src/lib.rs index 06938c21d..55f3f9381 100644 --- a/embassy-mspm0/src/lib.rs +++ b/embassy-mspm0/src/lib.rs | |||
| @@ -55,7 +55,7 @@ pub(crate) mod _generated { | |||
| 55 | 55 | ||
| 56 | // Reexports | 56 | // Reexports |
| 57 | pub(crate) use _generated::gpio_pincm; | 57 | pub(crate) use _generated::gpio_pincm; |
| 58 | pub use _generated::{peripherals, Peripherals}; | 58 | pub use _generated::{Peripherals, peripherals}; |
| 59 | pub use embassy_hal_internal::Peri; | 59 | pub use embassy_hal_internal::Peri; |
| 60 | #[cfg(feature = "unstable-pac")] | 60 | #[cfg(feature = "unstable-pac")] |
| 61 | pub use mspm0_metapac as pac; | 61 | pub use mspm0_metapac as pac; |
diff --git a/embassy-mspm0/src/time_driver.rs b/embassy-mspm0/src/time_driver.rs index e80e89e55..0743c667b 100644 --- a/embassy-mspm0/src/time_driver.rs +++ b/embassy-mspm0/src/time_driver.rs | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | use core::cell::{Cell, RefCell}; | 1 | use core::cell::{Cell, RefCell}; |
| 2 | use core::sync::atomic::{compiler_fence, AtomicU32, Ordering}; | 2 | use core::sync::atomic::{AtomicU32, Ordering, compiler_fence}; |
| 3 | use core::task::Waker; | 3 | use core::task::Waker; |
| 4 | 4 | ||
| 5 | use critical_section::{CriticalSection, Mutex}; | 5 | use critical_section::{CriticalSection, Mutex}; |
diff --git a/embassy-mspm0/src/uart/buffered.rs b/embassy-mspm0/src/uart/buffered.rs index cbc0b6c80..89e6bcc7b 100644 --- a/embassy-mspm0/src/uart/buffered.rs +++ b/embassy-mspm0/src/uart/buffered.rs | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | use core::future::{poll_fn, Future}; | 1 | use core::future::{Future, poll_fn}; |
| 2 | use core::marker::PhantomData; | 2 | use core::marker::PhantomData; |
| 3 | use core::slice; | 3 | use core::slice; |
| 4 | use core::sync::atomic::{AtomicU8, Ordering}; | 4 | use core::sync::atomic::{AtomicU8, Ordering}; |
| @@ -14,7 +14,7 @@ use crate::gpio::{AnyPin, SealedPin}; | |||
| 14 | use crate::interrupt::typelevel::Binding; | 14 | use crate::interrupt::typelevel::Binding; |
| 15 | use crate::pac::uart::Uart as Regs; | 15 | use crate::pac::uart::Uart as Regs; |
| 16 | use crate::uart::{Config, ConfigError, CtsPin, Error, Info, Instance, RtsPin, RxPin, State, TxPin}; | 16 | use crate::uart::{Config, ConfigError, CtsPin, Error, Info, Instance, RtsPin, RxPin, State, TxPin}; |
| 17 | use crate::{interrupt, Peri}; | 17 | use crate::{Peri, interrupt}; |
| 18 | 18 | ||
| 19 | /// Interrupt handler. | 19 | /// Interrupt handler. |
| 20 | pub struct BufferedInterruptHandler<T: Instance> { | 20 | pub struct BufferedInterruptHandler<T: Instance> { |
diff --git a/embassy-mspm0/src/uart/mod.rs b/embassy-mspm0/src/uart/mod.rs index 6599cea06..03e68d297 100644 --- a/embassy-mspm0/src/uart/mod.rs +++ b/embassy-mspm0/src/uart/mod.rs | |||
| @@ -3,17 +3,17 @@ | |||
| 3 | mod buffered; | 3 | mod buffered; |
| 4 | 4 | ||
| 5 | use core::marker::PhantomData; | 5 | use core::marker::PhantomData; |
| 6 | use core::sync::atomic::{compiler_fence, AtomicU32, Ordering}; | 6 | use core::sync::atomic::{AtomicU32, Ordering, compiler_fence}; |
| 7 | 7 | ||
| 8 | pub use buffered::*; | 8 | pub use buffered::*; |
| 9 | use embassy_embedded_hal::SetConfig; | 9 | use embassy_embedded_hal::SetConfig; |
| 10 | use embassy_hal_internal::PeripheralType; | 10 | use embassy_hal_internal::PeripheralType; |
| 11 | 11 | ||
| 12 | use crate::Peri; | ||
| 12 | use crate::gpio::{AnyPin, PfType, Pull, SealedPin}; | 13 | use crate::gpio::{AnyPin, PfType, Pull, SealedPin}; |
| 13 | use crate::interrupt::{Interrupt, InterruptExt}; | 14 | use crate::interrupt::{Interrupt, InterruptExt}; |
| 14 | use crate::mode::{Blocking, Mode}; | 15 | use crate::mode::{Blocking, Mode}; |
| 15 | use crate::pac::uart::{vals, Uart as Regs}; | 16 | use crate::pac::uart::{Uart as Regs, vals}; |
| 16 | use crate::Peri; | ||
| 17 | 17 | ||
| 18 | /// The clock source for the UART. | 18 | /// The clock source for the UART. |
| 19 | #[derive(Clone, Copy, PartialEq, Eq, Debug)] | 19 | #[derive(Clone, Copy, PartialEq, Eq, Debug)] |
| @@ -931,8 +931,7 @@ fn set_baudrate_inner(regs: Regs, clock: u32, baudrate: u32) -> Result<(), Confi | |||
| 931 | let Some(min_clock) = baudrate.checked_mul(oversampling as u32) else { | 931 | let Some(min_clock) = baudrate.checked_mul(oversampling as u32) else { |
| 932 | trace!( | 932 | trace!( |
| 933 | "{}x oversampling would cause overflow for clock: {} Hz", | 933 | "{}x oversampling would cause overflow for clock: {} Hz", |
| 934 | oversampling, | 934 | oversampling, clock |
| 935 | clock | ||
| 936 | ); | 935 | ); |
| 937 | continue; | 936 | continue; |
| 938 | }; | 937 | }; |
| @@ -945,9 +944,7 @@ fn set_baudrate_inner(regs: Regs, clock: u32, baudrate: u32) -> Result<(), Confi | |||
| 945 | for &(div, div_value) in &DIVS { | 944 | for &(div, div_value) in &DIVS { |
| 946 | trace!( | 945 | trace!( |
| 947 | "Trying div: {}, oversampling {} for {} baud", | 946 | "Trying div: {}, oversampling {} for {} baud", |
| 948 | div, | 947 | div, oversampling, baudrate |
| 949 | oversampling, | ||
| 950 | baudrate | ||
| 951 | ); | 948 | ); |
| 952 | 949 | ||
| 953 | let Some((ibrd, fbrd)) = calculate_brd(clock, div, baudrate, oversampling) else { | 950 | let Some((ibrd, fbrd)) = calculate_brd(clock, div, baudrate, oversampling) else { |
diff --git a/embassy-mspm0/src/wwdt.rs b/embassy-mspm0/src/wwdt.rs index e5c62c660..92aeb8b40 100644 --- a/embassy-mspm0/src/wwdt.rs +++ b/embassy-mspm0/src/wwdt.rs | |||
| @@ -6,9 +6,9 @@ | |||
| 6 | 6 | ||
| 7 | use embassy_hal_internal::PeripheralType; | 7 | use embassy_hal_internal::PeripheralType; |
| 8 | 8 | ||
| 9 | use crate::pac::wwdt::{vals, Wwdt as Regs}; | ||
| 10 | use crate::pac::{self}; | ||
| 11 | use crate::Peri; | 9 | use crate::Peri; |
| 10 | use crate::pac::wwdt::{Wwdt as Regs, vals}; | ||
| 11 | use crate::pac::{self}; | ||
| 12 | 12 | ||
| 13 | /// Possible watchdog timeout values. | 13 | /// Possible watchdog timeout values. |
| 14 | #[derive(Clone, Copy, PartialEq, Eq, Debug)] | 14 | #[derive(Clone, Copy, PartialEq, Eq, Debug)] |
diff --git a/embassy-net-adin1110/src/crc8.rs b/embassy-net-adin1110/src/crc8.rs index 321983e64..a51353aab 100644 --- a/embassy-net-adin1110/src/crc8.rs +++ b/embassy-net-adin1110/src/crc8.rs | |||
| @@ -23,7 +23,7 @@ pub fn crc8(data: &[u8]) -> u8 { | |||
| 23 | 23 | ||
| 24 | #[cfg(test)] | 24 | #[cfg(test)] |
| 25 | mod tests { | 25 | mod tests { |
| 26 | use ::crc::{Crc, CRC_8_SMBUS}; | 26 | use ::crc::{CRC_8_SMBUS, Crc}; |
| 27 | 27 | ||
| 28 | use super::crc8; | 28 | use super::crc8; |
| 29 | 29 | ||
diff --git a/embassy-net-adin1110/src/lib.rs b/embassy-net-adin1110/src/lib.rs index 7f1c772e2..90ac242bd 100644 --- a/embassy-net-adin1110/src/lib.rs +++ b/embassy-net-adin1110/src/lib.rs | |||
| @@ -17,9 +17,9 @@ mod phy; | |||
| 17 | mod regs; | 17 | mod regs; |
| 18 | 18 | ||
| 19 | use ch::driver::LinkState; | 19 | use ch::driver::LinkState; |
| 20 | pub use crc32::ETH_FCS; | ||
| 21 | use crc8::crc8; | 20 | use crc8::crc8; |
| 22 | use embassy_futures::select::{select, Either}; | 21 | pub use crc32::ETH_FCS; |
| 22 | use embassy_futures::select::{Either, select}; | ||
| 23 | use embassy_net_driver_channel as ch; | 23 | use embassy_net_driver_channel as ch; |
| 24 | use embassy_time::Timer; | 24 | use embassy_time::Timer; |
| 25 | use embedded_hal_1::digital::OutputPin; | 25 | use embedded_hal_1::digital::OutputPin; |
diff --git a/embassy-net-driver-channel/src/lib.rs b/embassy-net-driver-channel/src/lib.rs index 600efd9e5..d0a14aa52 100644 --- a/embassy-net-driver-channel/src/lib.rs +++ b/embassy-net-driver-channel/src/lib.rs | |||
| @@ -11,8 +11,8 @@ use core::task::{Context, Poll}; | |||
| 11 | 11 | ||
| 12 | pub use embassy_net_driver as driver; | 12 | pub use embassy_net_driver as driver; |
| 13 | use embassy_net_driver::{Capabilities, LinkState}; | 13 | use embassy_net_driver::{Capabilities, LinkState}; |
| 14 | use embassy_sync::blocking_mutex::raw::NoopRawMutex; | ||
| 15 | use embassy_sync::blocking_mutex::Mutex; | 14 | use embassy_sync::blocking_mutex::Mutex; |
| 15 | use embassy_sync::blocking_mutex::raw::NoopRawMutex; | ||
| 16 | use embassy_sync::waitqueue::WakerRegistration; | 16 | use embassy_sync::waitqueue::WakerRegistration; |
| 17 | use embassy_sync::zerocopy_channel; | 17 | use embassy_sync::zerocopy_channel; |
| 18 | 18 | ||
diff --git a/embassy-net-esp-hosted/src/control.rs b/embassy-net-esp-hosted/src/control.rs index b1838a425..cbc194877 100644 --- a/embassy-net-esp-hosted/src/control.rs +++ b/embassy-net-esp-hosted/src/control.rs | |||
| @@ -65,8 +65,7 @@ macro_rules! ioctl { | |||
| 65 | }; | 65 | }; |
| 66 | $self.ioctl(&mut msg).await?; | 66 | $self.ioctl(&mut msg).await?; |
| 67 | #[allow(unused_mut)] | 67 | #[allow(unused_mut)] |
| 68 | let Some(proto::CtrlMsgPayload::$resp_variant(mut $resp)) = msg.payload | 68 | let Some(proto::CtrlMsgPayload::$resp_variant(mut $resp)) = msg.payload else { |
| 69 | else { | ||
| 70 | warn!("unexpected response variant"); | 69 | warn!("unexpected response variant"); |
| 71 | return Err(Error::Internal); | 70 | return Err(Error::Internal); |
| 72 | }; | 71 | }; |
diff --git a/embassy-net-esp-hosted/src/ioctl.rs b/embassy-net-esp-hosted/src/ioctl.rs index 512023206..a516f80c7 100644 --- a/embassy-net-esp-hosted/src/ioctl.rs +++ b/embassy-net-esp-hosted/src/ioctl.rs | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | use core::cell::RefCell; | 1 | use core::cell::RefCell; |
| 2 | use core::future::{poll_fn, Future}; | 2 | use core::future::{Future, poll_fn}; |
| 3 | use core::task::Poll; | 3 | use core::task::Poll; |
| 4 | 4 | ||
| 5 | use embassy_sync::waitqueue::WakerRegistration; | 5 | use embassy_sync::waitqueue::WakerRegistration; |
diff --git a/embassy-net-esp-hosted/src/lib.rs b/embassy-net-esp-hosted/src/lib.rs index f05e2a70a..4405d9f77 100644 --- a/embassy-net-esp-hosted/src/lib.rs +++ b/embassy-net-esp-hosted/src/lib.rs | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | #![doc = include_str!("../README.md")] | 2 | #![doc = include_str!("../README.md")] |
| 3 | #![warn(missing_docs)] | 3 | #![warn(missing_docs)] |
| 4 | 4 | ||
| 5 | use embassy_futures::select::{select4, Either4}; | 5 | use embassy_futures::select::{Either4, select4}; |
| 6 | use embassy_net_driver_channel as ch; | 6 | use embassy_net_driver_channel as ch; |
| 7 | use embassy_net_driver_channel::driver::LinkState; | 7 | use embassy_net_driver_channel::driver::LinkState; |
| 8 | use embassy_time::{Duration, Instant, Timer}; | 8 | use embassy_time::{Duration, Instant, Timer}; |
diff --git a/embassy-net-nrf91/src/lib.rs b/embassy-net-nrf91/src/lib.rs index 8778b65ab..dd4812aae 100644 --- a/embassy-net-nrf91/src/lib.rs +++ b/embassy-net-nrf91/src/lib.rs | |||
| @@ -10,12 +10,12 @@ mod fmt; | |||
| 10 | pub mod context; | 10 | pub mod context; |
| 11 | 11 | ||
| 12 | use core::cell::RefCell; | 12 | use core::cell::RefCell; |
| 13 | use core::future::{poll_fn, Future}; | 13 | use core::future::{Future, poll_fn}; |
| 14 | use core::marker::PhantomData; | 14 | use core::marker::PhantomData; |
| 15 | use core::mem::{self, MaybeUninit}; | 15 | use core::mem::{self, MaybeUninit}; |
| 16 | use core::ptr::{self, addr_of, addr_of_mut, copy_nonoverlapping}; | 16 | use core::ptr::{self, addr_of, addr_of_mut, copy_nonoverlapping}; |
| 17 | use core::slice; | 17 | use core::slice; |
| 18 | use core::sync::atomic::{compiler_fence, fence, Ordering}; | 18 | use core::sync::atomic::{Ordering, compiler_fence, fence}; |
| 19 | use core::task::{Poll, Waker}; | 19 | use core::task::{Poll, Waker}; |
| 20 | 20 | ||
| 21 | use cortex_m::peripheral::NVIC; | 21 | use cortex_m::peripheral::NVIC; |
| @@ -140,9 +140,7 @@ async fn new_internal<'a>( | |||
| 140 | debug!("Setting IPC RAM as nonsecure..."); | 140 | debug!("Setting IPC RAM as nonsecure..."); |
| 141 | trace!( | 141 | trace!( |
| 142 | " SPU_REGION_SIZE={}, shmem_ptr=0x{:08X}, shmem_len={}", | 142 | " SPU_REGION_SIZE={}, shmem_ptr=0x{:08X}, shmem_len={}", |
| 143 | SPU_REGION_SIZE, | 143 | SPU_REGION_SIZE, shmem_ptr as usize, shmem_len |
| 144 | shmem_ptr as usize, | ||
| 145 | shmem_len | ||
| 146 | ); | 144 | ); |
| 147 | let region_start = (shmem_ptr as usize - 0x2000_0000) / SPU_REGION_SIZE; | 145 | let region_start = (shmem_ptr as usize - 0x2000_0000) / SPU_REGION_SIZE; |
| 148 | let region_end = region_start + shmem_len / SPU_REGION_SIZE; | 146 | let region_end = region_start + shmem_len / SPU_REGION_SIZE; |
| @@ -166,8 +164,7 @@ async fn new_internal<'a>( | |||
| 166 | }; | 164 | }; |
| 167 | trace!( | 165 | trace!( |
| 168 | " Allocator: start=0x{:08X}, end=0x{:08X}", | 166 | " Allocator: start=0x{:08X}, end=0x{:08X}", |
| 169 | alloc.start as usize, | 167 | alloc.start as usize, alloc.end as usize |
| 170 | alloc.end as usize | ||
| 171 | ); | 168 | ); |
| 172 | 169 | ||
| 173 | let cb: &mut ControlBlock = alloc.alloc().write(unsafe { mem::zeroed() }); | 170 | let cb: &mut ControlBlock = alloc.alloc().write(unsafe { mem::zeroed() }); |
diff --git a/embassy-net-ppp/src/lib.rs b/embassy-net-ppp/src/lib.rs index 54a98c95f..ab42ecd26 100644 --- a/embassy-net-ppp/src/lib.rs +++ b/embassy-net-ppp/src/lib.rs | |||
| @@ -8,7 +8,7 @@ mod fmt; | |||
| 8 | use core::convert::Infallible; | 8 | use core::convert::Infallible; |
| 9 | use core::mem::MaybeUninit; | 9 | use core::mem::MaybeUninit; |
| 10 | 10 | ||
| 11 | use embassy_futures::select::{select, Either}; | 11 | use embassy_futures::select::{Either, select}; |
| 12 | use embassy_net_driver_channel as ch; | 12 | use embassy_net_driver_channel as ch; |
| 13 | use embassy_net_driver_channel::driver::LinkState; | 13 | use embassy_net_driver_channel::driver::LinkState; |
| 14 | use embedded_io_async::{BufRead, Write}; | 14 | use embedded_io_async::{BufRead, Write}; |
diff --git a/embassy-net-wiznet/src/chip/mod.rs b/embassy-net-wiznet/src/chip/mod.rs index 47d7c5dc3..04346bb21 100644 --- a/embassy-net-wiznet/src/chip/mod.rs +++ b/embassy-net-wiznet/src/chip/mod.rs | |||
| @@ -43,7 +43,7 @@ pub(crate) trait SealedChip { | |||
| 43 | fn tx_addr(addr: u16) -> Self::Address; | 43 | fn tx_addr(addr: u16) -> Self::Address; |
| 44 | 44 | ||
| 45 | async fn bus_read<SPI: SpiDevice>(spi: &mut SPI, address: Self::Address, data: &mut [u8]) | 45 | async fn bus_read<SPI: SpiDevice>(spi: &mut SPI, address: Self::Address, data: &mut [u8]) |
| 46 | -> Result<(), SPI::Error>; | 46 | -> Result<(), SPI::Error>; |
| 47 | async fn bus_write<SPI: SpiDevice>(spi: &mut SPI, address: Self::Address, data: &[u8]) -> Result<(), SPI::Error>; | 47 | async fn bus_write<SPI: SpiDevice>(spi: &mut SPI, address: Self::Address, data: &[u8]) -> Result<(), SPI::Error>; |
| 48 | } | 48 | } |
| 49 | 49 | ||
diff --git a/embassy-net-wiznet/src/lib.rs b/embassy-net-wiznet/src/lib.rs index 3fbd4c741..30a5db9f6 100644 --- a/embassy-net-wiznet/src/lib.rs +++ b/embassy-net-wiznet/src/lib.rs | |||
| @@ -6,7 +6,7 @@ | |||
| 6 | pub mod chip; | 6 | pub mod chip; |
| 7 | mod device; | 7 | mod device; |
| 8 | 8 | ||
| 9 | use embassy_futures::select::{select3, Either3}; | 9 | use embassy_futures::select::{Either3, select3}; |
| 10 | use embassy_net_driver_channel as ch; | 10 | use embassy_net_driver_channel as ch; |
| 11 | use embassy_net_driver_channel::driver::LinkState; | 11 | use embassy_net_driver_channel::driver::LinkState; |
| 12 | use embassy_time::{Duration, Ticker, Timer}; | 12 | use embassy_time::{Duration, Ticker, Timer}; |
diff --git a/embassy-net/src/icmp.rs b/embassy-net/src/icmp.rs index 22c31a589..09e91a1ae 100644 --- a/embassy-net/src/icmp.rs +++ b/embassy-net/src/icmp.rs | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | //! ICMP sockets. | 1 | //! ICMP sockets. |
| 2 | 2 | ||
| 3 | use core::future::{poll_fn, Future}; | 3 | use core::future::{Future, poll_fn}; |
| 4 | use core::mem; | 4 | use core::mem; |
| 5 | use core::task::{Context, Poll}; | 5 | use core::task::{Context, Poll}; |
| 6 | 6 | ||
diff --git a/embassy-net/src/lib.rs b/embassy-net/src/lib.rs index f701f8add..a49955c96 100644 --- a/embassy-net/src/lib.rs +++ b/embassy-net/src/lib.rs | |||
| @@ -27,7 +27,7 @@ mod time; | |||
| 27 | pub mod udp; | 27 | pub mod udp; |
| 28 | 28 | ||
| 29 | use core::cell::RefCell; | 29 | use core::cell::RefCell; |
| 30 | use core::future::{poll_fn, Future}; | 30 | use core::future::{Future, poll_fn}; |
| 31 | use core::mem::MaybeUninit; | 31 | use core::mem::MaybeUninit; |
| 32 | use core::pin::pin; | 32 | use core::pin::pin; |
| 33 | use core::task::{Context, Poll}; | 33 | use core::task::{Context, Poll}; |
diff --git a/embassy-net/src/raw.rs b/embassy-net/src/raw.rs index c9f753f13..89d2dd350 100644 --- a/embassy-net/src/raw.rs +++ b/embassy-net/src/raw.rs | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | //! Raw sockets. | 1 | //! Raw sockets. |
| 2 | 2 | ||
| 3 | use core::future::{poll_fn, Future}; | 3 | use core::future::{Future, poll_fn}; |
| 4 | use core::mem; | 4 | use core::mem; |
| 5 | use core::task::{Context, Poll}; | 5 | use core::task::{Context, Poll}; |
| 6 | 6 | ||
diff --git a/embassy-net/src/tcp.rs b/embassy-net/src/tcp.rs index d0230b581..6792c5526 100644 --- a/embassy-net/src/tcp.rs +++ b/embassy-net/src/tcp.rs | |||
| @@ -8,7 +8,7 @@ | |||
| 8 | //! Incoming connections when no socket is listening are rejected. To accept many incoming | 8 | //! Incoming connections when no socket is listening are rejected. To accept many incoming |
| 9 | //! connections, create many sockets and put them all into listening mode. | 9 | //! connections, create many sockets and put them all into listening mode. |
| 10 | 10 | ||
| 11 | use core::future::{poll_fn, Future}; | 11 | use core::future::{Future, poll_fn}; |
| 12 | use core::mem; | 12 | use core::mem; |
| 13 | use core::task::{Context, Poll}; | 13 | use core::task::{Context, Poll}; |
| 14 | 14 | ||
| @@ -18,8 +18,8 @@ use smoltcp::socket::tcp; | |||
| 18 | pub use smoltcp::socket::tcp::State; | 18 | pub use smoltcp::socket::tcp::State; |
| 19 | use smoltcp::wire::{IpEndpoint, IpListenEndpoint}; | 19 | use smoltcp::wire::{IpEndpoint, IpListenEndpoint}; |
| 20 | 20 | ||
| 21 | use crate::time::duration_to_smoltcp; | ||
| 22 | use crate::Stack; | 21 | use crate::Stack; |
| 22 | use crate::time::duration_to_smoltcp; | ||
| 23 | 23 | ||
| 24 | /// Error returned by TcpSocket read/write functions. | 24 | /// Error returned by TcpSocket read/write functions. |
| 25 | #[derive(PartialEq, Eq, Clone, Copy, Debug)] | 25 | #[derive(PartialEq, Eq, Clone, Copy, Debug)] |
diff --git a/embassy-net/src/udp.rs b/embassy-net/src/udp.rs index 482eb0e56..448c25ecc 100644 --- a/embassy-net/src/udp.rs +++ b/embassy-net/src/udp.rs | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | //! UDP sockets. | 1 | //! UDP sockets. |
| 2 | 2 | ||
| 3 | use core::future::{poll_fn, Future}; | 3 | use core::future::{Future, poll_fn}; |
| 4 | use core::mem; | 4 | use core::mem; |
| 5 | use core::task::{Context, Poll}; | 5 | use core::task::{Context, Poll}; |
| 6 | 6 | ||
diff --git a/embassy-nrf/src/buffered_uarte.rs b/embassy-nrf/src/buffered_uarte.rs index 40c679190..4c946497d 100644 --- a/embassy-nrf/src/buffered_uarte.rs +++ b/embassy-nrf/src/buffered_uarte.rs | |||
| @@ -9,27 +9,27 @@ | |||
| 9 | //! Please also see [crate::uarte] to understand when [BufferedUarte] should be used. | 9 | //! Please also see [crate::uarte] to understand when [BufferedUarte] should be used. |
| 10 | 10 | ||
| 11 | use core::cmp::min; | 11 | use core::cmp::min; |
| 12 | use core::future::{poll_fn, Future}; | 12 | use core::future::{Future, poll_fn}; |
| 13 | use core::marker::PhantomData; | 13 | use core::marker::PhantomData; |
| 14 | use core::slice; | 14 | use core::slice; |
| 15 | use core::sync::atomic::{compiler_fence, AtomicBool, AtomicU8, AtomicUsize, Ordering}; | 15 | use core::sync::atomic::{AtomicBool, AtomicU8, AtomicUsize, Ordering, compiler_fence}; |
| 16 | use core::task::Poll; | 16 | use core::task::Poll; |
| 17 | 17 | ||
| 18 | use embassy_hal_internal::atomic_ring_buffer::RingBuffer; | ||
| 19 | use embassy_hal_internal::Peri; | 18 | use embassy_hal_internal::Peri; |
| 19 | use embassy_hal_internal::atomic_ring_buffer::RingBuffer; | ||
| 20 | use pac::uarte::vals; | 20 | use pac::uarte::vals; |
| 21 | // Re-export SVD variants to allow user to directly set values | 21 | // Re-export SVD variants to allow user to directly set values |
| 22 | pub use pac::uarte::vals::{Baudrate, ConfigParity as Parity}; | 22 | pub use pac::uarte::vals::{Baudrate, ConfigParity as Parity}; |
| 23 | 23 | ||
| 24 | use crate::gpio::{AnyPin, Pin as GpioPin}; | 24 | use crate::gpio::{AnyPin, Pin as GpioPin}; |
| 25 | use crate::interrupt::typelevel::Interrupt; | ||
| 26 | use crate::interrupt::InterruptExt; | 25 | use crate::interrupt::InterruptExt; |
| 26 | use crate::interrupt::typelevel::Interrupt; | ||
| 27 | use crate::ppi::{ | 27 | use crate::ppi::{ |
| 28 | self, AnyConfigurableChannel, AnyGroup, Channel, ConfigurableChannel, Event, Group, Ppi, PpiGroup, Task, | 28 | self, AnyConfigurableChannel, AnyGroup, Channel, ConfigurableChannel, Event, Group, Ppi, PpiGroup, Task, |
| 29 | }; | 29 | }; |
| 30 | use crate::timer::{Instance as TimerInstance, Timer}; | 30 | use crate::timer::{Instance as TimerInstance, Timer}; |
| 31 | use crate::uarte::{configure, configure_rx_pins, configure_tx_pins, drop_tx_rx, Config, Instance as UarteInstance}; | 31 | use crate::uarte::{Config, Instance as UarteInstance, configure, configure_rx_pins, configure_tx_pins, drop_tx_rx}; |
| 32 | use crate::{interrupt, pac, EASY_DMA_SIZE}; | 32 | use crate::{EASY_DMA_SIZE, interrupt, pac}; |
| 33 | 33 | ||
| 34 | pub(crate) struct State { | 34 | pub(crate) struct State { |
| 35 | tx_buf: RingBuffer, | 35 | tx_buf: RingBuffer, |
diff --git a/embassy-nrf/src/egu.rs b/embassy-nrf/src/egu.rs index f7372fca1..666986115 100644 --- a/embassy-nrf/src/egu.rs +++ b/embassy-nrf/src/egu.rs | |||
| @@ -10,7 +10,7 @@ use core::marker::PhantomData; | |||
| 10 | use embassy_hal_internal::PeripheralType; | 10 | use embassy_hal_internal::PeripheralType; |
| 11 | 11 | ||
| 12 | use crate::ppi::{Event, Task}; | 12 | use crate::ppi::{Event, Task}; |
| 13 | use crate::{interrupt, pac, Peri}; | 13 | use crate::{Peri, interrupt, pac}; |
| 14 | 14 | ||
| 15 | /// An instance of the EGU. | 15 | /// An instance of the EGU. |
| 16 | pub struct Egu<'d> { | 16 | pub struct Egu<'d> { |
diff --git a/embassy-nrf/src/embassy_net_802154_driver.rs b/embassy-nrf/src/embassy_net_802154_driver.rs index b3fc5df2c..4c47b7cbd 100644 --- a/embassy-nrf/src/embassy_net_802154_driver.rs +++ b/embassy-nrf/src/embassy_net_802154_driver.rs | |||
| @@ -1,12 +1,12 @@ | |||
| 1 | //! embassy-net IEEE 802.15.4 driver | 1 | //! embassy-net IEEE 802.15.4 driver |
| 2 | 2 | ||
| 3 | use embassy_futures::select::{select3, Either3}; | 3 | use embassy_futures::select::{Either3, select3}; |
| 4 | use embassy_net_driver_channel::driver::LinkState; | 4 | use embassy_net_driver_channel::driver::LinkState; |
| 5 | use embassy_net_driver_channel::{self as ch}; | 5 | use embassy_net_driver_channel::{self as ch}; |
| 6 | use embassy_time::{Duration, Ticker}; | 6 | use embassy_time::{Duration, Ticker}; |
| 7 | 7 | ||
| 8 | use crate::radio::ieee802154::{Packet, Radio}; | ||
| 9 | use crate::radio::InterruptHandler; | 8 | use crate::radio::InterruptHandler; |
| 9 | use crate::radio::ieee802154::{Packet, Radio}; | ||
| 10 | use crate::{self as nrf, interrupt}; | 10 | use crate::{self as nrf, interrupt}; |
| 11 | 11 | ||
| 12 | /// MTU for the nrf radio. | 12 | /// MTU for the nrf radio. |
diff --git a/embassy-nrf/src/gpio.rs b/embassy-nrf/src/gpio.rs index ab5e7ed4b..7ed3a7927 100644 --- a/embassy-nrf/src/gpio.rs +++ b/embassy-nrf/src/gpio.rs | |||
| @@ -5,10 +5,10 @@ use core::convert::Infallible; | |||
| 5 | use core::hint::unreachable_unchecked; | 5 | use core::hint::unreachable_unchecked; |
| 6 | 6 | ||
| 7 | use cfg_if::cfg_if; | 7 | use cfg_if::cfg_if; |
| 8 | use embassy_hal_internal::{impl_peripheral, Peri, PeripheralType}; | 8 | use embassy_hal_internal::{Peri, PeripheralType, impl_peripheral}; |
| 9 | 9 | ||
| 10 | use crate::pac; | 10 | use crate::pac; |
| 11 | use crate::pac::common::{Reg, RW}; | 11 | use crate::pac::common::{RW, Reg}; |
| 12 | use crate::pac::gpio; | 12 | use crate::pac::gpio; |
| 13 | use crate::pac::gpio::vals; | 13 | use crate::pac::gpio::vals; |
| 14 | #[cfg(not(feature = "_nrf51"))] | 14 | #[cfg(not(feature = "_nrf51"))] |
diff --git a/embassy-nrf/src/gpiote.rs b/embassy-nrf/src/gpiote.rs index 43e43f0bf..a490d5b60 100644 --- a/embassy-nrf/src/gpiote.rs +++ b/embassy-nrf/src/gpiote.rs | |||
| @@ -1,10 +1,10 @@ | |||
| 1 | //! GPIO task/event (GPIOTE) driver. | 1 | //! GPIO task/event (GPIOTE) driver. |
| 2 | 2 | ||
| 3 | use core::convert::Infallible; | 3 | use core::convert::Infallible; |
| 4 | use core::future::{poll_fn, Future}; | 4 | use core::future::{Future, poll_fn}; |
| 5 | use core::task::{Context, Poll}; | 5 | use core::task::{Context, Poll}; |
| 6 | 6 | ||
| 7 | use embassy_hal_internal::{impl_peripheral, Peri, PeripheralType}; | 7 | use embassy_hal_internal::{Peri, PeripheralType, impl_peripheral}; |
| 8 | use embassy_sync::waitqueue::AtomicWaker; | 8 | use embassy_sync::waitqueue::AtomicWaker; |
| 9 | 9 | ||
| 10 | use crate::gpio::{AnyPin, Flex, Input, Output, Pin as GpioPin, SealedPin as _}; | 10 | use crate::gpio::{AnyPin, Flex, Input, Output, Pin as GpioPin, SealedPin as _}; |
diff --git a/embassy-nrf/src/i2s.rs b/embassy-nrf/src/i2s.rs index 1bfa18491..9cce9f1e8 100644 --- a/embassy-nrf/src/i2s.rs +++ b/embassy-nrf/src/i2s.rs | |||
| @@ -6,7 +6,7 @@ use core::future::poll_fn; | |||
| 6 | use core::marker::PhantomData; | 6 | use core::marker::PhantomData; |
| 7 | use core::mem::size_of; | 7 | use core::mem::size_of; |
| 8 | use core::ops::{Deref, DerefMut}; | 8 | use core::ops::{Deref, DerefMut}; |
| 9 | use core::sync::atomic::{compiler_fence, AtomicBool, Ordering}; | 9 | use core::sync::atomic::{AtomicBool, Ordering, compiler_fence}; |
| 10 | use core::task::Poll; | 10 | use core::task::Poll; |
| 11 | 11 | ||
| 12 | use embassy_hal_internal::drop::OnDrop; | 12 | use embassy_hal_internal::drop::OnDrop; |
| @@ -17,7 +17,7 @@ use crate::gpio::{AnyPin, Pin as GpioPin, PselBits}; | |||
| 17 | use crate::interrupt::typelevel::Interrupt; | 17 | use crate::interrupt::typelevel::Interrupt; |
| 18 | use crate::pac::i2s::vals; | 18 | use crate::pac::i2s::vals; |
| 19 | use crate::util::slice_in_ram_or; | 19 | use crate::util::slice_in_ram_or; |
| 20 | use crate::{interrupt, pac, EASY_DMA_SIZE}; | 20 | use crate::{EASY_DMA_SIZE, interrupt, pac}; |
| 21 | 21 | ||
| 22 | /// Type alias for `MultiBuffering` with 2 buffers. | 22 | /// Type alias for `MultiBuffering` with 2 buffers. |
| 23 | pub type DoubleBuffering<S, const NS: usize> = MultiBuffering<S, 2, NS>; | 23 | pub type DoubleBuffering<S, const NS: usize> = MultiBuffering<S, 2, NS>; |
diff --git a/embassy-nrf/src/lib.rs b/embassy-nrf/src/lib.rs index 7a0714cc0..1b7fb7e7f 100644 --- a/embassy-nrf/src/lib.rs +++ b/embassy-nrf/src/lib.rs | |||
| @@ -285,7 +285,7 @@ macro_rules! bind_interrupts { | |||
| 285 | pub use chip::pac; | 285 | pub use chip::pac; |
| 286 | #[cfg(not(feature = "unstable-pac"))] | 286 | #[cfg(not(feature = "unstable-pac"))] |
| 287 | pub(crate) use chip::pac; | 287 | pub(crate) use chip::pac; |
| 288 | pub use chip::{peripherals, Peripherals, EASY_DMA_SIZE}; | 288 | pub use chip::{EASY_DMA_SIZE, Peripherals, peripherals}; |
| 289 | pub use embassy_hal_internal::{Peri, PeripheralType}; | 289 | pub use embassy_hal_internal::{Peri, PeripheralType}; |
| 290 | 290 | ||
| 291 | pub use crate::chip::interrupt; | 291 | pub use crate::chip::interrupt; |
diff --git a/embassy-nrf/src/nfct.rs b/embassy-nrf/src/nfct.rs index 8d70ec954..bfbdc2906 100644 --- a/embassy-nrf/src/nfct.rs +++ b/embassy-nrf/src/nfct.rs | |||
| @@ -10,18 +10,18 @@ | |||
| 10 | #![macro_use] | 10 | #![macro_use] |
| 11 | 11 | ||
| 12 | use core::future::poll_fn; | 12 | use core::future::poll_fn; |
| 13 | use core::sync::atomic::{compiler_fence, Ordering}; | 13 | use core::sync::atomic::{Ordering, compiler_fence}; |
| 14 | use core::task::Poll; | 14 | use core::task::Poll; |
| 15 | 15 | ||
| 16 | use embassy_sync::waitqueue::AtomicWaker; | 16 | use embassy_sync::waitqueue::AtomicWaker; |
| 17 | pub use vals::{Bitframesdd as SddPat, Discardmode as DiscardMode}; | 17 | pub use vals::{Bitframesdd as SddPat, Discardmode as DiscardMode}; |
| 18 | 18 | ||
| 19 | use crate::interrupt::InterruptExt; | 19 | use crate::interrupt::InterruptExt; |
| 20 | use crate::pac::nfct::vals; | ||
| 21 | use crate::pac::NFCT; | 20 | use crate::pac::NFCT; |
| 21 | use crate::pac::nfct::vals; | ||
| 22 | use crate::peripherals::NFCT; | 22 | use crate::peripherals::NFCT; |
| 23 | use crate::util::slice_in_ram; | 23 | use crate::util::slice_in_ram; |
| 24 | use crate::{interrupt, pac, Peri}; | 24 | use crate::{Peri, interrupt, pac}; |
| 25 | 25 | ||
| 26 | /// NFCID1 (aka UID) of different sizes. | 26 | /// NFCID1 (aka UID) of different sizes. |
| 27 | #[derive(Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)] | 27 | #[derive(Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)] |
diff --git a/embassy-nrf/src/nvmc.rs b/embassy-nrf/src/nvmc.rs index c46af0b34..3f38cd0f5 100644 --- a/embassy-nrf/src/nvmc.rs +++ b/embassy-nrf/src/nvmc.rs | |||
| @@ -8,7 +8,7 @@ use embedded_storage::nor_flash::{ | |||
| 8 | 8 | ||
| 9 | use crate::pac::nvmc::vals; | 9 | use crate::pac::nvmc::vals; |
| 10 | use crate::peripherals::NVMC; | 10 | use crate::peripherals::NVMC; |
| 11 | use crate::{pac, Peri}; | 11 | use crate::{Peri, pac}; |
| 12 | 12 | ||
| 13 | #[cfg(not(feature = "_nrf5340-net"))] | 13 | #[cfg(not(feature = "_nrf5340-net"))] |
| 14 | /// Erase size of NVMC flash in bytes. | 14 | /// Erase size of NVMC flash in bytes. |
diff --git a/embassy-nrf/src/pdm.rs b/embassy-nrf/src/pdm.rs index b6ee52850..bc28f5c8a 100644 --- a/embassy-nrf/src/pdm.rs +++ b/embassy-nrf/src/pdm.rs | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | 4 | ||
| 5 | use core::future::poll_fn; | 5 | use core::future::poll_fn; |
| 6 | use core::marker::PhantomData; | 6 | use core::marker::PhantomData; |
| 7 | use core::sync::atomic::{compiler_fence, Ordering}; | 7 | use core::sync::atomic::{Ordering, compiler_fence}; |
| 8 | use core::task::Poll; | 8 | use core::task::Poll; |
| 9 | 9 | ||
| 10 | use embassy_hal_internal::drop::OnDrop; | 10 | use embassy_hal_internal::drop::OnDrop; |
| @@ -13,7 +13,7 @@ use embassy_sync::waitqueue::AtomicWaker; | |||
| 13 | use fixed::types::I7F1; | 13 | use fixed::types::I7F1; |
| 14 | 14 | ||
| 15 | use crate::chip::EASY_DMA_SIZE; | 15 | use crate::chip::EASY_DMA_SIZE; |
| 16 | use crate::gpio::{AnyPin, Pin as GpioPin, SealedPin, DISCONNECTED}; | 16 | use crate::gpio::{AnyPin, DISCONNECTED, Pin as GpioPin, SealedPin}; |
| 17 | use crate::interrupt::typelevel::Interrupt; | 17 | use crate::interrupt::typelevel::Interrupt; |
| 18 | use crate::pac::gpio::vals as gpiovals; | 18 | use crate::pac::gpio::vals as gpiovals; |
| 19 | use crate::pac::pdm::vals; | 19 | use crate::pac::pdm::vals; |
diff --git a/embassy-nrf/src/ppi/dppi.rs b/embassy-nrf/src/ppi/dppi.rs index 078d2fd1c..168647be3 100644 --- a/embassy-nrf/src/ppi/dppi.rs +++ b/embassy-nrf/src/ppi/dppi.rs | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | use super::{Channel, ConfigurableChannel, Event, Ppi, Task}; | 1 | use super::{Channel, ConfigurableChannel, Event, Ppi, Task}; |
| 2 | use crate::{pac, Peri}; | 2 | use crate::{Peri, pac}; |
| 3 | 3 | ||
| 4 | const DPPI_ENABLE_BIT: u32 = 0x8000_0000; | 4 | const DPPI_ENABLE_BIT: u32 = 0x8000_0000; |
| 5 | const DPPI_CHANNEL_MASK: u32 = 0x0000_00FF; | 5 | const DPPI_CHANNEL_MASK: u32 = 0x0000_00FF; |
diff --git a/embassy-nrf/src/ppi/mod.rs b/embassy-nrf/src/ppi/mod.rs index 2bcf72e9c..f30c2218d 100644 --- a/embassy-nrf/src/ppi/mod.rs +++ b/embassy-nrf/src/ppi/mod.rs | |||
| @@ -18,9 +18,9 @@ | |||
| 18 | use core::marker::PhantomData; | 18 | use core::marker::PhantomData; |
| 19 | use core::ptr::NonNull; | 19 | use core::ptr::NonNull; |
| 20 | 20 | ||
| 21 | use embassy_hal_internal::{impl_peripheral, Peri, PeripheralType}; | 21 | use embassy_hal_internal::{Peri, PeripheralType, impl_peripheral}; |
| 22 | 22 | ||
| 23 | use crate::pac::common::{Reg, RW, W}; | 23 | use crate::pac::common::{RW, Reg, W}; |
| 24 | use crate::peripherals; | 24 | use crate::peripherals; |
| 25 | 25 | ||
| 26 | #[cfg_attr(feature = "_dppi", path = "dppi.rs")] | 26 | #[cfg_attr(feature = "_dppi", path = "dppi.rs")] |
diff --git a/embassy-nrf/src/ppi/ppi.rs b/embassy-nrf/src/ppi/ppi.rs index 531c25444..18bc8b8db 100644 --- a/embassy-nrf/src/ppi/ppi.rs +++ b/embassy-nrf/src/ppi/ppi.rs | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | use super::{Channel, ConfigurableChannel, Event, Ppi, Task}; | 1 | use super::{Channel, ConfigurableChannel, Event, Ppi, Task}; |
| 2 | use crate::{pac, Peri}; | 2 | use crate::{Peri, pac}; |
| 3 | 3 | ||
| 4 | impl<'d> Task<'d> { | 4 | impl<'d> Task<'d> { |
| 5 | fn reg_val(&self) -> u32 { | 5 | fn reg_val(&self) -> u32 { |
diff --git a/embassy-nrf/src/pwm.rs b/embassy-nrf/src/pwm.rs index d67cb546b..e038f44b8 100644 --- a/embassy-nrf/src/pwm.rs +++ b/embassy-nrf/src/pwm.rs | |||
| @@ -2,11 +2,11 @@ | |||
| 2 | 2 | ||
| 3 | #![macro_use] | 3 | #![macro_use] |
| 4 | 4 | ||
| 5 | use core::sync::atomic::{compiler_fence, Ordering}; | 5 | use core::sync::atomic::{Ordering, compiler_fence}; |
| 6 | 6 | ||
| 7 | use embassy_hal_internal::{Peri, PeripheralType}; | 7 | use embassy_hal_internal::{Peri, PeripheralType}; |
| 8 | 8 | ||
| 9 | use crate::gpio::{convert_drive, AnyPin, OutputDrive, Pin as GpioPin, PselBits, SealedPin as _, DISCONNECTED}; | 9 | use crate::gpio::{AnyPin, DISCONNECTED, OutputDrive, Pin as GpioPin, PselBits, SealedPin as _, convert_drive}; |
| 10 | use crate::pac::gpio::vals as gpiovals; | 10 | use crate::pac::gpio::vals as gpiovals; |
| 11 | use crate::pac::pwm::vals; | 11 | use crate::pac::pwm::vals; |
| 12 | use crate::ppi::{Event, Task}; | 12 | use crate::ppi::{Event, Task}; |
diff --git a/embassy-nrf/src/qspi.rs b/embassy-nrf/src/qspi.rs index 6f4524716..6bb7c033e 100755 --- a/embassy-nrf/src/qspi.rs +++ b/embassy-nrf/src/qspi.rs | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | 2 | ||
| 3 | #![macro_use] | 3 | #![macro_use] |
| 4 | 4 | ||
| 5 | use core::future::{poll_fn, Future}; | 5 | use core::future::{Future, poll_fn}; |
| 6 | use core::marker::PhantomData; | 6 | use core::marker::PhantomData; |
| 7 | use core::ptr; | 7 | use core::ptr; |
| 8 | use core::task::Poll; | 8 | use core::task::Poll; |
diff --git a/embassy-nrf/src/radio/ieee802154.rs b/embassy-nrf/src/radio/ieee802154.rs index 844d3551e..54b463343 100644 --- a/embassy-nrf/src/radio/ieee802154.rs +++ b/embassy-nrf/src/radio/ieee802154.rs | |||
| @@ -1,18 +1,18 @@ | |||
| 1 | //! IEEE 802.15.4 radio driver | 1 | //! IEEE 802.15.4 radio driver |
| 2 | 2 | ||
| 3 | use core::marker::PhantomData; | 3 | use core::marker::PhantomData; |
| 4 | use core::sync::atomic::{compiler_fence, Ordering}; | 4 | use core::sync::atomic::{Ordering, compiler_fence}; |
| 5 | use core::task::Poll; | 5 | use core::task::Poll; |
| 6 | 6 | ||
| 7 | use embassy_hal_internal::drop::OnDrop; | 7 | use embassy_hal_internal::drop::OnDrop; |
| 8 | 8 | ||
| 9 | use super::{Error, InterruptHandler, TxPower}; | 9 | use super::{Error, InterruptHandler, TxPower}; |
| 10 | use crate::Peri; | ||
| 10 | use crate::interrupt::typelevel::Interrupt; | 11 | use crate::interrupt::typelevel::Interrupt; |
| 11 | use crate::interrupt::{self}; | 12 | use crate::interrupt::{self}; |
| 12 | use crate::pac::radio::vals; | 13 | use crate::pac::radio::vals; |
| 13 | pub use crate::pac::radio::vals::State as RadioState; | 14 | pub use crate::pac::radio::vals::State as RadioState; |
| 14 | use crate::radio::Instance; | 15 | use crate::radio::Instance; |
| 15 | use crate::Peri; | ||
| 16 | 16 | ||
| 17 | /// Default (IEEE compliant) Start of Frame Delimiter | 17 | /// Default (IEEE compliant) Start of Frame Delimiter |
| 18 | pub const DEFAULT_SFD: u8 = 0xA7; | 18 | pub const DEFAULT_SFD: u8 = 0xA7; |
diff --git a/embassy-nrf/src/rramc.rs b/embassy-nrf/src/rramc.rs index 7cb5660cb..521ac4ee7 100644 --- a/embassy-nrf/src/rramc.rs +++ b/embassy-nrf/src/rramc.rs | |||
| @@ -7,7 +7,7 @@ use embedded_storage::nor_flash::{ | |||
| 7 | }; | 7 | }; |
| 8 | 8 | ||
| 9 | use crate::peripherals::RRAMC; | 9 | use crate::peripherals::RRAMC; |
| 10 | use crate::{pac, Peri}; | 10 | use crate::{Peri, pac}; |
| 11 | 11 | ||
| 12 | // | 12 | // |
| 13 | // Export Nvmc alias and page size for downstream compatibility | 13 | // Export Nvmc alias and page size for downstream compatibility |
diff --git a/embassy-nrf/src/saadc.rs b/embassy-nrf/src/saadc.rs index fd48faabb..a199c1c4d 100644 --- a/embassy-nrf/src/saadc.rs +++ b/embassy-nrf/src/saadc.rs | |||
| @@ -4,11 +4,11 @@ | |||
| 4 | 4 | ||
| 5 | use core::future::poll_fn; | 5 | use core::future::poll_fn; |
| 6 | use core::marker::PhantomData; | 6 | use core::marker::PhantomData; |
| 7 | use core::sync::atomic::{compiler_fence, Ordering}; | 7 | use core::sync::atomic::{Ordering, compiler_fence}; |
| 8 | use core::task::Poll; | 8 | use core::task::Poll; |
| 9 | 9 | ||
| 10 | use embassy_hal_internal::drop::OnDrop; | 10 | use embassy_hal_internal::drop::OnDrop; |
| 11 | use embassy_hal_internal::{impl_peripheral, Peri}; | 11 | use embassy_hal_internal::{Peri, impl_peripheral}; |
| 12 | use embassy_sync::waitqueue::AtomicWaker; | 12 | use embassy_sync::waitqueue::AtomicWaker; |
| 13 | pub(crate) use vals::Psel as InputChannel; | 13 | pub(crate) use vals::Psel as InputChannel; |
| 14 | 14 | ||
diff --git a/embassy-nrf/src/spim.rs b/embassy-nrf/src/spim.rs index c410e49fd..ce994dbc9 100644 --- a/embassy-nrf/src/spim.rs +++ b/embassy-nrf/src/spim.rs | |||
| @@ -6,17 +6,17 @@ use core::future::poll_fn; | |||
| 6 | use core::marker::PhantomData; | 6 | use core::marker::PhantomData; |
| 7 | #[cfg(feature = "_nrf52832_anomaly_109")] | 7 | #[cfg(feature = "_nrf52832_anomaly_109")] |
| 8 | use core::sync::atomic::AtomicU8; | 8 | use core::sync::atomic::AtomicU8; |
| 9 | use core::sync::atomic::{compiler_fence, Ordering}; | 9 | use core::sync::atomic::{Ordering, compiler_fence}; |
| 10 | use core::task::Poll; | 10 | use core::task::Poll; |
| 11 | 11 | ||
| 12 | use embassy_embedded_hal::SetConfig; | 12 | use embassy_embedded_hal::SetConfig; |
| 13 | use embassy_hal_internal::{Peri, PeripheralType}; | 13 | use embassy_hal_internal::{Peri, PeripheralType}; |
| 14 | use embassy_sync::waitqueue::AtomicWaker; | 14 | use embassy_sync::waitqueue::AtomicWaker; |
| 15 | pub use embedded_hal_02::spi::{Mode, Phase, Polarity, MODE_0, MODE_1, MODE_2, MODE_3}; | 15 | pub use embedded_hal_02::spi::{MODE_0, MODE_1, MODE_2, MODE_3, Mode, Phase, Polarity}; |
| 16 | pub use pac::spim::vals::{Frequency, Order as BitOrder}; | 16 | pub use pac::spim::vals::{Frequency, Order as BitOrder}; |
| 17 | 17 | ||
| 18 | use crate::chip::{EASY_DMA_SIZE, FORCE_COPY_BUFFER_SIZE}; | 18 | use crate::chip::{EASY_DMA_SIZE, FORCE_COPY_BUFFER_SIZE}; |
| 19 | use crate::gpio::{self, convert_drive, AnyPin, OutputDrive, Pin as GpioPin, PselBits, SealedPin as _}; | 19 | use crate::gpio::{self, AnyPin, OutputDrive, Pin as GpioPin, PselBits, SealedPin as _, convert_drive}; |
| 20 | use crate::interrupt::typelevel::Interrupt; | 20 | use crate::interrupt::typelevel::Interrupt; |
| 21 | use crate::pac::gpio::vals as gpiovals; | 21 | use crate::pac::gpio::vals as gpiovals; |
| 22 | use crate::pac::spim::vals; | 22 | use crate::pac::spim::vals; |
diff --git a/embassy-nrf/src/spis.rs b/embassy-nrf/src/spis.rs index 713163a55..885821146 100644 --- a/embassy-nrf/src/spis.rs +++ b/embassy-nrf/src/spis.rs | |||
| @@ -3,17 +3,17 @@ | |||
| 3 | #![macro_use] | 3 | #![macro_use] |
| 4 | use core::future::poll_fn; | 4 | use core::future::poll_fn; |
| 5 | use core::marker::PhantomData; | 5 | use core::marker::PhantomData; |
| 6 | use core::sync::atomic::{compiler_fence, Ordering}; | 6 | use core::sync::atomic::{Ordering, compiler_fence}; |
| 7 | use core::task::Poll; | 7 | use core::task::Poll; |
| 8 | 8 | ||
| 9 | use embassy_embedded_hal::SetConfig; | 9 | use embassy_embedded_hal::SetConfig; |
| 10 | use embassy_hal_internal::{Peri, PeripheralType}; | 10 | use embassy_hal_internal::{Peri, PeripheralType}; |
| 11 | use embassy_sync::waitqueue::AtomicWaker; | 11 | use embassy_sync::waitqueue::AtomicWaker; |
| 12 | pub use embedded_hal_02::spi::{Mode, Phase, Polarity, MODE_0, MODE_1, MODE_2, MODE_3}; | 12 | pub use embedded_hal_02::spi::{MODE_0, MODE_1, MODE_2, MODE_3, Mode, Phase, Polarity}; |
| 13 | pub use pac::spis::vals::Order as BitOrder; | 13 | pub use pac::spis::vals::Order as BitOrder; |
| 14 | 14 | ||
| 15 | use crate::chip::{EASY_DMA_SIZE, FORCE_COPY_BUFFER_SIZE}; | 15 | use crate::chip::{EASY_DMA_SIZE, FORCE_COPY_BUFFER_SIZE}; |
| 16 | use crate::gpio::{self, convert_drive, AnyPin, OutputDrive, Pin as GpioPin, SealedPin as _}; | 16 | use crate::gpio::{self, AnyPin, OutputDrive, Pin as GpioPin, SealedPin as _, convert_drive}; |
| 17 | use crate::interrupt::typelevel::Interrupt; | 17 | use crate::interrupt::typelevel::Interrupt; |
| 18 | use crate::pac::gpio::vals as gpiovals; | 18 | use crate::pac::gpio::vals as gpiovals; |
| 19 | use crate::pac::spis::vals; | 19 | use crate::pac::spis::vals; |
diff --git a/embassy-nrf/src/temp.rs b/embassy-nrf/src/temp.rs index 44be0f6d1..a20e300b7 100644 --- a/embassy-nrf/src/temp.rs +++ b/embassy-nrf/src/temp.rs | |||
| @@ -9,7 +9,7 @@ use fixed::types::I30F2; | |||
| 9 | 9 | ||
| 10 | use crate::interrupt::InterruptExt; | 10 | use crate::interrupt::InterruptExt; |
| 11 | use crate::peripherals::TEMP; | 11 | use crate::peripherals::TEMP; |
| 12 | use crate::{interrupt, pac, Peri}; | 12 | use crate::{Peri, interrupt, pac}; |
| 13 | 13 | ||
| 14 | /// Interrupt handler. | 14 | /// Interrupt handler. |
| 15 | pub struct InterruptHandler { | 15 | pub struct InterruptHandler { |
diff --git a/embassy-nrf/src/time_driver.rs b/embassy-nrf/src/time_driver.rs index 03f4c2e2b..b723e2334 100644 --- a/embassy-nrf/src/time_driver.rs +++ b/embassy-nrf/src/time_driver.rs | |||
| @@ -1,9 +1,9 @@ | |||
| 1 | use core::cell::{Cell, RefCell}; | 1 | use core::cell::{Cell, RefCell}; |
| 2 | use core::sync::atomic::{compiler_fence, AtomicU32, Ordering}; | 2 | use core::sync::atomic::{AtomicU32, Ordering, compiler_fence}; |
| 3 | 3 | ||
| 4 | use critical_section::CriticalSection; | 4 | use critical_section::CriticalSection; |
| 5 | use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex; | ||
| 6 | use embassy_sync::blocking_mutex::CriticalSectionMutex as Mutex; | 5 | use embassy_sync::blocking_mutex::CriticalSectionMutex as Mutex; |
| 6 | use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex; | ||
| 7 | use embassy_time_driver::Driver; | 7 | use embassy_time_driver::Driver; |
| 8 | use embassy_time_queue_utils::Queue; | 8 | use embassy_time_queue_utils::Queue; |
| 9 | 9 | ||
diff --git a/embassy-nrf/src/twim.rs b/embassy-nrf/src/twim.rs index 943ea9d31..93255c832 100644 --- a/embassy-nrf/src/twim.rs +++ b/embassy-nrf/src/twim.rs | |||
| @@ -4,8 +4,8 @@ | |||
| 4 | 4 | ||
| 5 | use core::future::poll_fn; | 5 | use core::future::poll_fn; |
| 6 | use core::marker::PhantomData; | 6 | use core::marker::PhantomData; |
| 7 | use core::sync::atomic::compiler_fence; | ||
| 8 | use core::sync::atomic::Ordering::SeqCst; | 7 | use core::sync::atomic::Ordering::SeqCst; |
| 8 | use core::sync::atomic::compiler_fence; | ||
| 9 | use core::task::Poll; | 9 | use core::task::Poll; |
| 10 | 10 | ||
| 11 | use embassy_embedded_hal::SetConfig; | 11 | use embassy_embedded_hal::SetConfig; |
diff --git a/embassy-nrf/src/twis.rs b/embassy-nrf/src/twis.rs index dd4978b3e..2bc0a5c13 100644 --- a/embassy-nrf/src/twis.rs +++ b/embassy-nrf/src/twis.rs | |||
| @@ -2,10 +2,10 @@ | |||
| 2 | 2 | ||
| 3 | #![macro_use] | 3 | #![macro_use] |
| 4 | 4 | ||
| 5 | use core::future::{poll_fn, Future}; | 5 | use core::future::{Future, poll_fn}; |
| 6 | use core::marker::PhantomData; | 6 | use core::marker::PhantomData; |
| 7 | use core::sync::atomic::compiler_fence; | ||
| 8 | use core::sync::atomic::Ordering::SeqCst; | 7 | use core::sync::atomic::Ordering::SeqCst; |
| 8 | use core::sync::atomic::compiler_fence; | ||
| 9 | use core::task::Poll; | 9 | use core::task::Poll; |
| 10 | 10 | ||
| 11 | use embassy_hal_internal::{Peri, PeripheralType}; | 11 | use embassy_hal_internal::{Peri, PeripheralType}; |
diff --git a/embassy-nrf/src/uarte.rs b/embassy-nrf/src/uarte.rs index 66fb3b3f2..1ee452173 100644 --- a/embassy-nrf/src/uarte.rs +++ b/embassy-nrf/src/uarte.rs | |||
| @@ -15,7 +15,7 @@ | |||
| 15 | 15 | ||
| 16 | use core::future::poll_fn; | 16 | use core::future::poll_fn; |
| 17 | use core::marker::PhantomData; | 17 | use core::marker::PhantomData; |
| 18 | use core::sync::atomic::{compiler_fence, AtomicU8, Ordering}; | 18 | use core::sync::atomic::{AtomicU8, Ordering, compiler_fence}; |
| 19 | use core::task::Poll; | 19 | use core::task::Poll; |
| 20 | 20 | ||
| 21 | use embassy_hal_internal::drop::OnDrop; | 21 | use embassy_hal_internal::drop::OnDrop; |
| @@ -25,7 +25,7 @@ use embassy_sync::waitqueue::AtomicWaker; | |||
| 25 | pub use pac::uarte::vals::{Baudrate, ConfigParity as Parity}; | 25 | pub use pac::uarte::vals::{Baudrate, ConfigParity as Parity}; |
| 26 | 26 | ||
| 27 | use crate::chip::{EASY_DMA_SIZE, FORCE_COPY_BUFFER_SIZE}; | 27 | use crate::chip::{EASY_DMA_SIZE, FORCE_COPY_BUFFER_SIZE}; |
| 28 | use crate::gpio::{self, AnyPin, Pin as GpioPin, PselBits, SealedPin as _, DISCONNECTED}; | 28 | use crate::gpio::{self, AnyPin, DISCONNECTED, Pin as GpioPin, PselBits, SealedPin as _}; |
| 29 | use crate::interrupt::typelevel::Interrupt; | 29 | use crate::interrupt::typelevel::Interrupt; |
| 30 | use crate::pac::gpio::vals as gpiovals; | 30 | use crate::pac::gpio::vals as gpiovals; |
| 31 | use crate::pac::uarte::vals; | 31 | use crate::pac::uarte::vals; |
diff --git a/embassy-nrf/src/usb/mod.rs b/embassy-nrf/src/usb/mod.rs index 2a32fe922..07cf2578a 100644 --- a/embassy-nrf/src/usb/mod.rs +++ b/embassy-nrf/src/usb/mod.rs | |||
| @@ -4,10 +4,10 @@ | |||
| 4 | 4 | ||
| 5 | pub mod vbus_detect; | 5 | pub mod vbus_detect; |
| 6 | 6 | ||
| 7 | use core::future::{poll_fn, Future}; | 7 | use core::future::{Future, poll_fn}; |
| 8 | use core::marker::PhantomData; | 8 | use core::marker::PhantomData; |
| 9 | use core::mem::MaybeUninit; | 9 | use core::mem::MaybeUninit; |
| 10 | use core::sync::atomic::{compiler_fence, AtomicU32, Ordering}; | 10 | use core::sync::atomic::{AtomicU32, Ordering, compiler_fence}; |
| 11 | use core::task::Poll; | 11 | use core::task::Poll; |
| 12 | 12 | ||
| 13 | use cortex_m::peripheral::NVIC; | 13 | use cortex_m::peripheral::NVIC; |
| @@ -330,11 +330,7 @@ impl<'d, V: VbusDetect> driver::Bus for Bus<'d, V> { | |||
| 330 | let mut was_enabled = false; | 330 | let mut was_enabled = false; |
| 331 | regs.epinen().modify(|w| { | 331 | regs.epinen().modify(|w| { |
| 332 | was_enabled = (w.0 & mask) != 0; | 332 | was_enabled = (w.0 & mask) != 0; |
| 333 | if enabled { | 333 | if enabled { w.0 |= mask } else { w.0 &= !mask } |
| 334 | w.0 |= mask | ||
| 335 | } else { | ||
| 336 | w.0 &= !mask | ||
| 337 | } | ||
| 338 | }); | 334 | }); |
| 339 | 335 | ||
| 340 | let ready_mask = In::mask(i); | 336 | let ready_mask = In::mask(i); |
diff --git a/embassy-nrf/src/usb/vbus_detect.rs b/embassy-nrf/src/usb/vbus_detect.rs index 33cf91ee2..f24a7bff5 100644 --- a/embassy-nrf/src/usb/vbus_detect.rs +++ b/embassy-nrf/src/usb/vbus_detect.rs | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | //! Trait and implementations for performing VBUS detection. | 1 | //! Trait and implementations for performing VBUS detection. |
| 2 | 2 | ||
| 3 | use core::future::{poll_fn, Future}; | 3 | use core::future::{Future, poll_fn}; |
| 4 | use core::sync::atomic::{AtomicBool, Ordering}; | 4 | use core::sync::atomic::{AtomicBool, Ordering}; |
| 5 | use core::task::Poll; | 5 | use core::task::Poll; |
| 6 | 6 | ||
diff --git a/embassy-nrf/src/util.rs b/embassy-nrf/src/util.rs index 78f71719f..87118d347 100644 --- a/embassy-nrf/src/util.rs +++ b/embassy-nrf/src/util.rs | |||
| @@ -15,9 +15,5 @@ pub(crate) fn slice_in_ram<T>(slice: *const [T]) -> bool { | |||
| 15 | 15 | ||
| 16 | /// Return an error if slice is not in RAM. Skips check if slice is zero-length. | 16 | /// Return an error if slice is not in RAM. Skips check if slice is zero-length. |
| 17 | pub(crate) fn slice_in_ram_or<T, E>(slice: *const [T], err: E) -> Result<(), E> { | 17 | pub(crate) fn slice_in_ram_or<T, E>(slice: *const [T], err: E) -> Result<(), E> { |
| 18 | if slice_in_ram(slice) { | 18 | if slice_in_ram(slice) { Ok(()) } else { Err(err) } |
| 19 | Ok(()) | ||
| 20 | } else { | ||
| 21 | Err(err) | ||
| 22 | } | ||
| 23 | } | 19 | } |
diff --git a/embassy-nrf/src/wdt.rs b/embassy-nrf/src/wdt.rs index dc99a16f5..6afd73431 100644 --- a/embassy-nrf/src/wdt.rs +++ b/embassy-nrf/src/wdt.rs | |||
| @@ -11,7 +11,7 @@ use embassy_hal_internal::PeripheralType; | |||
| 11 | 11 | ||
| 12 | use crate::pac::wdt::vals; | 12 | use crate::pac::wdt::vals; |
| 13 | pub use crate::pac::wdt::vals::{Halt as HaltConfig, Sleep as SleepConfig}; | 13 | pub use crate::pac::wdt::vals::{Halt as HaltConfig, Sleep as SleepConfig}; |
| 14 | use crate::{interrupt, pac, peripherals, Peri}; | 14 | use crate::{Peri, interrupt, pac, peripherals}; |
| 15 | 15 | ||
| 16 | const MIN_TICKS: u32 = 15; | 16 | const MIN_TICKS: u32 = 15; |
| 17 | 17 | ||
diff --git a/embassy-nxp/src/dma/lpc55.rs b/embassy-nxp/src/dma/lpc55.rs index 578d1fd88..5bd763f03 100644 --- a/embassy-nxp/src/dma/lpc55.rs +++ b/embassy-nxp/src/dma/lpc55.rs | |||
| @@ -1,16 +1,16 @@ | |||
| 1 | use core::cell::RefCell; | 1 | use core::cell::RefCell; |
| 2 | use core::future::Future; | 2 | use core::future::Future; |
| 3 | use core::pin::Pin; | 3 | use core::pin::Pin; |
| 4 | use core::sync::atomic::{compiler_fence, Ordering}; | 4 | use core::sync::atomic::{Ordering, compiler_fence}; |
| 5 | use core::task::{Context, Poll}; | 5 | use core::task::{Context, Poll}; |
| 6 | 6 | ||
| 7 | use critical_section::Mutex; | 7 | use critical_section::Mutex; |
| 8 | use embassy_hal_internal::interrupt::InterruptExt; | 8 | use embassy_hal_internal::interrupt::InterruptExt; |
| 9 | use embassy_hal_internal::{impl_peripheral, PeripheralType}; | 9 | use embassy_hal_internal::{PeripheralType, impl_peripheral}; |
| 10 | use embassy_sync::waitqueue::AtomicWaker; | 10 | use embassy_sync::waitqueue::AtomicWaker; |
| 11 | 11 | ||
| 12 | use crate::pac::{DMA0, SYSCON, *}; | 12 | use crate::pac::{DMA0, SYSCON, *}; |
| 13 | use crate::{peripherals, Peri}; | 13 | use crate::{Peri, peripherals}; |
| 14 | 14 | ||
| 15 | #[interrupt] | 15 | #[interrupt] |
| 16 | fn DMA0() { | 16 | fn DMA0() { |
diff --git a/embassy-nxp/src/gpio/lpc55.rs b/embassy-nxp/src/gpio/lpc55.rs index 36ea99d21..ac8a27d4f 100644 --- a/embassy-nxp/src/gpio/lpc55.rs +++ b/embassy-nxp/src/gpio/lpc55.rs | |||
| @@ -1,8 +1,8 @@ | |||
| 1 | use embassy_hal_internal::{impl_peripheral, PeripheralType}; | 1 | use embassy_hal_internal::{PeripheralType, impl_peripheral}; |
| 2 | 2 | ||
| 3 | use crate::pac::iocon::vals::{PioDigimode, PioMode}; | 3 | use crate::pac::iocon::vals::{PioDigimode, PioMode}; |
| 4 | use crate::pac::{GPIO, IOCON, SYSCON}; | 4 | use crate::pac::{GPIO, IOCON, SYSCON}; |
| 5 | use crate::{peripherals, Peri}; | 5 | use crate::{Peri, peripherals}; |
| 6 | 6 | ||
| 7 | pub(crate) fn init() { | 7 | pub(crate) fn init() { |
| 8 | // Enable clocks for GPIO, PINT, and IOCON | 8 | // Enable clocks for GPIO, PINT, and IOCON |
diff --git a/embassy-nxp/src/gpio/rt1xxx.rs b/embassy-nxp/src/gpio/rt1xxx.rs index 1d60a0d51..c4dc110ff 100644 --- a/embassy-nxp/src/gpio/rt1xxx.rs +++ b/embassy-nxp/src/gpio/rt1xxx.rs | |||
| @@ -5,13 +5,13 @@ use core::ops::Not; | |||
| 5 | use core::pin::Pin as FuturePin; | 5 | use core::pin::Pin as FuturePin; |
| 6 | use core::task::{Context, Poll}; | 6 | use core::task::{Context, Poll}; |
| 7 | 7 | ||
| 8 | use embassy_hal_internal::{impl_peripheral, Peri, PeripheralType}; | 8 | use embassy_hal_internal::{Peri, PeripheralType, impl_peripheral}; |
| 9 | use embassy_sync::waitqueue::AtomicWaker; | 9 | use embassy_sync::waitqueue::AtomicWaker; |
| 10 | use nxp_pac::gpio::vals::Icr; | 10 | use nxp_pac::gpio::vals::Icr; |
| 11 | use nxp_pac::iomuxc::vals::Pus; | 11 | use nxp_pac::iomuxc::vals::Pus; |
| 12 | 12 | ||
| 13 | use crate::chip::{mux_address, pad_address}; | 13 | use crate::chip::{mux_address, pad_address}; |
| 14 | use crate::pac::common::{Reg, RW}; | 14 | use crate::pac::common::{RW, Reg}; |
| 15 | use crate::pac::gpio::Gpio; | 15 | use crate::pac::gpio::Gpio; |
| 16 | #[cfg(feature = "rt")] | 16 | #[cfg(feature = "rt")] |
| 17 | use crate::pac::interrupt; | 17 | use crate::pac::interrupt; |
diff --git a/embassy-nxp/src/lib.rs b/embassy-nxp/src/lib.rs index 617045217..9576f02b1 100644 --- a/embassy-nxp/src/lib.rs +++ b/embassy-nxp/src/lib.rs | |||
| @@ -30,7 +30,7 @@ pub use chip::interrupt; | |||
| 30 | pub use chip::pac; | 30 | pub use chip::pac; |
| 31 | #[cfg(not(feature = "unstable-pac"))] | 31 | #[cfg(not(feature = "unstable-pac"))] |
| 32 | pub(crate) use chip::pac; | 32 | pub(crate) use chip::pac; |
| 33 | pub use chip::{peripherals, Peripherals}; | 33 | pub use chip::{Peripherals, peripherals}; |
| 34 | pub use embassy_hal_internal::{Peri, PeripheralType}; | 34 | pub use embassy_hal_internal::{Peri, PeripheralType}; |
| 35 | 35 | ||
| 36 | /// Macro to bind interrupts to handlers. | 36 | /// Macro to bind interrupts to handlers. |
diff --git a/embassy-nxp/src/pint.rs b/embassy-nxp/src/pint.rs index e594aaa6a..5b10b4540 100644 --- a/embassy-nxp/src/pint.rs +++ b/embassy-nxp/src/pint.rs | |||
| @@ -8,9 +8,9 @@ use critical_section::Mutex; | |||
| 8 | use embassy_hal_internal::interrupt::InterruptExt; | 8 | use embassy_hal_internal::interrupt::InterruptExt; |
| 9 | use embassy_sync::waitqueue::AtomicWaker; | 9 | use embassy_sync::waitqueue::AtomicWaker; |
| 10 | 10 | ||
| 11 | use crate::gpio::{self, AnyPin, Level, SealedPin}; | ||
| 12 | use crate::pac::{interrupt, INPUTMUX, PINT, SYSCON}; | ||
| 13 | use crate::Peri; | 11 | use crate::Peri; |
| 12 | use crate::gpio::{self, AnyPin, Level, SealedPin}; | ||
| 13 | use crate::pac::{INPUTMUX, PINT, SYSCON, interrupt}; | ||
| 14 | 14 | ||
| 15 | struct PinInterrupt { | 15 | struct PinInterrupt { |
| 16 | assigned: bool, | 16 | assigned: bool, |
diff --git a/embassy-nxp/src/time_driver/rtc.rs b/embassy-nxp/src/time_driver/rtc.rs index fb6de6a5e..0883fa2e8 100644 --- a/embassy-nxp/src/time_driver/rtc.rs +++ b/embassy-nxp/src/time_driver/rtc.rs | |||
| @@ -4,10 +4,10 @@ use core::task::Waker; | |||
| 4 | use critical_section::CriticalSection; | 4 | use critical_section::CriticalSection; |
| 5 | use embassy_hal_internal::interrupt::{InterruptExt, Priority}; | 5 | use embassy_hal_internal::interrupt::{InterruptExt, Priority}; |
| 6 | use embassy_sync::blocking_mutex::CriticalSectionMutex as Mutex; | 6 | use embassy_sync::blocking_mutex::CriticalSectionMutex as Mutex; |
| 7 | use embassy_time_driver::{time_driver_impl, Driver}; | 7 | use embassy_time_driver::{Driver, time_driver_impl}; |
| 8 | use embassy_time_queue_utils::Queue; | 8 | use embassy_time_queue_utils::Queue; |
| 9 | 9 | ||
| 10 | use crate::pac::{interrupt, pmc, rtc, PMC, RTC, SYSCON}; | 10 | use crate::pac::{PMC, RTC, SYSCON, interrupt, pmc, rtc}; |
| 11 | 11 | ||
| 12 | struct AlarmState { | 12 | struct AlarmState { |
| 13 | timestamp: Cell<u64>, | 13 | timestamp: Cell<u64>, |
diff --git a/embassy-nxp/src/usart/lpc55.rs b/embassy-nxp/src/usart/lpc55.rs index 9034ed429..0be5a8ce7 100644 --- a/embassy-nxp/src/usart/lpc55.rs +++ b/embassy-nxp/src/usart/lpc55.rs | |||
| @@ -4,16 +4,16 @@ use core::marker::PhantomData; | |||
| 4 | use core::sync::atomic::{AtomicBool, Ordering}; | 4 | use core::sync::atomic::{AtomicBool, Ordering}; |
| 5 | use core::task::Poll; | 5 | use core::task::Poll; |
| 6 | 6 | ||
| 7 | use embassy_futures::select::{select, Either}; | 7 | use embassy_futures::select::{Either, select}; |
| 8 | use embassy_hal_internal::interrupt::InterruptExt; | 8 | use embassy_hal_internal::interrupt::InterruptExt; |
| 9 | use embassy_hal_internal::{Peri, PeripheralType}; | 9 | use embassy_hal_internal::{Peri, PeripheralType}; |
| 10 | use embassy_sync::waitqueue::AtomicWaker; | 10 | use embassy_sync::waitqueue::AtomicWaker; |
| 11 | use embedded_io::{self, ErrorKind}; | 11 | use embedded_io::{self, ErrorKind}; |
| 12 | 12 | ||
| 13 | use crate::dma::{AnyChannel, Channel}; | 13 | use crate::dma::{AnyChannel, Channel}; |
| 14 | use crate::gpio::{match_iocon, AnyPin, Bank, SealedPin}; | 14 | use crate::gpio::{AnyPin, Bank, SealedPin, match_iocon}; |
| 15 | use crate::interrupt::typelevel::{Binding, Interrupt as _}; | ||
| 16 | use crate::interrupt::Interrupt; | 15 | use crate::interrupt::Interrupt; |
| 16 | use crate::interrupt::typelevel::{Binding, Interrupt as _}; | ||
| 17 | use crate::pac::flexcomm::Flexcomm as FlexcommReg; | 17 | use crate::pac::flexcomm::Flexcomm as FlexcommReg; |
| 18 | use crate::pac::iocon::vals::PioFunc; | 18 | use crate::pac::iocon::vals::PioFunc; |
| 19 | use crate::pac::usart::Usart as UsartReg; | 19 | use crate::pac::usart::Usart as UsartReg; |
diff --git a/embassy-rp/src/adc.rs b/embassy-rp/src/adc.rs index 2db8e63d7..d16779e01 100644 --- a/embassy-rp/src/adc.rs +++ b/embassy-rp/src/adc.rs | |||
| @@ -1,18 +1,18 @@ | |||
| 1 | //! ADC driver. | 1 | //! ADC driver. |
| 2 | use core::future::{poll_fn, Future}; | 2 | use core::future::{Future, poll_fn}; |
| 3 | use core::marker::PhantomData; | 3 | use core::marker::PhantomData; |
| 4 | use core::mem; | 4 | use core::mem; |
| 5 | use core::sync::atomic::{compiler_fence, Ordering}; | 5 | use core::sync::atomic::{Ordering, compiler_fence}; |
| 6 | use core::task::Poll; | 6 | use core::task::Poll; |
| 7 | 7 | ||
| 8 | use embassy_sync::waitqueue::AtomicWaker; | 8 | use embassy_sync::waitqueue::AtomicWaker; |
| 9 | 9 | ||
| 10 | use crate::gpio::{self, AnyPin, Pull, SealedPin as GpioPin}; | 10 | use crate::gpio::{self, AnyPin, Pull, SealedPin as GpioPin}; |
| 11 | use crate::interrupt::typelevel::Binding; | ||
| 12 | use crate::interrupt::InterruptExt; | 11 | use crate::interrupt::InterruptExt; |
| 12 | use crate::interrupt::typelevel::Binding; | ||
| 13 | use crate::pac::dma::vals::TreqSel; | 13 | use crate::pac::dma::vals::TreqSel; |
| 14 | use crate::peripherals::{ADC, ADC_TEMP_SENSOR}; | 14 | use crate::peripherals::{ADC, ADC_TEMP_SENSOR}; |
| 15 | use crate::{dma, interrupt, pac, peripherals, Peri, RegExt}; | 15 | use crate::{Peri, RegExt, dma, interrupt, pac, peripherals}; |
| 16 | 16 | ||
| 17 | static WAKER: AtomicWaker = AtomicWaker::new(); | 17 | static WAKER: AtomicWaker = AtomicWaker::new(); |
| 18 | 18 | ||
diff --git a/embassy-rp/src/bootsel.rs b/embassy-rp/src/bootsel.rs index 5f0bac248..b24b98cd5 100644 --- a/embassy-rp/src/bootsel.rs +++ b/embassy-rp/src/bootsel.rs | |||
| @@ -7,8 +7,8 @@ | |||
| 7 | //! | 7 | //! |
| 8 | //! This module provides functionality to poll BOOTSEL from an embassy application. | 8 | //! This module provides functionality to poll BOOTSEL from an embassy application. |
| 9 | 9 | ||
| 10 | use crate::flash::in_ram; | ||
| 11 | use crate::Peri; | 10 | use crate::Peri; |
| 11 | use crate::flash::in_ram; | ||
| 12 | 12 | ||
| 13 | /// Reads the BOOTSEL button. Returns true if the button is pressed. | 13 | /// Reads the BOOTSEL button. Returns true if the button is pressed. |
| 14 | /// | 14 | /// |
diff --git a/embassy-rp/src/clocks.rs b/embassy-rp/src/clocks.rs index 2eddc0bcc..56892d7a2 100644 --- a/embassy-rp/src/clocks.rs +++ b/embassy-rp/src/clocks.rs | |||
| @@ -72,8 +72,8 @@ use core::sync::atomic::{AtomicU32, Ordering}; | |||
| 72 | use pac::clocks::vals::*; | 72 | use pac::clocks::vals::*; |
| 73 | 73 | ||
| 74 | use crate::gpio::{AnyPin, SealedPin}; | 74 | use crate::gpio::{AnyPin, SealedPin}; |
| 75 | use crate::pac::common::{Reg, RW}; | 75 | use crate::pac::common::{RW, Reg}; |
| 76 | use crate::{pac, reset, Peri}; | 76 | use crate::{Peri, pac, reset}; |
| 77 | 77 | ||
| 78 | // NOTE: all gpin handling is commented out for future reference. | 78 | // NOTE: all gpin handling is commented out for future reference. |
| 79 | // gpin is not usually safe to use during the boot init() call, so it won't | 79 | // gpin is not usually safe to use during the boot init() call, so it won't |
diff --git a/embassy-rp/src/dma.rs b/embassy-rp/src/dma.rs index d31d1e159..18aec60a5 100644 --- a/embassy-rp/src/dma.rs +++ b/embassy-rp/src/dma.rs | |||
| @@ -1,10 +1,10 @@ | |||
| 1 | //! Direct Memory Access (DMA) | 1 | //! Direct Memory Access (DMA) |
| 2 | use core::future::Future; | 2 | use core::future::Future; |
| 3 | use core::pin::Pin; | 3 | use core::pin::Pin; |
| 4 | use core::sync::atomic::{compiler_fence, Ordering}; | 4 | use core::sync::atomic::{Ordering, compiler_fence}; |
| 5 | use core::task::{Context, Poll}; | 5 | use core::task::{Context, Poll}; |
| 6 | 6 | ||
| 7 | use embassy_hal_internal::{impl_peripheral, Peri, PeripheralType}; | 7 | use embassy_hal_internal::{Peri, PeripheralType, impl_peripheral}; |
| 8 | use embassy_sync::waitqueue::AtomicWaker; | 8 | use embassy_sync::waitqueue::AtomicWaker; |
| 9 | use pac::dma::vals::DataSize; | 9 | use pac::dma::vals::DataSize; |
| 10 | 10 | ||
diff --git a/embassy-rp/src/flash.rs b/embassy-rp/src/flash.rs index 6b5eda0a3..7cc8f0c1d 100644 --- a/embassy-rp/src/flash.rs +++ b/embassy-rp/src/flash.rs | |||
| @@ -6,8 +6,8 @@ use core::task::{Context, Poll}; | |||
| 6 | 6 | ||
| 7 | use embassy_hal_internal::{Peri, PeripheralType}; | 7 | use embassy_hal_internal::{Peri, PeripheralType}; |
| 8 | use embedded_storage::nor_flash::{ | 8 | use embedded_storage::nor_flash::{ |
| 9 | check_erase, check_read, check_write, ErrorType, MultiwriteNorFlash, NorFlash, NorFlashError, NorFlashErrorKind, | 9 | ErrorType, MultiwriteNorFlash, NorFlash, NorFlashError, NorFlashErrorKind, ReadNorFlash, check_erase, check_read, |
| 10 | ReadNorFlash, | 10 | check_write, |
| 11 | }; | 11 | }; |
| 12 | 12 | ||
| 13 | use crate::dma::{AnyChannel, Channel, Transfer}; | 13 | use crate::dma::{AnyChannel, Channel, Transfer}; |
diff --git a/embassy-rp/src/float/cmp.rs b/embassy-rp/src/float/cmp.rs index e540e3918..f917eb9b3 100644 --- a/embassy-rp/src/float/cmp.rs +++ b/embassy-rp/src/float/cmp.rs | |||
| @@ -21,19 +21,11 @@ impl ROMCmp for f64 { | |||
| 21 | } | 21 | } |
| 22 | 22 | ||
| 23 | fn le_abi<F: Float + ROMCmp>(a: F, b: F) -> i32 { | 23 | fn le_abi<F: Float + ROMCmp>(a: F, b: F) -> i32 { |
| 24 | if a.is_nan() || b.is_nan() { | 24 | if a.is_nan() || b.is_nan() { 1 } else { a.rom_cmp(b) } |
| 25 | 1 | ||
| 26 | } else { | ||
| 27 | a.rom_cmp(b) | ||
| 28 | } | ||
| 29 | } | 25 | } |
| 30 | 26 | ||
| 31 | fn ge_abi<F: Float + ROMCmp>(a: F, b: F) -> i32 { | 27 | fn ge_abi<F: Float + ROMCmp>(a: F, b: F) -> i32 { |
| 32 | if a.is_nan() || b.is_nan() { | 28 | if a.is_nan() || b.is_nan() { -1 } else { a.rom_cmp(b) } |
| 33 | -1 | ||
| 34 | } else { | ||
| 35 | a.rom_cmp(b) | ||
| 36 | } | ||
| 37 | } | 29 | } |
| 38 | 30 | ||
| 39 | intrinsics! { | 31 | intrinsics! { |
diff --git a/embassy-rp/src/float/functions.rs b/embassy-rp/src/float/functions.rs index de29ce336..170168237 100644 --- a/embassy-rp/src/float/functions.rs +++ b/embassy-rp/src/float/functions.rs | |||
| @@ -114,19 +114,11 @@ fn sqrt<F: Float + ROMFunctions>(f: F) -> F { | |||
| 114 | } | 114 | } |
| 115 | 115 | ||
| 116 | fn ln<F: Float + ROMFunctions>(f: F) -> F { | 116 | fn ln<F: Float + ROMFunctions>(f: F) -> F { |
| 117 | if is_negative_nonzero_or_nan(f) { | 117 | if is_negative_nonzero_or_nan(f) { F::NAN } else { f.ln() } |
| 118 | F::NAN | ||
| 119 | } else { | ||
| 120 | f.ln() | ||
| 121 | } | ||
| 122 | } | 118 | } |
| 123 | 119 | ||
| 124 | fn exp<F: Float + ROMFunctions>(f: F) -> F { | 120 | fn exp<F: Float + ROMFunctions>(f: F) -> F { |
| 125 | if f.is_nan() { | 121 | if f.is_nan() { F::NAN } else { f.exp() } |
| 126 | F::NAN | ||
| 127 | } else { | ||
| 128 | f.exp() | ||
| 129 | } | ||
| 130 | } | 122 | } |
| 131 | 123 | ||
| 132 | fn sin<F: Float + ROMFunctions>(f: F) -> F { | 124 | fn sin<F: Float + ROMFunctions>(f: F) -> F { |
diff --git a/embassy-rp/src/gpio.rs b/embassy-rp/src/gpio.rs index f79bf8948..c15e0e41b 100644 --- a/embassy-rp/src/gpio.rs +++ b/embassy-rp/src/gpio.rs | |||
| @@ -5,13 +5,13 @@ use core::future::Future; | |||
| 5 | use core::pin::Pin as FuturePin; | 5 | use core::pin::Pin as FuturePin; |
| 6 | use core::task::{Context, Poll}; | 6 | use core::task::{Context, Poll}; |
| 7 | 7 | ||
| 8 | use embassy_hal_internal::{impl_peripheral, Peri, PeripheralType}; | 8 | use embassy_hal_internal::{Peri, PeripheralType, impl_peripheral}; |
| 9 | use embassy_sync::waitqueue::AtomicWaker; | 9 | use embassy_sync::waitqueue::AtomicWaker; |
| 10 | 10 | ||
| 11 | use crate::interrupt::InterruptExt; | 11 | use crate::interrupt::InterruptExt; |
| 12 | use crate::pac::common::{Reg, RW}; | ||
| 13 | use crate::pac::SIO; | 12 | use crate::pac::SIO; |
| 14 | use crate::{interrupt, pac, peripherals, RegExt}; | 13 | use crate::pac::common::{RW, Reg}; |
| 14 | use crate::{RegExt, interrupt, pac, peripherals}; | ||
| 15 | 15 | ||
| 16 | #[cfg(any(feature = "rp2040", feature = "rp235xa"))] | 16 | #[cfg(any(feature = "rp2040", feature = "rp235xa"))] |
| 17 | pub(crate) const BANK0_PIN_COUNT: usize = 30; | 17 | pub(crate) const BANK0_PIN_COUNT: usize = 30; |
diff --git a/embassy-rp/src/i2c_slave.rs b/embassy-rp/src/i2c_slave.rs index c263047ad..770087bc8 100644 --- a/embassy-rp/src/i2c_slave.rs +++ b/embassy-rp/src/i2c_slave.rs | |||
| @@ -5,9 +5,9 @@ use core::task::Poll; | |||
| 5 | 5 | ||
| 6 | use pac::i2c; | 6 | use pac::i2c; |
| 7 | 7 | ||
| 8 | use crate::i2c::{set_up_i2c_pin, AbortReason, Instance, InterruptHandler, SclPin, SdaPin, FIFO_SIZE}; | 8 | use crate::i2c::{AbortReason, FIFO_SIZE, Instance, InterruptHandler, SclPin, SdaPin, set_up_i2c_pin}; |
| 9 | use crate::interrupt::typelevel::{Binding, Interrupt}; | 9 | use crate::interrupt::typelevel::{Binding, Interrupt}; |
| 10 | use crate::{pac, Peri}; | 10 | use crate::{Peri, pac}; |
| 11 | 11 | ||
| 12 | /// I2C error | 12 | /// I2C error |
| 13 | #[derive(Debug, PartialEq, Eq, Clone, Copy)] | 13 | #[derive(Debug, PartialEq, Eq, Clone, Copy)] |
diff --git a/embassy-rp/src/multicore.rs b/embassy-rp/src/multicore.rs index c305513ca..3b120e349 100644 --- a/embassy-rp/src/multicore.rs +++ b/embassy-rp/src/multicore.rs | |||
| @@ -48,11 +48,11 @@ | |||
| 48 | //! ``` | 48 | //! ``` |
| 49 | 49 | ||
| 50 | use core::mem::ManuallyDrop; | 50 | use core::mem::ManuallyDrop; |
| 51 | use core::sync::atomic::{compiler_fence, AtomicBool, Ordering}; | 51 | use core::sync::atomic::{AtomicBool, Ordering, compiler_fence}; |
| 52 | 52 | ||
| 53 | use crate::interrupt::InterruptExt; | 53 | use crate::interrupt::InterruptExt; |
| 54 | use crate::peripherals::CORE1; | 54 | use crate::peripherals::CORE1; |
| 55 | use crate::{gpio, install_stack_guard, interrupt, pac, Peri}; | 55 | use crate::{Peri, gpio, install_stack_guard, interrupt, pac}; |
| 56 | 56 | ||
| 57 | const PAUSE_TOKEN: u32 = 0xDEADBEEF; | 57 | const PAUSE_TOKEN: u32 = 0xDEADBEEF; |
| 58 | const RESUME_TOKEN: u32 = !0xDEADBEEF; | 58 | const RESUME_TOKEN: u32 = !0xDEADBEEF; |
diff --git a/embassy-rp/src/pio/mod.rs b/embassy-rp/src/pio/mod.rs index 5f554dfe3..38ee1f97c 100644 --- a/embassy-rp/src/pio/mod.rs +++ b/embassy-rp/src/pio/mod.rs | |||
| @@ -2,21 +2,21 @@ | |||
| 2 | use core::future::Future; | 2 | use core::future::Future; |
| 3 | use core::marker::PhantomData; | 3 | use core::marker::PhantomData; |
| 4 | use core::pin::Pin as FuturePin; | 4 | use core::pin::Pin as FuturePin; |
| 5 | use core::sync::atomic::{compiler_fence, Ordering}; | 5 | use core::sync::atomic::{Ordering, compiler_fence}; |
| 6 | use core::task::{Context, Poll}; | 6 | use core::task::{Context, Poll}; |
| 7 | 7 | ||
| 8 | use atomic_polyfill::{AtomicU64, AtomicU8}; | 8 | use atomic_polyfill::{AtomicU8, AtomicU64}; |
| 9 | use embassy_hal_internal::{Peri, PeripheralType}; | 9 | use embassy_hal_internal::{Peri, PeripheralType}; |
| 10 | use embassy_sync::waitqueue::AtomicWaker; | 10 | use embassy_sync::waitqueue::AtomicWaker; |
| 11 | use fixed::types::extra::U8; | ||
| 12 | use fixed::FixedU32; | 11 | use fixed::FixedU32; |
| 12 | use fixed::types::extra::U8; | ||
| 13 | use pio::{Program, SideSet, Wrap}; | 13 | use pio::{Program, SideSet, Wrap}; |
| 14 | 14 | ||
| 15 | use crate::dma::{self, Channel, Transfer, Word}; | 15 | use crate::dma::{self, Channel, Transfer, Word}; |
| 16 | use crate::gpio::{self, AnyPin, Drive, Level, Pull, SealedPin, SlewRate}; | 16 | use crate::gpio::{self, AnyPin, Drive, Level, Pull, SealedPin, SlewRate}; |
| 17 | use crate::interrupt::typelevel::{Binding, Handler, Interrupt}; | 17 | use crate::interrupt::typelevel::{Binding, Handler, Interrupt}; |
| 18 | use crate::relocate::RelocatedProgram; | 18 | use crate::relocate::RelocatedProgram; |
| 19 | use crate::{pac, peripherals, RegExt}; | 19 | use crate::{RegExt, pac, peripherals}; |
| 20 | 20 | ||
| 21 | mod instr; | 21 | mod instr; |
| 22 | 22 | ||
| @@ -984,11 +984,7 @@ impl<'d, PIO: Instance + 'd, const SM: usize> StateMachine<'d, PIO, SM> { | |||
| 984 | 984 | ||
| 985 | #[cfg(feature = "_rp235x")] | 985 | #[cfg(feature = "_rp235x")] |
| 986 | fn pin_base() -> u8 { | 986 | fn pin_base() -> u8 { |
| 987 | if PIO::PIO.gpiobase().read().gpiobase() { | 987 | if PIO::PIO.gpiobase().read().gpiobase() { 16 } else { 0 } |
| 988 | 16 | ||
| 989 | } else { | ||
| 990 | 0 | ||
| 991 | } | ||
| 992 | } | 988 | } |
| 993 | 989 | ||
| 994 | /// Sets pin directions. This pauses the current state machine to run `SET` commands | 990 | /// Sets pin directions. This pauses the current state machine to run `SET` commands |
diff --git a/embassy-rp/src/pio_programs/hd44780.rs b/embassy-rp/src/pio_programs/hd44780.rs index 546c85a89..78281ddd4 100644 --- a/embassy-rp/src/pio_programs/hd44780.rs +++ b/embassy-rp/src/pio_programs/hd44780.rs | |||
| @@ -1,12 +1,12 @@ | |||
| 1 | //! [HD44780 display driver](https://www.sparkfun.com/datasheets/LCD/HD44780.pdf) | 1 | //! [HD44780 display driver](https://www.sparkfun.com/datasheets/LCD/HD44780.pdf) |
| 2 | 2 | ||
| 3 | use crate::Peri; | ||
| 3 | use crate::dma::{AnyChannel, Channel}; | 4 | use crate::dma::{AnyChannel, Channel}; |
| 4 | use crate::pio::{ | 5 | use crate::pio::{ |
| 5 | Common, Config, Direction, FifoJoin, Instance, Irq, LoadedProgram, PioPin, ShiftConfig, ShiftDirection, | 6 | Common, Config, Direction, FifoJoin, Instance, Irq, LoadedProgram, PioPin, ShiftConfig, ShiftDirection, |
| 6 | StateMachine, | 7 | StateMachine, |
| 7 | }; | 8 | }; |
| 8 | use crate::pio_programs::clock_divider::calculate_pio_clock_divider; | 9 | use crate::pio_programs::clock_divider::calculate_pio_clock_divider; |
| 9 | use crate::Peri; | ||
| 10 | 10 | ||
| 11 | /// This struct represents a HD44780 program that takes command words (<wait:24> <command:4> <0:4>) | 11 | /// This struct represents a HD44780 program that takes command words (<wait:24> <command:4> <0:4>) |
| 12 | pub struct PioHD44780CommandWordProgram<'a, PIO: Instance> { | 12 | pub struct PioHD44780CommandWordProgram<'a, PIO: Instance> { |
diff --git a/embassy-rp/src/pio_programs/i2s.rs b/embassy-rp/src/pio_programs/i2s.rs index 2382a3f9f..7e5f68ad6 100644 --- a/embassy-rp/src/pio_programs/i2s.rs +++ b/embassy-rp/src/pio_programs/i2s.rs | |||
| @@ -2,12 +2,12 @@ | |||
| 2 | 2 | ||
| 3 | use fixed::traits::ToFixed; | 3 | use fixed::traits::ToFixed; |
| 4 | 4 | ||
| 5 | use crate::Peri; | ||
| 5 | use crate::dma::{AnyChannel, Channel, Transfer}; | 6 | use crate::dma::{AnyChannel, Channel, Transfer}; |
| 6 | use crate::gpio::Pull; | 7 | use crate::gpio::Pull; |
| 7 | use crate::pio::{ | 8 | use crate::pio::{ |
| 8 | Common, Config, Direction, FifoJoin, Instance, LoadedProgram, PioPin, ShiftConfig, ShiftDirection, StateMachine, | 9 | Common, Config, Direction, FifoJoin, Instance, LoadedProgram, PioPin, ShiftConfig, ShiftDirection, StateMachine, |
| 9 | }; | 10 | }; |
| 10 | use crate::Peri; | ||
| 11 | 11 | ||
| 12 | /// This struct represents an i2s receiver & controller driver program | 12 | /// This struct represents an i2s receiver & controller driver program |
| 13 | pub struct PioI2sInProgram<'d, PIO: Instance> { | 13 | pub struct PioI2sInProgram<'d, PIO: Instance> { |
diff --git a/embassy-rp/src/pio_programs/onewire.rs b/embassy-rp/src/pio_programs/onewire.rs index 980d0fe5f..09babc229 100644 --- a/embassy-rp/src/pio_programs/onewire.rs +++ b/embassy-rp/src/pio_programs/onewire.rs | |||
| @@ -1,11 +1,11 @@ | |||
| 1 | //! OneWire pio driver | 1 | //! OneWire pio driver |
| 2 | 2 | ||
| 3 | use crate::Peri; | ||
| 3 | use crate::clocks::clk_sys_freq; | 4 | use crate::clocks::clk_sys_freq; |
| 4 | use crate::gpio::Level; | 5 | use crate::gpio::Level; |
| 5 | use crate::pio::{ | 6 | use crate::pio::{ |
| 6 | Common, Config, Direction, Instance, LoadedProgram, PioPin, ShiftConfig, ShiftDirection, StateMachine, | 7 | Common, Config, Direction, Instance, LoadedProgram, PioPin, ShiftConfig, ShiftDirection, StateMachine, |
| 7 | }; | 8 | }; |
| 8 | use crate::Peri; | ||
| 9 | 9 | ||
| 10 | /// This struct represents a onewire driver program | 10 | /// This struct represents a onewire driver program |
| 11 | pub struct PioOneWireProgram<'a, PIO: Instance> { | 11 | pub struct PioOneWireProgram<'a, PIO: Instance> { |
| @@ -321,11 +321,7 @@ impl PioOneWireSearch { | |||
| 321 | 321 | ||
| 322 | /// Search for the next address on the bus | 322 | /// Search for the next address on the bus |
| 323 | pub async fn next<PIO: Instance, const SM: usize>(&mut self, pio: &mut PioOneWire<'_, PIO, SM>) -> Option<u64> { | 323 | pub async fn next<PIO: Instance, const SM: usize>(&mut self, pio: &mut PioOneWire<'_, PIO, SM>) -> Option<u64> { |
| 324 | if self.finished { | 324 | if self.finished { None } else { pio.search(self).await } |
| 325 | None | ||
| 326 | } else { | ||
| 327 | pio.search(self).await | ||
| 328 | } | ||
| 329 | } | 325 | } |
| 330 | 326 | ||
| 331 | /// Is finished when all devices have been found | 327 | /// Is finished when all devices have been found |
diff --git a/embassy-rp/src/pio_programs/pwm.rs b/embassy-rp/src/pio_programs/pwm.rs index f0f837bc5..ba06bb3c1 100644 --- a/embassy-rp/src/pio_programs/pwm.rs +++ b/embassy-rp/src/pio_programs/pwm.rs | |||
| @@ -6,7 +6,7 @@ use pio::InstructionOperands; | |||
| 6 | 6 | ||
| 7 | use crate::gpio::Level; | 7 | use crate::gpio::Level; |
| 8 | use crate::pio::{Common, Config, Direction, Instance, LoadedProgram, Pin, PioPin, StateMachine}; | 8 | use crate::pio::{Common, Config, Direction, Instance, LoadedProgram, Pin, PioPin, StateMachine}; |
| 9 | use crate::{clocks, Peri}; | 9 | use crate::{Peri, clocks}; |
| 10 | 10 | ||
| 11 | /// This converts the duration provided into the number of cycles the PIO needs to run to make it take the same time | 11 | /// This converts the duration provided into the number of cycles the PIO needs to run to make it take the same time |
| 12 | fn to_pio_cycles(duration: Duration) -> u32 { | 12 | fn to_pio_cycles(duration: Duration) -> u32 { |
diff --git a/embassy-rp/src/pio_programs/rotary_encoder.rs b/embassy-rp/src/pio_programs/rotary_encoder.rs index 70b3795e9..6347527e6 100644 --- a/embassy-rp/src/pio_programs/rotary_encoder.rs +++ b/embassy-rp/src/pio_programs/rotary_encoder.rs | |||
| @@ -1,11 +1,11 @@ | |||
| 1 | //! PIO backed quadrature encoder | 1 | //! PIO backed quadrature encoder |
| 2 | 2 | ||
| 3 | use crate::Peri; | ||
| 3 | use crate::gpio::Pull; | 4 | use crate::gpio::Pull; |
| 4 | use crate::pio::{ | 5 | use crate::pio::{ |
| 5 | Common, Config, Direction as PioDirection, FifoJoin, Instance, LoadedProgram, PioPin, ShiftDirection, StateMachine, | 6 | Common, Config, Direction as PioDirection, FifoJoin, Instance, LoadedProgram, PioPin, ShiftDirection, StateMachine, |
| 6 | }; | 7 | }; |
| 7 | use crate::pio_programs::clock_divider::calculate_pio_clock_divider; | 8 | use crate::pio_programs::clock_divider::calculate_pio_clock_divider; |
| 8 | use crate::Peri; | ||
| 9 | 9 | ||
| 10 | /// This struct represents an Encoder program loaded into pio instruction memory. | 10 | /// This struct represents an Encoder program loaded into pio instruction memory. |
| 11 | pub struct PioEncoderProgram<'a, PIO: Instance> { | 11 | pub struct PioEncoderProgram<'a, PIO: Instance> { |
diff --git a/embassy-rp/src/pio_programs/stepper.rs b/embassy-rp/src/pio_programs/stepper.rs index 0e9a8daf9..5762ee189 100644 --- a/embassy-rp/src/pio_programs/stepper.rs +++ b/embassy-rp/src/pio_programs/stepper.rs | |||
| @@ -2,9 +2,9 @@ | |||
| 2 | 2 | ||
| 3 | use core::mem::{self, MaybeUninit}; | 3 | use core::mem::{self, MaybeUninit}; |
| 4 | 4 | ||
| 5 | use crate::Peri; | ||
| 5 | use crate::pio::{Common, Config, Direction, Instance, Irq, LoadedProgram, PioPin, StateMachine}; | 6 | use crate::pio::{Common, Config, Direction, Instance, Irq, LoadedProgram, PioPin, StateMachine}; |
| 6 | use crate::pio_programs::clock_divider::calculate_pio_clock_divider; | 7 | use crate::pio_programs::clock_divider::calculate_pio_clock_divider; |
| 7 | use crate::Peri; | ||
| 8 | 8 | ||
| 9 | /// This struct represents a Stepper driver program loaded into pio instruction memory. | 9 | /// This struct represents a Stepper driver program loaded into pio instruction memory. |
| 10 | pub struct PioStepperProgram<'a, PIO: Instance> { | 10 | pub struct PioStepperProgram<'a, PIO: Instance> { |
diff --git a/embassy-rp/src/pio_programs/uart.rs b/embassy-rp/src/pio_programs/uart.rs index 04e39a571..444efb5db 100644 --- a/embassy-rp/src/pio_programs/uart.rs +++ b/embassy-rp/src/pio_programs/uart.rs | |||
| @@ -5,12 +5,12 @@ use core::convert::Infallible; | |||
| 5 | use embedded_io_async::{ErrorType, Read, Write}; | 5 | use embedded_io_async::{ErrorType, Read, Write}; |
| 6 | use fixed::traits::ToFixed; | 6 | use fixed::traits::ToFixed; |
| 7 | 7 | ||
| 8 | use crate::Peri; | ||
| 8 | use crate::clocks::clk_sys_freq; | 9 | use crate::clocks::clk_sys_freq; |
| 9 | use crate::gpio::Level; | 10 | use crate::gpio::Level; |
| 10 | use crate::pio::{ | 11 | use crate::pio::{ |
| 11 | Common, Config, Direction as PioDirection, FifoJoin, Instance, LoadedProgram, PioPin, ShiftDirection, StateMachine, | 12 | Common, Config, Direction as PioDirection, FifoJoin, Instance, LoadedProgram, PioPin, ShiftDirection, StateMachine, |
| 12 | }; | 13 | }; |
| 13 | use crate::Peri; | ||
| 14 | 14 | ||
| 15 | /// This struct represents a uart tx program loaded into pio instruction memory. | 15 | /// This struct represents a uart tx program loaded into pio instruction memory. |
| 16 | pub struct PioUartTxProgram<'d, PIO: Instance> { | 16 | pub struct PioUartTxProgram<'d, PIO: Instance> { |
diff --git a/embassy-rp/src/pio_programs/ws2812.rs b/embassy-rp/src/pio_programs/ws2812.rs index 37dd1c4e0..e6851b1a6 100644 --- a/embassy-rp/src/pio_programs/ws2812.rs +++ b/embassy-rp/src/pio_programs/ws2812.rs | |||
| @@ -4,12 +4,12 @@ use embassy_time::Timer; | |||
| 4 | use fixed::types::U24F8; | 4 | use fixed::types::U24F8; |
| 5 | use smart_leds::{RGB8, RGBW}; | 5 | use smart_leds::{RGB8, RGBW}; |
| 6 | 6 | ||
| 7 | use crate::Peri; | ||
| 7 | use crate::clocks::clk_sys_freq; | 8 | use crate::clocks::clk_sys_freq; |
| 8 | use crate::dma::{AnyChannel, Channel}; | 9 | use crate::dma::{AnyChannel, Channel}; |
| 9 | use crate::pio::{ | 10 | use crate::pio::{ |
| 10 | Common, Config, FifoJoin, Instance, LoadedProgram, PioPin, ShiftConfig, ShiftDirection, StateMachine, | 11 | Common, Config, FifoJoin, Instance, LoadedProgram, PioPin, ShiftConfig, ShiftDirection, StateMachine, |
| 11 | }; | 12 | }; |
| 12 | use crate::Peri; | ||
| 13 | 13 | ||
| 14 | const T1: u8 = 2; // start bit | 14 | const T1: u8 = 2; // start bit |
| 15 | const T2: u8 = 5; // data bit | 15 | const T2: u8 = 5; // data bit |
diff --git a/embassy-rp/src/psram.rs b/embassy-rp/src/psram.rs index 22eb1ed25..25185ead2 100644 --- a/embassy-rp/src/psram.rs +++ b/embassy-rp/src/psram.rs | |||
| @@ -10,7 +10,7 @@ | |||
| 10 | 10 | ||
| 11 | #![cfg(feature = "_rp235x")] | 11 | #![cfg(feature = "_rp235x")] |
| 12 | 12 | ||
| 13 | use critical_section::{acquire, release, CriticalSection, RestoreState}; | 13 | use critical_section::{CriticalSection, RestoreState, acquire, release}; |
| 14 | 14 | ||
| 15 | use crate::pac; | 15 | use crate::pac; |
| 16 | use crate::qmi_cs1::QmiCs1; | 16 | use crate::qmi_cs1::QmiCs1; |
diff --git a/embassy-rp/src/pwm.rs b/embassy-rp/src/pwm.rs index 1e1ccc4c6..59a3fc9a2 100644 --- a/embassy-rp/src/pwm.rs +++ b/embassy-rp/src/pwm.rs | |||
| @@ -3,13 +3,13 @@ | |||
| 3 | use embassy_hal_internal::{Peri, PeripheralType}; | 3 | use embassy_hal_internal::{Peri, PeripheralType}; |
| 4 | pub use embedded_hal_1::pwm::SetDutyCycle; | 4 | pub use embedded_hal_1::pwm::SetDutyCycle; |
| 5 | use embedded_hal_1::pwm::{Error, ErrorKind, ErrorType}; | 5 | use embedded_hal_1::pwm::{Error, ErrorKind, ErrorType}; |
| 6 | use fixed::traits::ToFixed; | ||
| 7 | use fixed::FixedU16; | 6 | use fixed::FixedU16; |
| 7 | use fixed::traits::ToFixed; | ||
| 8 | use pac::pwm::regs::{ChDiv, Intr}; | 8 | use pac::pwm::regs::{ChDiv, Intr}; |
| 9 | use pac::pwm::vals::Divmode; | 9 | use pac::pwm::vals::Divmode; |
| 10 | 10 | ||
| 11 | use crate::gpio::{AnyPin, Pin as GpioPin, Pull, SealedPin as _}; | 11 | use crate::gpio::{AnyPin, Pin as GpioPin, Pull, SealedPin as _}; |
| 12 | use crate::{pac, peripherals, RegExt}; | 12 | use crate::{RegExt, pac, peripherals}; |
| 13 | 13 | ||
| 14 | /// The configuration of a PWM slice. | 14 | /// The configuration of a PWM slice. |
| 15 | /// Note the period in clock cycles of a slice can be computed as: | 15 | /// Note the period in clock cycles of a slice can be computed as: |
diff --git a/embassy-rp/src/rtc/mod.rs b/embassy-rp/src/rtc/mod.rs index 8b0deed21..68fb3b765 100644 --- a/embassy-rp/src/rtc/mod.rs +++ b/embassy-rp/src/rtc/mod.rs | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | mod filter; | 2 | mod filter; |
| 3 | 3 | ||
| 4 | use core::future::poll_fn; | 4 | use core::future::poll_fn; |
| 5 | use core::sync::atomic::{compiler_fence, AtomicBool, Ordering}; | 5 | use core::sync::atomic::{AtomicBool, Ordering, compiler_fence}; |
| 6 | use core::task::Poll; | 6 | use core::task::Poll; |
| 7 | 7 | ||
| 8 | use embassy_hal_internal::{Peri, PeripheralType}; | 8 | use embassy_hal_internal::{Peri, PeripheralType}; |
diff --git a/embassy-rp/src/time_driver.rs b/embassy-rp/src/time_driver.rs index d598287a9..ec1c17ed5 100644 --- a/embassy-rp/src/time_driver.rs +++ b/embassy-rp/src/time_driver.rs | |||
| @@ -2,8 +2,8 @@ | |||
| 2 | use core::cell::{Cell, RefCell}; | 2 | use core::cell::{Cell, RefCell}; |
| 3 | 3 | ||
| 4 | use critical_section::CriticalSection; | 4 | use critical_section::CriticalSection; |
| 5 | use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex; | ||
| 6 | use embassy_sync::blocking_mutex::Mutex; | 5 | use embassy_sync::blocking_mutex::Mutex; |
| 6 | use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex; | ||
| 7 | use embassy_time_driver::Driver; | 7 | use embassy_time_driver::Driver; |
| 8 | use embassy_time_queue_utils::Queue; | 8 | use embassy_time_queue_utils::Queue; |
| 9 | #[cfg(feature = "rp2040")] | 9 | #[cfg(feature = "rp2040")] |
diff --git a/embassy-rp/src/uart/mod.rs b/embassy-rp/src/uart/mod.rs index 6f4e2ee07..43187df2d 100644 --- a/embassy-rp/src/uart/mod.rs +++ b/embassy-rp/src/uart/mod.rs | |||
| @@ -4,7 +4,7 @@ use core::marker::PhantomData; | |||
| 4 | use core::task::Poll; | 4 | use core::task::Poll; |
| 5 | 5 | ||
| 6 | use atomic_polyfill::{AtomicU16, Ordering}; | 6 | use atomic_polyfill::{AtomicU16, Ordering}; |
| 7 | use embassy_futures::select::{select, Either}; | 7 | use embassy_futures::select::{Either, select}; |
| 8 | use embassy_hal_internal::{Peri, PeripheralType}; | 8 | use embassy_hal_internal::{Peri, PeripheralType}; |
| 9 | use embassy_sync::waitqueue::AtomicWaker; | 9 | use embassy_sync::waitqueue::AtomicWaker; |
| 10 | use embassy_time::{Delay, Timer}; | 10 | use embassy_time::{Delay, Timer}; |
| @@ -16,7 +16,7 @@ use crate::gpio::{AnyPin, SealedPin}; | |||
| 16 | use crate::interrupt::typelevel::{Binding, Interrupt as _}; | 16 | use crate::interrupt::typelevel::{Binding, Interrupt as _}; |
| 17 | use crate::interrupt::{Interrupt, InterruptExt}; | 17 | use crate::interrupt::{Interrupt, InterruptExt}; |
| 18 | use crate::pac::io::vals::{Inover, Outover}; | 18 | use crate::pac::io::vals::{Inover, Outover}; |
| 19 | use crate::{interrupt, pac, peripherals, RegExt}; | 19 | use crate::{RegExt, interrupt, pac, peripherals}; |
| 20 | 20 | ||
| 21 | mod buffered; | 21 | mod buffered; |
| 22 | pub use buffered::{BufferedInterruptHandler, BufferedUart, BufferedUartRx, BufferedUartTx}; | 22 | pub use buffered::{BufferedInterruptHandler, BufferedUart, BufferedUartRx, BufferedUartTx}; |
| @@ -863,11 +863,7 @@ impl<'d, M: Mode> Uart<'d, M> { | |||
| 863 | if let Some(pin) = &tx { | 863 | if let Some(pin) = &tx { |
| 864 | let funcsel = { | 864 | let funcsel = { |
| 865 | let pin_number = ((pin.gpio().as_ptr() as u32) & 0x1FF) / 8; | 865 | let pin_number = ((pin.gpio().as_ptr() as u32) & 0x1FF) / 8; |
| 866 | if (pin_number % 4) == 0 { | 866 | if (pin_number % 4) == 0 { 2 } else { 11 } |
| 867 | 2 | ||
| 868 | } else { | ||
| 869 | 11 | ||
| 870 | } | ||
| 871 | }; | 867 | }; |
| 872 | pin.gpio().ctrl().write(|w| { | 868 | pin.gpio().ctrl().write(|w| { |
| 873 | w.set_funcsel(funcsel); | 869 | w.set_funcsel(funcsel); |
| @@ -886,11 +882,7 @@ impl<'d, M: Mode> Uart<'d, M> { | |||
| 886 | if let Some(pin) = &rx { | 882 | if let Some(pin) = &rx { |
| 887 | let funcsel = { | 883 | let funcsel = { |
| 888 | let pin_number = ((pin.gpio().as_ptr() as u32) & 0x1FF) / 8; | 884 | let pin_number = ((pin.gpio().as_ptr() as u32) & 0x1FF) / 8; |
| 889 | if ((pin_number - 1) % 4) == 0 { | 885 | if ((pin_number - 1) % 4) == 0 { 2 } else { 11 } |
| 890 | 2 | ||
| 891 | } else { | ||
| 892 | 11 | ||
| 893 | } | ||
| 894 | }; | 886 | }; |
| 895 | pin.gpio().ctrl().write(|w| { | 887 | pin.gpio().ctrl().write(|w| { |
| 896 | w.set_funcsel(funcsel); | 888 | w.set_funcsel(funcsel); |
diff --git a/embassy-rp/src/usb.rs b/embassy-rp/src/usb.rs index 671ecbd32..e8273c3f2 100644 --- a/embassy-rp/src/usb.rs +++ b/embassy-rp/src/usb.rs | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | use core::future::poll_fn; | 2 | use core::future::poll_fn; |
| 3 | use core::marker::PhantomData; | 3 | use core::marker::PhantomData; |
| 4 | use core::slice; | 4 | use core::slice; |
| 5 | use core::sync::atomic::{compiler_fence, Ordering}; | 5 | use core::sync::atomic::{Ordering, compiler_fence}; |
| 6 | use core::task::Poll; | 6 | use core::task::Poll; |
| 7 | 7 | ||
| 8 | use embassy_hal_internal::PeripheralType; | 8 | use embassy_hal_internal::PeripheralType; |
| @@ -13,7 +13,7 @@ use embassy_usb_driver::{ | |||
| 13 | }; | 13 | }; |
| 14 | 14 | ||
| 15 | use crate::interrupt::typelevel::{Binding, Interrupt}; | 15 | use crate::interrupt::typelevel::{Binding, Interrupt}; |
| 16 | use crate::{interrupt, pac, peripherals, Peri, RegExt}; | 16 | use crate::{Peri, RegExt, interrupt, pac, peripherals}; |
| 17 | 17 | ||
| 18 | trait SealedInstance { | 18 | trait SealedInstance { |
| 19 | fn regs() -> crate::pac::usb::Usb; | 19 | fn regs() -> crate::pac::usb::Usb; |
| @@ -545,11 +545,7 @@ impl<'d, T: Instance> driver::Endpoint for Endpoint<'d, T, In> { | |||
| 545 | poll_fn(|cx| { | 545 | poll_fn(|cx| { |
| 546 | EP_IN_WAKERS[index].register(cx.waker()); | 546 | EP_IN_WAKERS[index].register(cx.waker()); |
| 547 | let val = T::dpram().ep_in_control(self.info.addr.index() - 1).read(); | 547 | let val = T::dpram().ep_in_control(self.info.addr.index() - 1).read(); |
| 548 | if val.enable() { | 548 | if val.enable() { Poll::Ready(()) } else { Poll::Pending } |
| 549 | Poll::Ready(()) | ||
| 550 | } else { | ||
| 551 | Poll::Pending | ||
| 552 | } | ||
| 553 | }) | 549 | }) |
| 554 | .await; | 550 | .await; |
| 555 | trace!("wait_enabled IN OK"); | 551 | trace!("wait_enabled IN OK"); |
| @@ -567,11 +563,7 @@ impl<'d, T: Instance> driver::Endpoint for Endpoint<'d, T, Out> { | |||
| 567 | poll_fn(|cx| { | 563 | poll_fn(|cx| { |
| 568 | EP_OUT_WAKERS[index].register(cx.waker()); | 564 | EP_OUT_WAKERS[index].register(cx.waker()); |
| 569 | let val = T::dpram().ep_out_control(self.info.addr.index() - 1).read(); | 565 | let val = T::dpram().ep_out_control(self.info.addr.index() - 1).read(); |
| 570 | if val.enable() { | 566 | if val.enable() { Poll::Ready(()) } else { Poll::Pending } |
| 571 | Poll::Ready(()) | ||
| 572 | } else { | ||
| 573 | Poll::Pending | ||
| 574 | } | ||
| 575 | }) | 567 | }) |
| 576 | .await; | 568 | .await; |
| 577 | trace!("wait_enabled OUT OK"); | 569 | trace!("wait_enabled OUT OK"); |
diff --git a/embassy-rp/src/watchdog.rs b/embassy-rp/src/watchdog.rs index 49cf03850..d42601745 100644 --- a/embassy-rp/src/watchdog.rs +++ b/embassy-rp/src/watchdog.rs | |||
| @@ -11,7 +11,7 @@ use core::marker::PhantomData; | |||
| 11 | use embassy_time::Duration; | 11 | use embassy_time::Duration; |
| 12 | 12 | ||
| 13 | use crate::peripherals::WATCHDOG; | 13 | use crate::peripherals::WATCHDOG; |
| 14 | use crate::{pac, Peri}; | 14 | use crate::{Peri, pac}; |
| 15 | 15 | ||
| 16 | /// The reason for a system reset from the watchdog. | 16 | /// The reason for a system reset from the watchdog. |
| 17 | #[derive(Debug, Copy, Clone, PartialEq, Eq)] | 17 | #[derive(Debug, Copy, Clone, PartialEq, Eq)] |
diff --git a/embassy-stm32-wpan/src/cmd.rs b/embassy-stm32-wpan/src/cmd.rs index 928357384..5c81a4aa7 100644 --- a/embassy-stm32-wpan/src/cmd.rs +++ b/embassy-stm32-wpan/src/cmd.rs | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | use core::ptr; | 1 | use core::ptr; |
| 2 | 2 | ||
| 3 | use crate::consts::TlPacketType; | ||
| 4 | use crate::PacketHeader; | 3 | use crate::PacketHeader; |
| 4 | use crate::consts::TlPacketType; | ||
| 5 | 5 | ||
| 6 | #[derive(Copy, Clone)] | 6 | #[derive(Copy, Clone)] |
| 7 | #[repr(C, packed)] | 7 | #[repr(C, packed)] |
diff --git a/embassy-stm32-wpan/src/consts.rs b/embassy-stm32-wpan/src/consts.rs index e2ae6ca86..7ecb22974 100644 --- a/embassy-stm32-wpan/src/consts.rs +++ b/embassy-stm32-wpan/src/consts.rs | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | use crate::evt::CsEvt; | ||
| 2 | use crate::PacketHeader; | 1 | use crate::PacketHeader; |
| 2 | use crate::evt::CsEvt; | ||
| 3 | 3 | ||
| 4 | #[derive(Debug)] | 4 | #[derive(Debug)] |
| 5 | #[repr(C)] | 5 | #[repr(C)] |
diff --git a/embassy-stm32-wpan/src/lhci.rs b/embassy-stm32-wpan/src/lhci.rs index 89f204f99..59c8bfb5d 100644 --- a/embassy-stm32-wpan/src/lhci.rs +++ b/embassy-stm32-wpan/src/lhci.rs | |||
| @@ -1,9 +1,9 @@ | |||
| 1 | use core::ptr; | 1 | use core::ptr; |
| 2 | 2 | ||
| 3 | use crate::cmd::CmdPacket; | 3 | use crate::cmd::CmdPacket; |
| 4 | use crate::consts::{TlPacketType, TL_EVT_HEADER_SIZE}; | 4 | use crate::consts::{TL_EVT_HEADER_SIZE, TlPacketType}; |
| 5 | use crate::evt::{CcEvt, EvtPacket, EvtSerial}; | 5 | use crate::evt::{CcEvt, EvtPacket, EvtSerial}; |
| 6 | use crate::tables::{DeviceInfoTable, RssInfoTable, SafeBootInfoTable, WirelessFwInfoTable, TL_DEVICE_INFO_TABLE}; | 6 | use crate::tables::{DeviceInfoTable, RssInfoTable, SafeBootInfoTable, TL_DEVICE_INFO_TABLE, WirelessFwInfoTable}; |
| 7 | 7 | ||
| 8 | const TL_BLEEVT_CC_OPCODE: u8 = 0x0e; | 8 | const TL_BLEEVT_CC_OPCODE: u8 = 0x0e; |
| 9 | const LHCI_OPCODE_C1_DEVICE_INF: u16 = 0xfd62; | 9 | const LHCI_OPCODE_C1_DEVICE_INF: u16 = 0xfd62; |
diff --git a/embassy-stm32-wpan/src/lib.rs b/embassy-stm32-wpan/src/lib.rs index f4eb0069f..f6b1f6021 100644 --- a/embassy-stm32-wpan/src/lib.rs +++ b/embassy-stm32-wpan/src/lib.rs | |||
| @@ -22,7 +22,7 @@ | |||
| 22 | mod fmt; | 22 | mod fmt; |
| 23 | 23 | ||
| 24 | use core::mem::MaybeUninit; | 24 | use core::mem::MaybeUninit; |
| 25 | use core::sync::atomic::{compiler_fence, Ordering}; | 25 | use core::sync::atomic::{Ordering, compiler_fence}; |
| 26 | 26 | ||
| 27 | use embassy_hal_internal::Peri; | 27 | use embassy_hal_internal::Peri; |
| 28 | use embassy_stm32::interrupt; | 28 | use embassy_stm32::interrupt; |
| @@ -95,7 +95,7 @@ impl<'d> TlMbox<'d> { | |||
| 95 | pub fn init( | 95 | pub fn init( |
| 96 | ipcc: Peri<'d, IPCC>, | 96 | ipcc: Peri<'d, IPCC>, |
| 97 | _irqs: impl interrupt::typelevel::Binding<interrupt::typelevel::IPCC_C1_RX, ReceiveInterruptHandler> | 97 | _irqs: impl interrupt::typelevel::Binding<interrupt::typelevel::IPCC_C1_RX, ReceiveInterruptHandler> |
| 98 | + interrupt::typelevel::Binding<interrupt::typelevel::IPCC_C1_TX, TransmitInterruptHandler>, | 98 | + interrupt::typelevel::Binding<interrupt::typelevel::IPCC_C1_TX, TransmitInterruptHandler>, |
| 99 | config: Config, | 99 | config: Config, |
| 100 | ) -> Self { | 100 | ) -> Self { |
| 101 | // this is an inlined version of TL_Init from the STM32WB firmware as requested by AN5289. | 101 | // this is an inlined version of TL_Init from the STM32WB firmware as requested by AN5289. |
diff --git a/embassy-stm32-wpan/src/mac/driver.rs b/embassy-stm32-wpan/src/mac/driver.rs index 41cca09e3..480ac3790 100644 --- a/embassy-stm32-wpan/src/mac/driver.rs +++ b/embassy-stm32-wpan/src/mac/driver.rs | |||
| @@ -6,9 +6,9 @@ use embassy_net_driver::{Capabilities, HardwareAddress, LinkState}; | |||
| 6 | use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex; | 6 | use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex; |
| 7 | use embassy_sync::channel::Channel; | 7 | use embassy_sync::channel::Channel; |
| 8 | 8 | ||
| 9 | use crate::mac::MTU; | ||
| 9 | use crate::mac::event::MacEvent; | 10 | use crate::mac::event::MacEvent; |
| 10 | use crate::mac::runner::Runner; | 11 | use crate::mac::runner::Runner; |
| 11 | use crate::mac::MTU; | ||
| 12 | 12 | ||
| 13 | pub struct Driver<'d> { | 13 | pub struct Driver<'d> { |
| 14 | runner: &'d Runner<'d>, | 14 | runner: &'d Runner<'d>, |
diff --git a/embassy-stm32-wpan/src/mac/runner.rs b/embassy-stm32-wpan/src/mac/runner.rs index d3099b6b7..2409f994d 100644 --- a/embassy-stm32-wpan/src/mac/runner.rs +++ b/embassy-stm32-wpan/src/mac/runner.rs | |||
| @@ -7,10 +7,10 @@ use embassy_sync::channel::Channel; | |||
| 7 | use embassy_sync::mutex::Mutex; | 7 | use embassy_sync::mutex::Mutex; |
| 8 | use embassy_sync::signal::Signal; | 8 | use embassy_sync::signal::Signal; |
| 9 | 9 | ||
| 10 | use crate::mac::MTU; | ||
| 10 | use crate::mac::commands::DataRequest; | 11 | use crate::mac::commands::DataRequest; |
| 11 | use crate::mac::event::MacEvent; | 12 | use crate::mac::event::MacEvent; |
| 12 | use crate::mac::typedefs::{AddressMode, MacAddress, PanId, SecurityLevel}; | 13 | use crate::mac::typedefs::{AddressMode, MacAddress, PanId, SecurityLevel}; |
| 13 | use crate::mac::MTU; | ||
| 14 | use crate::sub::mac::Mac; | 14 | use crate::sub::mac::Mac; |
| 15 | 15 | ||
| 16 | type ZeroCopyPubSub<M, T> = blocking_mutex::Mutex<M, RefCell<Option<Signal<NoopRawMutex, T>>>>; | 16 | type ZeroCopyPubSub<M, T> = blocking_mutex::Mutex<M, RefCell<Option<Signal<NoopRawMutex, T>>>>; |
diff --git a/embassy-stm32-wpan/src/sub/ble.rs b/embassy-stm32-wpan/src/sub/ble.rs index 0f770d92c..cd69a0479 100644 --- a/embassy-stm32-wpan/src/sub/ble.rs +++ b/embassy-stm32-wpan/src/sub/ble.rs | |||
| @@ -4,10 +4,10 @@ use embassy_stm32::ipcc::Ipcc; | |||
| 4 | use hci::Opcode; | 4 | use hci::Opcode; |
| 5 | 5 | ||
| 6 | use crate::cmd::CmdPacket; | 6 | use crate::cmd::CmdPacket; |
| 7 | use crate::consts::{TlPacketType, TL_BLEEVT_CC_OPCODE, TL_BLEEVT_CS_OPCODE}; | 7 | use crate::consts::{TL_BLEEVT_CC_OPCODE, TL_BLEEVT_CS_OPCODE, TlPacketType}; |
| 8 | use crate::evt::{EvtBox, EvtPacket, EvtStub}; | 8 | use crate::evt::{EvtBox, EvtPacket, EvtStub}; |
| 9 | use crate::sub::mm; | 9 | use crate::sub::mm; |
| 10 | use crate::tables::{BleTable, BLE_CMD_BUFFER, CS_BUFFER, EVT_QUEUE, HCI_ACL_DATA_BUFFER, TL_BLE_TABLE}; | 10 | use crate::tables::{BLE_CMD_BUFFER, BleTable, CS_BUFFER, EVT_QUEUE, HCI_ACL_DATA_BUFFER, TL_BLE_TABLE}; |
| 11 | use crate::unsafe_linked_list::LinkedListNode; | 11 | use crate::unsafe_linked_list::LinkedListNode; |
| 12 | use crate::{channels, evt}; | 12 | use crate::{channels, evt}; |
| 13 | 13 | ||
diff --git a/embassy-stm32-wpan/src/sub/mm.rs b/embassy-stm32-wpan/src/sub/mm.rs index 4e4d2f854..62d0de8bd 100644 --- a/embassy-stm32-wpan/src/sub/mm.rs +++ b/embassy-stm32-wpan/src/sub/mm.rs | |||
| @@ -3,7 +3,7 @@ use core::future::poll_fn; | |||
| 3 | use core::mem::MaybeUninit; | 3 | use core::mem::MaybeUninit; |
| 4 | use core::task::Poll; | 4 | use core::task::Poll; |
| 5 | 5 | ||
| 6 | use aligned::{Aligned, A4}; | 6 | use aligned::{A4, Aligned}; |
| 7 | use cortex_m::interrupt; | 7 | use cortex_m::interrupt; |
| 8 | use embassy_stm32::ipcc::Ipcc; | 8 | use embassy_stm32::ipcc::Ipcc; |
| 9 | use embassy_sync::waitqueue::AtomicWaker; | 9 | use embassy_sync::waitqueue::AtomicWaker; |
| @@ -12,7 +12,7 @@ use crate::consts::POOL_SIZE; | |||
| 12 | use crate::evt::EvtPacket; | 12 | use crate::evt::EvtPacket; |
| 13 | #[cfg(feature = "ble")] | 13 | #[cfg(feature = "ble")] |
| 14 | use crate::tables::BLE_SPARE_EVT_BUF; | 14 | use crate::tables::BLE_SPARE_EVT_BUF; |
| 15 | use crate::tables::{MemManagerTable, EVT_POOL, FREE_BUF_QUEUE, SYS_SPARE_EVT_BUF, TL_MEM_MANAGER_TABLE}; | 15 | use crate::tables::{EVT_POOL, FREE_BUF_QUEUE, MemManagerTable, SYS_SPARE_EVT_BUF, TL_MEM_MANAGER_TABLE}; |
| 16 | use crate::unsafe_linked_list::LinkedListNode; | 16 | use crate::unsafe_linked_list::LinkedListNode; |
| 17 | use crate::{channels, evt}; | 17 | use crate::{channels, evt}; |
| 18 | 18 | ||
diff --git a/embassy-stm32-wpan/src/sub/sys.rs b/embassy-stm32-wpan/src/sub/sys.rs index cf6df58bf..8a3382f86 100644 --- a/embassy-stm32-wpan/src/sub/sys.rs +++ b/embassy-stm32-wpan/src/sub/sys.rs | |||
| @@ -8,7 +8,7 @@ use crate::shci::{SchiCommandStatus, ShciBleInitCmdParam, ShciOpcode}; | |||
| 8 | use crate::sub::mm; | 8 | use crate::sub::mm; |
| 9 | use crate::tables::{SysTable, WirelessFwInfoTable}; | 9 | use crate::tables::{SysTable, WirelessFwInfoTable}; |
| 10 | use crate::unsafe_linked_list::LinkedListNode; | 10 | use crate::unsafe_linked_list::LinkedListNode; |
| 11 | use crate::{channels, Ipcc, SYSTEM_EVT_QUEUE, SYS_CMD_BUF, TL_DEVICE_INFO_TABLE, TL_SYS_TABLE}; | 11 | use crate::{Ipcc, SYS_CMD_BUF, SYSTEM_EVT_QUEUE, TL_DEVICE_INFO_TABLE, TL_SYS_TABLE, channels}; |
| 12 | 12 | ||
| 13 | /// A guard that, once constructed, allows for sys commands to be sent to CPU2. | 13 | /// A guard that, once constructed, allows for sys commands to be sent to CPU2. |
| 14 | pub struct Sys { | 14 | pub struct Sys { |
| @@ -35,11 +35,7 @@ impl Sys { | |||
| 35 | let info = unsafe { TL_DEVICE_INFO_TABLE.as_mut_ptr().read_volatile().wireless_fw_info_table }; | 35 | let info = unsafe { TL_DEVICE_INFO_TABLE.as_mut_ptr().read_volatile().wireless_fw_info_table }; |
| 36 | 36 | ||
| 37 | // Zero version indicates that CPU2 wasn't active and didn't fill the information table | 37 | // Zero version indicates that CPU2 wasn't active and didn't fill the information table |
| 38 | if info.version != 0 { | 38 | if info.version != 0 { Some(info) } else { None } |
| 39 | Some(info) | ||
| 40 | } else { | ||
| 41 | None | ||
| 42 | } | ||
| 43 | } | 39 | } |
| 44 | 40 | ||
| 45 | pub async fn write(&self, opcode: ShciOpcode, payload: &[u8]) { | 41 | pub async fn write(&self, opcode: ShciOpcode, payload: &[u8]) { |
| @@ -66,8 +62,8 @@ impl Sys { | |||
| 66 | #[cfg(feature = "mac")] | 62 | #[cfg(feature = "mac")] |
| 67 | pub async fn shci_c2_mac_802_15_4_init(&self) -> Result<SchiCommandStatus, ()> { | 63 | pub async fn shci_c2_mac_802_15_4_init(&self) -> Result<SchiCommandStatus, ()> { |
| 68 | use crate::tables::{ | 64 | use crate::tables::{ |
| 69 | Mac802_15_4Table, TracesTable, MAC_802_15_4_CMD_BUFFER, MAC_802_15_4_NOTIF_RSP_EVT_BUFFER, | 65 | MAC_802_15_4_CMD_BUFFER, MAC_802_15_4_NOTIF_RSP_EVT_BUFFER, Mac802_15_4Table, TL_MAC_802_15_4_TABLE, |
| 70 | TL_MAC_802_15_4_TABLE, TL_TRACES_TABLE, TRACES_EVT_QUEUE, | 66 | TL_TRACES_TABLE, TRACES_EVT_QUEUE, TracesTable, |
| 71 | }; | 67 | }; |
| 72 | 68 | ||
| 73 | unsafe { | 69 | unsafe { |
diff --git a/embassy-stm32-wpan/src/tables.rs b/embassy-stm32-wpan/src/tables.rs index 204790e6d..1dafed159 100644 --- a/embassy-stm32-wpan/src/tables.rs +++ b/embassy-stm32-wpan/src/tables.rs | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | use core::mem::MaybeUninit; | 1 | use core::mem::MaybeUninit; |
| 2 | 2 | ||
| 3 | use aligned::{Aligned, A4}; | 3 | use aligned::{A4, Aligned}; |
| 4 | use bit_field::BitField; | 4 | use bit_field::BitField; |
| 5 | 5 | ||
| 6 | use crate::cmd::{AclDataPacket, CmdPacket}; | 6 | use crate::cmd::{AclDataPacket, CmdPacket}; |
diff --git a/embassy-stm32/build.rs b/embassy-stm32/build.rs index b5f1261fe..eea1acf68 100644 --- a/embassy-stm32/build.rs +++ b/embassy-stm32/build.rs | |||
| @@ -9,8 +9,8 @@ use proc_macro2::{Ident, TokenStream}; | |||
| 9 | use quote::{format_ident, quote}; | 9 | use quote::{format_ident, quote}; |
| 10 | use stm32_metapac::metadata::ir::BitOffset; | 10 | use stm32_metapac::metadata::ir::BitOffset; |
| 11 | use stm32_metapac::metadata::{ | 11 | use stm32_metapac::metadata::{ |
| 12 | MemoryRegion, MemoryRegionKind, PeripheralRccKernelClock, PeripheralRccRegister, PeripheralRegisters, StopMode, | 12 | ALL_CHIPS, ALL_PERIPHERAL_VERSIONS, METADATA, MemoryRegion, MemoryRegionKind, PeripheralRccKernelClock, |
| 13 | ALL_CHIPS, ALL_PERIPHERAL_VERSIONS, METADATA, | 13 | PeripheralRccRegister, PeripheralRegisters, StopMode, |
| 14 | }; | 14 | }; |
| 15 | 15 | ||
| 16 | #[path = "./build_common.rs"] | 16 | #[path = "./build_common.rs"] |
| @@ -105,7 +105,9 @@ fn main() { | |||
| 105 | } | 105 | } |
| 106 | (false, false) => { | 106 | (false, false) => { |
| 107 | if METADATA.memory.len() != 1 { | 107 | if METADATA.memory.len() != 1 { |
| 108 | panic!("Chip supports single and dual bank configuration. No Cargo feature to select one is enabled. Use the 'single-bank' or 'dual-bank' feature to make your selection") | 108 | panic!( |
| 109 | "Chip supports single and dual bank configuration. No Cargo feature to select one is enabled. Use the 'single-bank' or 'dual-bank' feature to make your selection" | ||
| 110 | ) | ||
| 109 | } | 111 | } |
| 110 | METADATA.memory[0] | 112 | METADATA.memory[0] |
| 111 | } | 113 | } |
diff --git a/embassy-stm32/src/adc/adc4.rs b/embassy-stm32/src/adc/adc4.rs index 255dc7956..2608160a3 100644 --- a/embassy-stm32/src/adc/adc4.rs +++ b/embassy-stm32/src/adc/adc4.rs | |||
| @@ -4,7 +4,7 @@ use pac::adc::vals::{Adc4Dmacfg as Dmacfg, Adc4Exten as Exten, Adc4OversamplingR | |||
| 4 | #[cfg(stm32wba)] | 4 | #[cfg(stm32wba)] |
| 5 | use pac::adc::vals::{Chselrmod, Cont, Dmacfg, Exten, OversamplingRatio, Ovss, Smpsel}; | 5 | use pac::adc::vals::{Chselrmod, Cont, Dmacfg, Exten, OversamplingRatio, Ovss, Smpsel}; |
| 6 | 6 | ||
| 7 | use super::{blocking_delay_us, AdcChannel, AnyAdcChannel, RxDma4, SealedAdcChannel}; | 7 | use super::{AdcChannel, AnyAdcChannel, RxDma4, SealedAdcChannel, blocking_delay_us}; |
| 8 | use crate::dma::Transfer; | 8 | use crate::dma::Transfer; |
| 9 | #[cfg(stm32u5)] | 9 | #[cfg(stm32u5)] |
| 10 | pub use crate::pac::adc::regs::Adc4Chselrmod0 as Chselr; | 10 | pub use crate::pac::adc::regs::Adc4Chselrmod0 as Chselr; |
| @@ -15,7 +15,7 @@ pub use crate::pac::adc::vals::{Adc4Presc as Presc, Adc4Res as Resolution, Adc4S | |||
| 15 | #[cfg(stm32wba)] | 15 | #[cfg(stm32wba)] |
| 16 | pub use crate::pac::adc::vals::{Presc, Res as Resolution, SampleTime}; | 16 | pub use crate::pac::adc::vals::{Presc, Res as Resolution, SampleTime}; |
| 17 | use crate::time::Hertz; | 17 | use crate::time::Hertz; |
| 18 | use crate::{pac, rcc, Peri}; | 18 | use crate::{Peri, pac, rcc}; |
| 19 | 19 | ||
| 20 | const MAX_ADC_CLK_FREQ: Hertz = Hertz::mhz(55); | 20 | const MAX_ADC_CLK_FREQ: Hertz = Hertz::mhz(55); |
| 21 | 21 | ||
| @@ -208,7 +208,10 @@ impl<'d, T: Instance> Adc4<'d, T> { | |||
| 208 | info!("ADC4 frequency set to {}", frequency); | 208 | info!("ADC4 frequency set to {}", frequency); |
| 209 | 209 | ||
| 210 | if frequency > MAX_ADC_CLK_FREQ { | 210 | if frequency > MAX_ADC_CLK_FREQ { |
| 211 | panic!("Maximal allowed frequency for ADC4 is {} MHz and it varies with different packages, refer to ST docs for more information.", MAX_ADC_CLK_FREQ.0 / 1_000_000 ); | 211 | panic!( |
| 212 | "Maximal allowed frequency for ADC4 is {} MHz and it varies with different packages, refer to ST docs for more information.", | ||
| 213 | MAX_ADC_CLK_FREQ.0 / 1_000_000 | ||
| 214 | ); | ||
| 212 | } | 215 | } |
| 213 | 216 | ||
| 214 | let mut s = Self { adc }; | 217 | let mut s = Self { adc }; |
diff --git a/embassy-stm32/src/adc/c0.rs b/embassy-stm32/src/adc/c0.rs index f2837a8f1..fc28df346 100644 --- a/embassy-stm32/src/adc/c0.rs +++ b/embassy-stm32/src/adc/c0.rs | |||
| @@ -4,11 +4,11 @@ use pac::adc::vals::{Adstp, Align, Ckmode, Dmacfg, Exten, Ovrmod, Ovsr}; | |||
| 4 | use pac::adccommon::vals::Presc; | 4 | use pac::adccommon::vals::Presc; |
| 5 | 5 | ||
| 6 | use super::{ | 6 | use super::{ |
| 7 | blocking_delay_us, Adc, AdcChannel, AnyAdcChannel, Instance, Resolution, RxDma, SampleTime, SealedAdcChannel, | 7 | Adc, AdcChannel, AnyAdcChannel, Instance, Resolution, RxDma, SampleTime, SealedAdcChannel, blocking_delay_us, |
| 8 | }; | 8 | }; |
| 9 | use crate::dma::Transfer; | 9 | use crate::dma::Transfer; |
| 10 | use crate::time::Hertz; | 10 | use crate::time::Hertz; |
| 11 | use crate::{pac, rcc, Peri}; | 11 | use crate::{Peri, pac, rcc}; |
| 12 | 12 | ||
| 13 | /// Default VREF voltage used for sample conversion to millivolts. | 13 | /// Default VREF voltage used for sample conversion to millivolts. |
| 14 | pub const VREF_DEFAULT_MV: u32 = 3300; | 14 | pub const VREF_DEFAULT_MV: u32 = 3300; |
| @@ -168,7 +168,10 @@ impl<'d, T: Instance> Adc<'d, T> { | |||
| 168 | debug!("ADC frequency set to {}", frequency); | 168 | debug!("ADC frequency set to {}", frequency); |
| 169 | 169 | ||
| 170 | if frequency > MAX_ADC_CLK_FREQ { | 170 | if frequency > MAX_ADC_CLK_FREQ { |
| 171 | panic!("Maximal allowed frequency for the ADC is {} MHz and it varies with different packages, refer to ST docs for more information.", MAX_ADC_CLK_FREQ.0 / 1_000_000 ); | 171 | panic!( |
| 172 | "Maximal allowed frequency for the ADC is {} MHz and it varies with different packages, refer to ST docs for more information.", | ||
| 173 | MAX_ADC_CLK_FREQ.0 / 1_000_000 | ||
| 174 | ); | ||
| 172 | } | 175 | } |
| 173 | 176 | ||
| 174 | let mut s = Self { | 177 | let mut s = Self { |
diff --git a/embassy-stm32/src/adc/f1.rs b/embassy-stm32/src/adc/f1.rs index 3cdc9d8fb..f9c23d72b 100644 --- a/embassy-stm32/src/adc/f1.rs +++ b/embassy-stm32/src/adc/f1.rs | |||
| @@ -7,7 +7,7 @@ use crate::adc::{Adc, AdcChannel, Instance, SampleTime}; | |||
| 7 | use crate::interrupt::typelevel::Interrupt; | 7 | use crate::interrupt::typelevel::Interrupt; |
| 8 | use crate::interrupt::{self}; | 8 | use crate::interrupt::{self}; |
| 9 | use crate::time::Hertz; | 9 | use crate::time::Hertz; |
| 10 | use crate::{rcc, Peri}; | 10 | use crate::{Peri, rcc}; |
| 11 | 11 | ||
| 12 | pub const VDDA_CALIB_MV: u32 = 3300; | 12 | pub const VDDA_CALIB_MV: u32 = 3300; |
| 13 | pub const ADC_MAX: u32 = (1 << 12) - 1; | 13 | pub const ADC_MAX: u32 = (1 << 12) - 1; |
diff --git a/embassy-stm32/src/adc/f3.rs b/embassy-stm32/src/adc/f3.rs index 3aeb6f2c7..73ceb087a 100644 --- a/embassy-stm32/src/adc/f3.rs +++ b/embassy-stm32/src/adc/f3.rs | |||
| @@ -6,7 +6,7 @@ use super::blocking_delay_us; | |||
| 6 | use crate::adc::{Adc, AdcChannel, Instance, SampleTime}; | 6 | use crate::adc::{Adc, AdcChannel, Instance, SampleTime}; |
| 7 | use crate::interrupt::typelevel::Interrupt; | 7 | use crate::interrupt::typelevel::Interrupt; |
| 8 | use crate::time::Hertz; | 8 | use crate::time::Hertz; |
| 9 | use crate::{interrupt, rcc, Peri}; | 9 | use crate::{Peri, interrupt, rcc}; |
| 10 | 10 | ||
| 11 | pub const VDDA_CALIB_MV: u32 = 3300; | 11 | pub const VDDA_CALIB_MV: u32 = 3300; |
| 12 | pub const ADC_MAX: u32 = (1 << 12) - 1; | 12 | pub const ADC_MAX: u32 = (1 << 12) - 1; |
diff --git a/embassy-stm32/src/adc/f3_v1_1.rs b/embassy-stm32/src/adc/f3_v1_1.rs index 84613078c..cd5de54f5 100644 --- a/embassy-stm32/src/adc/f3_v1_1.rs +++ b/embassy-stm32/src/adc/f3_v1_1.rs | |||
| @@ -9,7 +9,7 @@ use super::Resolution; | |||
| 9 | use crate::adc::{Adc, AdcChannel, Instance, SampleTime}; | 9 | use crate::adc::{Adc, AdcChannel, Instance, SampleTime}; |
| 10 | use crate::interrupt::typelevel::Interrupt; | 10 | use crate::interrupt::typelevel::Interrupt; |
| 11 | use crate::time::Hertz; | 11 | use crate::time::Hertz; |
| 12 | use crate::{interrupt, rcc, Peri}; | 12 | use crate::{Peri, interrupt, rcc}; |
| 13 | 13 | ||
| 14 | const ADC_FREQ: Hertz = crate::rcc::HSI_FREQ; | 14 | const ADC_FREQ: Hertz = crate::rcc::HSI_FREQ; |
| 15 | 15 | ||
diff --git a/embassy-stm32/src/adc/g4.rs b/embassy-stm32/src/adc/g4.rs index 43498966f..5098aadd8 100644 --- a/embassy-stm32/src/adc/g4.rs +++ b/embassy-stm32/src/adc/g4.rs | |||
| @@ -7,11 +7,11 @@ use pac::adc::vals::{Adcaldif, Difsel, Exten, Rovsm, Trovs}; | |||
| 7 | use pac::adccommon::vals::Presc; | 7 | use pac::adccommon::vals::Presc; |
| 8 | use stm32_metapac::adc::vals::{Adstp, Dmacfg, Dmaen}; | 8 | use stm32_metapac::adc::vals::{Adstp, Dmacfg, Dmaen}; |
| 9 | 9 | ||
| 10 | use super::{blocking_delay_us, Adc, AdcChannel, AnyAdcChannel, Instance, Resolution, RxDma, SampleTime}; | 10 | use super::{Adc, AdcChannel, AnyAdcChannel, Instance, Resolution, RxDma, SampleTime, blocking_delay_us}; |
| 11 | use crate::adc::SealedAdcChannel; | 11 | use crate::adc::SealedAdcChannel; |
| 12 | use crate::dma::Transfer; | 12 | use crate::dma::Transfer; |
| 13 | use crate::time::Hertz; | 13 | use crate::time::Hertz; |
| 14 | use crate::{pac, rcc, Peri}; | 14 | use crate::{Peri, pac, rcc}; |
| 15 | 15 | ||
| 16 | /// Default VREF voltage used for sample conversion to millivolts. | 16 | /// Default VREF voltage used for sample conversion to millivolts. |
| 17 | pub const VREF_DEFAULT_MV: u32 = 3300; | 17 | pub const VREF_DEFAULT_MV: u32 = 3300; |
| @@ -133,7 +133,10 @@ impl<'d, T: Instance> Adc<'d, T> { | |||
| 133 | trace!("ADC frequency set to {}", frequency); | 133 | trace!("ADC frequency set to {}", frequency); |
| 134 | 134 | ||
| 135 | if frequency > MAX_ADC_CLK_FREQ { | 135 | if frequency > MAX_ADC_CLK_FREQ { |
| 136 | panic!("Maximal allowed frequency for the ADC is {} MHz and it varies with different packages, refer to ST docs for more information.", MAX_ADC_CLK_FREQ.0 / 1_000_000 ); | 136 | panic!( |
| 137 | "Maximal allowed frequency for the ADC is {} MHz and it varies with different packages, refer to ST docs for more information.", | ||
| 138 | MAX_ADC_CLK_FREQ.0 / 1_000_000 | ||
| 139 | ); | ||
| 137 | } | 140 | } |
| 138 | 141 | ||
| 139 | let mut s = Self { | 142 | let mut s = Self { |
diff --git a/embassy-stm32/src/adc/mod.rs b/embassy-stm32/src/adc/mod.rs index ea986f4cf..22ed8295f 100644 --- a/embassy-stm32/src/adc/mod.rs +++ b/embassy-stm32/src/adc/mod.rs | |||
| @@ -22,7 +22,7 @@ use core::marker::PhantomData; | |||
| 22 | #[allow(unused)] | 22 | #[allow(unused)] |
| 23 | #[cfg(not(any(adc_f3v3, adc_wba)))] | 23 | #[cfg(not(any(adc_f3v3, adc_wba)))] |
| 24 | pub use _version::*; | 24 | pub use _version::*; |
| 25 | use embassy_hal_internal::{impl_peripheral, PeripheralType}; | 25 | use embassy_hal_internal::{PeripheralType, impl_peripheral}; |
| 26 | #[cfg(any(adc_f1, adc_f3v1, adc_v1, adc_l0, adc_f3v2))] | 26 | #[cfg(any(adc_f1, adc_f3v1, adc_v1, adc_l0, adc_f3v2))] |
| 27 | use embassy_sync::waitqueue::AtomicWaker; | 27 | use embassy_sync::waitqueue::AtomicWaker; |
| 28 | 28 | ||
diff --git a/embassy-stm32/src/adc/ringbuffered_v2.rs b/embassy-stm32/src/adc/ringbuffered_v2.rs index 6f69e8486..9b2e5b8fe 100644 --- a/embassy-stm32/src/adc/ringbuffered_v2.rs +++ b/embassy-stm32/src/adc/ringbuffered_v2.rs | |||
| @@ -1,13 +1,13 @@ | |||
| 1 | use core::marker::PhantomData; | 1 | use core::marker::PhantomData; |
| 2 | use core::mem; | 2 | use core::mem; |
| 3 | use core::sync::atomic::{compiler_fence, Ordering}; | 3 | use core::sync::atomic::{Ordering, compiler_fence}; |
| 4 | 4 | ||
| 5 | use stm32_metapac::adc::vals::SampleTime; | 5 | use stm32_metapac::adc::vals::SampleTime; |
| 6 | 6 | ||
| 7 | use crate::adc::{Adc, AdcChannel, Instance, RxDma}; | 7 | use crate::adc::{Adc, AdcChannel, Instance, RxDma}; |
| 8 | use crate::dma::{Priority, ReadableRingBuffer, TransferOptions}; | 8 | use crate::dma::{Priority, ReadableRingBuffer, TransferOptions}; |
| 9 | use crate::pac::adc::vals; | 9 | use crate::pac::adc::vals; |
| 10 | use crate::{rcc, Peri}; | 10 | use crate::{Peri, rcc}; |
| 11 | 11 | ||
| 12 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 12 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 13 | pub struct OverrunError; | 13 | pub struct OverrunError; |
diff --git a/embassy-stm32/src/adc/v1.rs b/embassy-stm32/src/adc/v1.rs index d09374876..a5869d110 100644 --- a/embassy-stm32/src/adc/v1.rs +++ b/embassy-stm32/src/adc/v1.rs | |||
| @@ -9,7 +9,7 @@ use super::blocking_delay_us; | |||
| 9 | use crate::adc::{Adc, AdcChannel, Instance, Resolution, SampleTime}; | 9 | use crate::adc::{Adc, AdcChannel, Instance, Resolution, SampleTime}; |
| 10 | use crate::interrupt::typelevel::Interrupt; | 10 | use crate::interrupt::typelevel::Interrupt; |
| 11 | use crate::peripherals::ADC1; | 11 | use crate::peripherals::ADC1; |
| 12 | use crate::{interrupt, rcc, Peri}; | 12 | use crate::{Peri, interrupt, rcc}; |
| 13 | 13 | ||
| 14 | mod watchdog_v1; | 14 | mod watchdog_v1; |
| 15 | pub use watchdog_v1::WatchdogChannels; | 15 | pub use watchdog_v1::WatchdogChannels; |
| @@ -66,11 +66,7 @@ pub struct Temperature; | |||
| 66 | impl AdcChannel<ADC1> for Temperature {} | 66 | impl AdcChannel<ADC1> for Temperature {} |
| 67 | impl super::SealedAdcChannel<ADC1> for Temperature { | 67 | impl super::SealedAdcChannel<ADC1> for Temperature { |
| 68 | fn channel(&self) -> u8 { | 68 | fn channel(&self) -> u8 { |
| 69 | if cfg!(adc_l0) { | 69 | if cfg!(adc_l0) { 18 } else { 16 } |
| 70 | 18 | ||
| 71 | } else { | ||
| 72 | 16 | ||
| 73 | } | ||
| 74 | } | 70 | } |
| 75 | } | 71 | } |
| 76 | 72 | ||
diff --git a/embassy-stm32/src/adc/v2.rs b/embassy-stm32/src/adc/v2.rs index e94a25b24..93ec78548 100644 --- a/embassy-stm32/src/adc/v2.rs +++ b/embassy-stm32/src/adc/v2.rs | |||
| @@ -2,7 +2,7 @@ use super::blocking_delay_us; | |||
| 2 | use crate::adc::{Adc, AdcChannel, Instance, Resolution, SampleTime}; | 2 | use crate::adc::{Adc, AdcChannel, Instance, Resolution, SampleTime}; |
| 3 | use crate::peripherals::ADC1; | 3 | use crate::peripherals::ADC1; |
| 4 | use crate::time::Hertz; | 4 | use crate::time::Hertz; |
| 5 | use crate::{rcc, Peri}; | 5 | use crate::{Peri, rcc}; |
| 6 | 6 | ||
| 7 | mod ringbuffered_v2; | 7 | mod ringbuffered_v2; |
| 8 | pub use ringbuffered_v2::{RingBufferedAdc, Sequence}; | 8 | pub use ringbuffered_v2::{RingBufferedAdc, Sequence}; |
diff --git a/embassy-stm32/src/adc/v3.rs b/embassy-stm32/src/adc/v3.rs index 16063ce4d..47632263b 100644 --- a/embassy-stm32/src/adc/v3.rs +++ b/embassy-stm32/src/adc/v3.rs | |||
| @@ -10,10 +10,10 @@ use pac::adc::vals::{OversamplingRatio, OversamplingShift, Rovsm, Trovs}; | |||
| 10 | pub use pac::adc::vals::{Ovsr, Ovss, Presc}; | 10 | pub use pac::adc::vals::{Ovsr, Ovss, Presc}; |
| 11 | 11 | ||
| 12 | use super::{ | 12 | use super::{ |
| 13 | blocking_delay_us, Adc, AdcChannel, AnyAdcChannel, Instance, Resolution, RxDma, SampleTime, SealedAdcChannel, | 13 | Adc, AdcChannel, AnyAdcChannel, Instance, Resolution, RxDma, SampleTime, SealedAdcChannel, blocking_delay_us, |
| 14 | }; | 14 | }; |
| 15 | use crate::dma::Transfer; | 15 | use crate::dma::Transfer; |
| 16 | use crate::{pac, rcc, Peri}; | 16 | use crate::{Peri, pac, rcc}; |
| 17 | 17 | ||
| 18 | /// Default VREF voltage used for sample conversion to millivolts. | 18 | /// Default VREF voltage used for sample conversion to millivolts. |
| 19 | pub const VREF_DEFAULT_MV: u32 = 3300; | 19 | pub const VREF_DEFAULT_MV: u32 = 3300; |
diff --git a/embassy-stm32/src/adc/v4.rs b/embassy-stm32/src/adc/v4.rs index b66437e6e..c7d0103a6 100644 --- a/embassy-stm32/src/adc/v4.rs +++ b/embassy-stm32/src/adc/v4.rs | |||
| @@ -5,11 +5,11 @@ use pac::adc::vals::{Adstp, Difsel, Dmngt, Exten, Pcsel}; | |||
| 5 | use pac::adccommon::vals::Presc; | 5 | use pac::adccommon::vals::Presc; |
| 6 | 6 | ||
| 7 | use super::{ | 7 | use super::{ |
| 8 | blocking_delay_us, Adc, AdcChannel, AnyAdcChannel, Instance, Resolution, RxDma, SampleTime, SealedAdcChannel, | 8 | Adc, AdcChannel, AnyAdcChannel, Instance, Resolution, RxDma, SampleTime, SealedAdcChannel, blocking_delay_us, |
| 9 | }; | 9 | }; |
| 10 | use crate::dma::Transfer; | 10 | use crate::dma::Transfer; |
| 11 | use crate::time::Hertz; | 11 | use crate::time::Hertz; |
| 12 | use crate::{pac, rcc, Peri}; | 12 | use crate::{Peri, pac, rcc}; |
| 13 | 13 | ||
| 14 | /// Default VREF voltage used for sample conversion to millivolts. | 14 | /// Default VREF voltage used for sample conversion to millivolts. |
| 15 | pub const VREF_DEFAULT_MV: u32 = 3300; | 15 | pub const VREF_DEFAULT_MV: u32 = 3300; |
| @@ -171,7 +171,10 @@ impl<'d, T: Instance> Adc<'d, T> { | |||
| 171 | info!("ADC frequency set to {}", frequency); | 171 | info!("ADC frequency set to {}", frequency); |
| 172 | 172 | ||
| 173 | if frequency > MAX_ADC_CLK_FREQ { | 173 | if frequency > MAX_ADC_CLK_FREQ { |
| 174 | panic!("Maximal allowed frequency for the ADC is {} MHz and it varies with different packages, refer to ST docs for more information.", MAX_ADC_CLK_FREQ.0 / 1_000_000 ); | 174 | panic!( |
| 175 | "Maximal allowed frequency for the ADC is {} MHz and it varies with different packages, refer to ST docs for more information.", | ||
| 176 | MAX_ADC_CLK_FREQ.0 / 1_000_000 | ||
| 177 | ); | ||
| 175 | } | 178 | } |
| 176 | 179 | ||
| 177 | #[cfg(stm32h7)] | 180 | #[cfg(stm32h7)] |
diff --git a/embassy-stm32/src/can/bxcan/mod.rs b/embassy-stm32/src/can/bxcan/mod.rs index 8eb188560..507350c42 100644 --- a/embassy-stm32/src/can/bxcan/mod.rs +++ b/embassy-stm32/src/can/bxcan/mod.rs | |||
| @@ -5,8 +5,8 @@ use core::future::poll_fn; | |||
| 5 | use core::marker::PhantomData; | 5 | use core::marker::PhantomData; |
| 6 | use core::task::Poll; | 6 | use core::task::Poll; |
| 7 | 7 | ||
| 8 | use embassy_hal_internal::interrupt::InterruptExt; | ||
| 9 | use embassy_hal_internal::PeripheralType; | 8 | use embassy_hal_internal::PeripheralType; |
| 9 | use embassy_hal_internal::interrupt::InterruptExt; | ||
| 10 | use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex; | 10 | use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex; |
| 11 | use embassy_sync::channel::Channel; | 11 | use embassy_sync::channel::Channel; |
| 12 | use embassy_sync::waitqueue::AtomicWaker; | 12 | use embassy_sync::waitqueue::AtomicWaker; |
| @@ -22,7 +22,7 @@ use crate::can::enums::{BusError, RefCountOp, TryReadError}; | |||
| 22 | use crate::gpio::{AfType, OutputType, Pull, Speed}; | 22 | use crate::gpio::{AfType, OutputType, Pull, Speed}; |
| 23 | use crate::interrupt::typelevel::Interrupt; | 23 | use crate::interrupt::typelevel::Interrupt; |
| 24 | use crate::rcc::{self, RccPeripheral}; | 24 | use crate::rcc::{self, RccPeripheral}; |
| 25 | use crate::{interrupt, peripherals, Peri}; | 25 | use crate::{Peri, interrupt, peripherals}; |
| 26 | 26 | ||
| 27 | /// Interrupt handler. | 27 | /// Interrupt handler. |
| 28 | pub struct TxInterruptHandler<T: Instance> { | 28 | pub struct TxInterruptHandler<T: Instance> { |
| @@ -186,10 +186,10 @@ impl<'d> Can<'d> { | |||
| 186 | rx: Peri<'d, if_afio!(impl RxPin<T, A>)>, | 186 | rx: Peri<'d, if_afio!(impl RxPin<T, A>)>, |
| 187 | tx: Peri<'d, if_afio!(impl TxPin<T, A>)>, | 187 | tx: Peri<'d, if_afio!(impl TxPin<T, A>)>, |
| 188 | _irqs: impl interrupt::typelevel::Binding<T::TXInterrupt, TxInterruptHandler<T>> | 188 | _irqs: impl interrupt::typelevel::Binding<T::TXInterrupt, TxInterruptHandler<T>> |
| 189 | + interrupt::typelevel::Binding<T::RX0Interrupt, Rx0InterruptHandler<T>> | 189 | + interrupt::typelevel::Binding<T::RX0Interrupt, Rx0InterruptHandler<T>> |
| 190 | + interrupt::typelevel::Binding<T::RX1Interrupt, Rx1InterruptHandler<T>> | 190 | + interrupt::typelevel::Binding<T::RX1Interrupt, Rx1InterruptHandler<T>> |
| 191 | + interrupt::typelevel::Binding<T::SCEInterrupt, SceInterruptHandler<T>> | 191 | + interrupt::typelevel::Binding<T::SCEInterrupt, SceInterruptHandler<T>> |
| 192 | + 'd, | 192 | + 'd, |
| 193 | ) -> Self { | 193 | ) -> Self { |
| 194 | let info = T::info(); | 194 | let info = T::info(); |
| 195 | let regs = &T::info().regs; | 195 | let regs = &T::info().regs; |
diff --git a/embassy-stm32/src/can/fd/config.rs b/embassy-stm32/src/can/fd/config.rs index c6a66b469..e08349f02 100644 --- a/embassy-stm32/src/can/fd/config.rs +++ b/embassy-stm32/src/can/fd/config.rs | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | //! Configuration for FDCAN Module | 1 | //! Configuration for FDCAN Module |
| 2 | // Note: This file is copied and modified from fdcan crate by Richard Meadows | 2 | // Note: This file is copied and modified from fdcan crate by Richard Meadows |
| 3 | 3 | ||
| 4 | use core::num::{NonZeroU16, NonZeroU8}; | 4 | use core::num::{NonZeroU8, NonZeroU16}; |
| 5 | 5 | ||
| 6 | /// Configures the bit timings. | 6 | /// Configures the bit timings. |
| 7 | /// | 7 | /// |
diff --git a/embassy-stm32/src/can/fdcan.rs b/embassy-stm32/src/can/fdcan.rs index d8f71e03e..a142a6d63 100644 --- a/embassy-stm32/src/can/fdcan.rs +++ b/embassy-stm32/src/can/fdcan.rs | |||
| @@ -3,8 +3,8 @@ use core::future::poll_fn; | |||
| 3 | use core::marker::PhantomData; | 3 | use core::marker::PhantomData; |
| 4 | use core::task::Poll; | 4 | use core::task::Poll; |
| 5 | 5 | ||
| 6 | use embassy_hal_internal::interrupt::InterruptExt; | ||
| 7 | use embassy_hal_internal::PeripheralType; | 6 | use embassy_hal_internal::PeripheralType; |
| 7 | use embassy_hal_internal::interrupt::InterruptExt; | ||
| 8 | use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex; | 8 | use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex; |
| 9 | use embassy_sync::channel::Channel; | 9 | use embassy_sync::channel::Channel; |
| 10 | use embassy_sync::waitqueue::AtomicWaker; | 10 | use embassy_sync::waitqueue::AtomicWaker; |
| @@ -13,7 +13,7 @@ use crate::can::fd::peripheral::Registers; | |||
| 13 | use crate::gpio::{AfType, OutputType, Pull, SealedPin as _, Speed}; | 13 | use crate::gpio::{AfType, OutputType, Pull, SealedPin as _, Speed}; |
| 14 | use crate::interrupt::typelevel::Interrupt; | 14 | use crate::interrupt::typelevel::Interrupt; |
| 15 | use crate::rcc::{self, RccPeripheral}; | 15 | use crate::rcc::{self, RccPeripheral}; |
| 16 | use crate::{interrupt, peripherals, Peri}; | 16 | use crate::{Peri, interrupt, peripherals}; |
| 17 | 17 | ||
| 18 | pub(crate) mod fd; | 18 | pub(crate) mod fd; |
| 19 | 19 | ||
| @@ -182,8 +182,8 @@ impl<'d> CanConfigurator<'d> { | |||
| 182 | rx: Peri<'d, impl RxPin<T>>, | 182 | rx: Peri<'d, impl RxPin<T>>, |
| 183 | tx: Peri<'d, impl TxPin<T>>, | 183 | tx: Peri<'d, impl TxPin<T>>, |
| 184 | _irqs: impl interrupt::typelevel::Binding<T::IT0Interrupt, IT0InterruptHandler<T>> | 184 | _irqs: impl interrupt::typelevel::Binding<T::IT0Interrupt, IT0InterruptHandler<T>> |
| 185 | + interrupt::typelevel::Binding<T::IT1Interrupt, IT1InterruptHandler<T>> | 185 | + interrupt::typelevel::Binding<T::IT1Interrupt, IT1InterruptHandler<T>> |
| 186 | + 'd, | 186 | + 'd, |
| 187 | ) -> CanConfigurator<'d> { | 187 | ) -> CanConfigurator<'d> { |
| 188 | set_as_af!(rx, AfType::input(Pull::None)); | 188 | set_as_af!(rx, AfType::input(Pull::None)); |
| 189 | set_as_af!(tx, AfType::output(OutputType::PushPull, Speed::VeryHigh)); | 189 | set_as_af!(tx, AfType::output(OutputType::PushPull, Speed::VeryHigh)); |
| @@ -459,7 +459,7 @@ impl<'c, 'd, const TX_BUF_SIZE: usize, const RX_BUF_SIZE: usize> BufferedCan<'d, | |||
| 459 | pub async fn write(&mut self, frame: Frame) { | 459 | pub async fn write(&mut self, frame: Frame) { |
| 460 | self.tx_buf.send(frame).await; | 460 | self.tx_buf.send(frame).await; |
| 461 | self.info.interrupt0.pend(); // Wake for Tx | 461 | self.info.interrupt0.pend(); // Wake for Tx |
| 462 | //T::IT0Interrupt::pend(); // Wake for Tx | 462 | //T::IT0Interrupt::pend(); // Wake for Tx |
| 463 | } | 463 | } |
| 464 | 464 | ||
| 465 | /// Async read frame from RX buffer. | 465 | /// Async read frame from RX buffer. |
| @@ -548,7 +548,7 @@ impl<'c, 'd, const TX_BUF_SIZE: usize, const RX_BUF_SIZE: usize> BufferedCanFd<' | |||
| 548 | pub async fn write(&mut self, frame: FdFrame) { | 548 | pub async fn write(&mut self, frame: FdFrame) { |
| 549 | self.tx_buf.send(frame).await; | 549 | self.tx_buf.send(frame).await; |
| 550 | self.info.interrupt0.pend(); // Wake for Tx | 550 | self.info.interrupt0.pend(); // Wake for Tx |
| 551 | //T::IT0Interrupt::pend(); // Wake for Tx | 551 | //T::IT0Interrupt::pend(); // Wake for Tx |
| 552 | } | 552 | } |
| 553 | 553 | ||
| 554 | /// Async read frame from RX buffer. | 554 | /// Async read frame from RX buffer. |
diff --git a/embassy-stm32/src/can/util.rs b/embassy-stm32/src/can/util.rs index fcdbbad62..6d7f0c16a 100644 --- a/embassy-stm32/src/can/util.rs +++ b/embassy-stm32/src/can/util.rs | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | //! Utility functions shared between CAN controller types. | 1 | //! Utility functions shared between CAN controller types. |
| 2 | 2 | ||
| 3 | use core::num::{NonZeroU16, NonZeroU8}; | 3 | use core::num::{NonZeroU8, NonZeroU16}; |
| 4 | 4 | ||
| 5 | /// Shared struct to represent bit timings used by calc_can_timings. | 5 | /// Shared struct to represent bit timings used by calc_can_timings. |
| 6 | #[derive(Clone, Copy, Debug)] | 6 | #[derive(Clone, Copy, Debug)] |
diff --git a/embassy-stm32/src/crc/v1.rs b/embassy-stm32/src/crc/v1.rs index 13e5263de..836228599 100644 --- a/embassy-stm32/src/crc/v1.rs +++ b/embassy-stm32/src/crc/v1.rs | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | use crate::pac::CRC as PAC_CRC; | 1 | use crate::pac::CRC as PAC_CRC; |
| 2 | use crate::peripherals::CRC; | 2 | use crate::peripherals::CRC; |
| 3 | use crate::{rcc, Peri}; | 3 | use crate::{Peri, rcc}; |
| 4 | 4 | ||
| 5 | /// CRC driver. | 5 | /// CRC driver. |
| 6 | pub struct Crc<'d> { | 6 | pub struct Crc<'d> { |
diff --git a/embassy-stm32/src/crc/v2v3.rs b/embassy-stm32/src/crc/v2v3.rs index d834d0971..a566a2e04 100644 --- a/embassy-stm32/src/crc/v2v3.rs +++ b/embassy-stm32/src/crc/v2v3.rs | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | use crate::pac::crc::vals; | ||
| 2 | use crate::pac::CRC as PAC_CRC; | 1 | use crate::pac::CRC as PAC_CRC; |
| 2 | use crate::pac::crc::vals; | ||
| 3 | use crate::peripherals::CRC; | 3 | use crate::peripherals::CRC; |
| 4 | use crate::{rcc, Peri}; | 4 | use crate::{Peri, rcc}; |
| 5 | 5 | ||
| 6 | /// CRC driver. | 6 | /// CRC driver. |
| 7 | pub struct Crc<'d> { | 7 | pub struct Crc<'d> { |
diff --git a/embassy-stm32/src/cryp/mod.rs b/embassy-stm32/src/cryp/mod.rs index 0173b2b5d..4f1115fb7 100644 --- a/embassy-stm32/src/cryp/mod.rs +++ b/embassy-stm32/src/cryp/mod.rs | |||
| @@ -1236,7 +1236,10 @@ impl<'d, T: Instance, M: Mode> Cryp<'d, T, M> { | |||
| 1236 | } | 1236 | } |
| 1237 | if C::REQUIRES_PADDING { | 1237 | if C::REQUIRES_PADDING { |
| 1238 | if last_block_remainder != 0 { | 1238 | if last_block_remainder != 0 { |
| 1239 | panic!("Input must be a multiple of {} bytes in ECB and CBC modes. Consider padding or ciphertext stealing.", C::BLOCK_SIZE); | 1239 | panic!( |
| 1240 | "Input must be a multiple of {} bytes in ECB and CBC modes. Consider padding or ciphertext stealing.", | ||
| 1241 | C::BLOCK_SIZE | ||
| 1242 | ); | ||
| 1240 | } | 1243 | } |
| 1241 | } | 1244 | } |
| 1242 | if last_block { | 1245 | if last_block { |
| @@ -1703,7 +1706,10 @@ impl<'d, T: Instance> Cryp<'d, T, Async> { | |||
| 1703 | } | 1706 | } |
| 1704 | if C::REQUIRES_PADDING { | 1707 | if C::REQUIRES_PADDING { |
| 1705 | if last_block_remainder != 0 { | 1708 | if last_block_remainder != 0 { |
| 1706 | panic!("Input must be a multiple of {} bytes in ECB and CBC modes. Consider padding or ciphertext stealing.", C::BLOCK_SIZE); | 1709 | panic!( |
| 1710 | "Input must be a multiple of {} bytes in ECB and CBC modes. Consider padding or ciphertext stealing.", | ||
| 1711 | C::BLOCK_SIZE | ||
| 1712 | ); | ||
| 1707 | } | 1713 | } |
| 1708 | } | 1714 | } |
| 1709 | if last_block { | 1715 | if last_block { |
diff --git a/embassy-stm32/src/dac/mod.rs b/embassy-stm32/src/dac/mod.rs index 08e001337..d74d4a4be 100644 --- a/embassy-stm32/src/dac/mod.rs +++ b/embassy-stm32/src/dac/mod.rs | |||
| @@ -8,7 +8,7 @@ use crate::mode::{Async, Blocking, Mode as PeriMode}; | |||
| 8 | #[cfg(any(dac_v3, dac_v4, dac_v5, dac_v6, dac_v7))] | 8 | #[cfg(any(dac_v3, dac_v4, dac_v5, dac_v6, dac_v7))] |
| 9 | use crate::pac::dac; | 9 | use crate::pac::dac; |
| 10 | use crate::rcc::{self, RccPeripheral}; | 10 | use crate::rcc::{self, RccPeripheral}; |
| 11 | use crate::{peripherals, Peri}; | 11 | use crate::{Peri, peripherals}; |
| 12 | 12 | ||
| 13 | mod tsel; | 13 | mod tsel; |
| 14 | use embassy_hal_internal::PeripheralType; | 14 | use embassy_hal_internal::PeripheralType; |
diff --git a/embassy-stm32/src/dcmi.rs b/embassy-stm32/src/dcmi.rs index bd03f1e00..dcae9f298 100644 --- a/embassy-stm32/src/dcmi.rs +++ b/embassy-stm32/src/dcmi.rs | |||
| @@ -9,7 +9,7 @@ use embassy_sync::waitqueue::AtomicWaker; | |||
| 9 | use crate::dma::Transfer; | 9 | use crate::dma::Transfer; |
| 10 | use crate::gpio::{AfType, Pull}; | 10 | use crate::gpio::{AfType, Pull}; |
| 11 | use crate::interrupt::typelevel::Interrupt; | 11 | use crate::interrupt::typelevel::Interrupt; |
| 12 | use crate::{interrupt, rcc, Peri}; | 12 | use crate::{Peri, interrupt, rcc}; |
| 13 | 13 | ||
| 14 | /// Interrupt handler. | 14 | /// Interrupt handler. |
| 15 | pub struct InterruptHandler<T: Instance> { | 15 | pub struct InterruptHandler<T: Instance> { |
diff --git a/embassy-stm32/src/dma/dma_bdma.rs b/embassy-stm32/src/dma/dma_bdma.rs index 73ecab070..90dbf4f09 100644 --- a/embassy-stm32/src/dma/dma_bdma.rs +++ b/embassy-stm32/src/dma/dma_bdma.rs | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | use core::future::{poll_fn, Future}; | 1 | use core::future::{Future, poll_fn}; |
| 2 | use core::pin::Pin; | 2 | use core::pin::Pin; |
| 3 | use core::sync::atomic::{fence, AtomicUsize, Ordering}; | 3 | use core::sync::atomic::{AtomicUsize, Ordering, fence}; |
| 4 | use core::task::{Context, Poll, Waker}; | 4 | use core::task::{Context, Poll, Waker}; |
| 5 | 5 | ||
| 6 | use embassy_hal_internal::Peri; | 6 | use embassy_hal_internal::Peri; |
diff --git a/embassy-stm32/src/dma/gpdma/mod.rs b/embassy-stm32/src/dma/gpdma/mod.rs index 4a14c2a8e..3e117c331 100644 --- a/embassy-stm32/src/dma/gpdma/mod.rs +++ b/embassy-stm32/src/dma/gpdma/mod.rs | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | 2 | ||
| 3 | use core::future::Future; | 3 | use core::future::Future; |
| 4 | use core::pin::Pin; | 4 | use core::pin::Pin; |
| 5 | use core::sync::atomic::{fence, AtomicUsize, Ordering}; | 5 | use core::sync::atomic::{AtomicUsize, Ordering, fence}; |
| 6 | use core::task::{Context, Poll}; | 6 | use core::task::{Context, Poll}; |
| 7 | 7 | ||
| 8 | use embassy_hal_internal::Peri; | 8 | use embassy_hal_internal::Peri; |
diff --git a/embassy-stm32/src/dma/gpdma/ringbuffered.rs b/embassy-stm32/src/dma/gpdma/ringbuffered.rs index 9ee52193b..94c597e0d 100644 --- a/embassy-stm32/src/dma/gpdma/ringbuffered.rs +++ b/embassy-stm32/src/dma/gpdma/ringbuffered.rs | |||
| @@ -3,12 +3,12 @@ | |||
| 3 | //! FIXME: Add request_pause functionality? | 3 | //! FIXME: Add request_pause functionality? |
| 4 | //! FIXME: Stop the DMA, if a user does not queue new transfers (chain of linked-list items ends automatically). | 4 | //! FIXME: Stop the DMA, if a user does not queue new transfers (chain of linked-list items ends automatically). |
| 5 | use core::future::poll_fn; | 5 | use core::future::poll_fn; |
| 6 | use core::sync::atomic::{fence, Ordering}; | 6 | use core::sync::atomic::{Ordering, fence}; |
| 7 | use core::task::Waker; | 7 | use core::task::Waker; |
| 8 | 8 | ||
| 9 | use embassy_hal_internal::Peri; | 9 | use embassy_hal_internal::Peri; |
| 10 | 10 | ||
| 11 | use super::{AnyChannel, TransferOptions, STATE}; | 11 | use super::{AnyChannel, STATE, TransferOptions}; |
| 12 | use crate::dma::gpdma::linked_list::{RunMode, Table}; | 12 | use crate::dma::gpdma::linked_list::{RunMode, Table}; |
| 13 | use crate::dma::ringbuffer::{DmaCtrl, Error, ReadableDmaRingBuffer, WritableDmaRingBuffer}; | 13 | use crate::dma::ringbuffer::{DmaCtrl, Error, ReadableDmaRingBuffer, WritableDmaRingBuffer}; |
| 14 | use crate::dma::word::Word; | 14 | use crate::dma::word::Word; |
diff --git a/embassy-stm32/src/dma/mod.rs b/embassy-stm32/src/dma/mod.rs index 5989bfd7c..297fa3674 100644 --- a/embassy-stm32/src/dma/mod.rs +++ b/embassy-stm32/src/dma/mod.rs | |||
| @@ -24,7 +24,7 @@ pub(crate) use util::*; | |||
| 24 | pub(crate) mod ringbuffer; | 24 | pub(crate) mod ringbuffer; |
| 25 | pub mod word; | 25 | pub mod word; |
| 26 | 26 | ||
| 27 | use embassy_hal_internal::{impl_peripheral, PeripheralType}; | 27 | use embassy_hal_internal::{PeripheralType, impl_peripheral}; |
| 28 | 28 | ||
| 29 | use crate::interrupt; | 29 | use crate::interrupt; |
| 30 | 30 | ||
diff --git a/embassy-stm32/src/dma/ringbuffer/tests/prop_test/mod.rs b/embassy-stm32/src/dma/ringbuffer/tests/prop_test/mod.rs index 661fb1728..eff5b4058 100644 --- a/embassy-stm32/src/dma/ringbuffer/tests/prop_test/mod.rs +++ b/embassy-stm32/src/dma/ringbuffer/tests/prop_test/mod.rs | |||
| @@ -2,7 +2,7 @@ use std::task::Waker; | |||
| 2 | 2 | ||
| 3 | use proptest::prop_oneof; | 3 | use proptest::prop_oneof; |
| 4 | use proptest::strategy::{self, BoxedStrategy, Strategy as _}; | 4 | use proptest::strategy::{self, BoxedStrategy, Strategy as _}; |
| 5 | use proptest_state_machine::{prop_state_machine, ReferenceStateMachine, StateMachineTest}; | 5 | use proptest_state_machine::{ReferenceStateMachine, StateMachineTest, prop_state_machine}; |
| 6 | 6 | ||
| 7 | use super::*; | 7 | use super::*; |
| 8 | 8 | ||
diff --git a/embassy-stm32/src/dsihost.rs b/embassy-stm32/src/dsihost.rs index deda956af..fd1682d2b 100644 --- a/embassy-stm32/src/dsihost.rs +++ b/embassy-stm32/src/dsihost.rs | |||
| @@ -7,7 +7,7 @@ use embassy_hal_internal::PeripheralType; | |||
| 7 | //use crate::gpio::{AnyPin, SealedPin}; | 7 | //use crate::gpio::{AnyPin, SealedPin}; |
| 8 | use crate::gpio::{AfType, AnyPin, OutputType, Speed}; | 8 | use crate::gpio::{AfType, AnyPin, OutputType, Speed}; |
| 9 | use crate::rcc::{self, RccPeripheral}; | 9 | use crate::rcc::{self, RccPeripheral}; |
| 10 | use crate::{peripherals, Peri}; | 10 | use crate::{Peri, peripherals}; |
| 11 | 11 | ||
| 12 | /// Performs a busy-wait delay for a specified number of microseconds. | 12 | /// Performs a busy-wait delay for a specified number of microseconds. |
| 13 | pub fn blocking_delay_ms(ms: u32) { | 13 | pub fn blocking_delay_ms(ms: u32) { |
diff --git a/embassy-stm32/src/dts/mod.rs b/embassy-stm32/src/dts/mod.rs index 1f39c8db5..a75ae0560 100644 --- a/embassy-stm32/src/dts/mod.rs +++ b/embassy-stm32/src/dts/mod.rs | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | //! Digital Temperature Sensor (DTS) | 1 | //! Digital Temperature Sensor (DTS) |
| 2 | 2 | ||
| 3 | use core::future::poll_fn; | 3 | use core::future::poll_fn; |
| 4 | use core::sync::atomic::{compiler_fence, Ordering}; | 4 | use core::sync::atomic::{Ordering, compiler_fence}; |
| 5 | use core::task::Poll; | 5 | use core::task::Poll; |
| 6 | 6 | ||
| 7 | use embassy_hal_internal::Peri; | 7 | use embassy_hal_internal::Peri; |
diff --git a/embassy-stm32/src/eth/v1/mod.rs b/embassy-stm32/src/eth/v1/mod.rs index 5be1c9739..a77eb8719 100644 --- a/embassy-stm32/src/eth/v1/mod.rs +++ b/embassy-stm32/src/eth/v1/mod.rs | |||
| @@ -4,7 +4,7 @@ mod rx_desc; | |||
| 4 | mod tx_desc; | 4 | mod tx_desc; |
| 5 | 5 | ||
| 6 | use core::marker::PhantomData; | 6 | use core::marker::PhantomData; |
| 7 | use core::sync::atomic::{fence, Ordering}; | 7 | use core::sync::atomic::{Ordering, fence}; |
| 8 | 8 | ||
| 9 | use embassy_hal_internal::Peri; | 9 | use embassy_hal_internal::Peri; |
| 10 | use stm32_metapac::eth::vals::{Apcs, Cr, Dm, DmaomrSr, Fes, Ftf, Ifg, MbProgress, Mw, Pbl, Rsf, St, Tsf}; | 10 | use stm32_metapac::eth::vals::{Apcs, Cr, Dm, DmaomrSr, Fes, Ftf, Ifg, MbProgress, Mw, Pbl, Rsf, St, Tsf}; |
| @@ -190,7 +190,7 @@ impl<'d, T: Instance, P: Phy> Ethernet<'d, T, P> { | |||
| 190 | w.set_apcs(Apcs::STRIP); // automatic padding and crc stripping | 190 | w.set_apcs(Apcs::STRIP); // automatic padding and crc stripping |
| 191 | w.set_fes(Fes::FES100); // fast ethernet speed | 191 | w.set_fes(Fes::FES100); // fast ethernet speed |
| 192 | w.set_dm(Dm::FULL_DUPLEX); // full duplex | 192 | w.set_dm(Dm::FULL_DUPLEX); // full duplex |
| 193 | // TODO: Carrier sense ? ECRSFD | 193 | // TODO: Carrier sense ? ECRSFD |
| 194 | }); | 194 | }); |
| 195 | 195 | ||
| 196 | // Set the mac to pass all multicast packets | 196 | // Set the mac to pass all multicast packets |
| @@ -350,7 +350,9 @@ impl<'d, T: Instance, P: Phy> Ethernet<'d, T, P> { | |||
| 350 | } | 350 | } |
| 351 | 351 | ||
| 352 | #[cfg(any(eth_v1b, eth_v1c))] | 352 | #[cfg(any(eth_v1b, eth_v1c))] |
| 353 | config_pins!(rx_clk, tx_clk, mdio, mdc, rxdv, rx_d0, rx_d1, rx_d2, rx_d3, tx_d0, tx_d1, tx_d2, tx_d3, tx_en); | 353 | config_pins!( |
| 354 | rx_clk, tx_clk, mdio, mdc, rxdv, rx_d0, rx_d1, rx_d2, rx_d3, tx_d0, tx_d1, tx_d2, tx_d3, tx_en | ||
| 355 | ); | ||
| 354 | 356 | ||
| 355 | let pins = Pins::Mii([ | 357 | let pins = Pins::Mii([ |
| 356 | rx_clk.into(), | 358 | rx_clk.into(), |
diff --git a/embassy-stm32/src/eth/v1/rx_desc.rs b/embassy-stm32/src/eth/v1/rx_desc.rs index 2a46c1895..6ade1f29c 100644 --- a/embassy-stm32/src/eth/v1/rx_desc.rs +++ b/embassy-stm32/src/eth/v1/rx_desc.rs | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | use core::sync::atomic::{compiler_fence, fence, Ordering}; | 1 | use core::sync::atomic::{Ordering, compiler_fence, fence}; |
| 2 | 2 | ||
| 3 | use stm32_metapac::eth::vals::{Rpd, Rps}; | 3 | use stm32_metapac::eth::vals::{Rpd, Rps}; |
| 4 | use vcell::VolatileCell; | 4 | use vcell::VolatileCell; |
diff --git a/embassy-stm32/src/eth/v1/tx_desc.rs b/embassy-stm32/src/eth/v1/tx_desc.rs index 1317d20f4..ba99b66cb 100644 --- a/embassy-stm32/src/eth/v1/tx_desc.rs +++ b/embassy-stm32/src/eth/v1/tx_desc.rs | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | use core::sync::atomic::{compiler_fence, fence, Ordering}; | 1 | use core::sync::atomic::{Ordering, compiler_fence, fence}; |
| 2 | 2 | ||
| 3 | use vcell::VolatileCell; | 3 | use vcell::VolatileCell; |
| 4 | 4 | ||
diff --git a/embassy-stm32/src/eth/v2/descriptors.rs b/embassy-stm32/src/eth/v2/descriptors.rs index 645bfdb14..e335ed8f3 100644 --- a/embassy-stm32/src/eth/v2/descriptors.rs +++ b/embassy-stm32/src/eth/v2/descriptors.rs | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | use core::sync::atomic::{fence, Ordering}; | 1 | use core::sync::atomic::{Ordering, fence}; |
| 2 | 2 | ||
| 3 | use vcell::VolatileCell; | 3 | use vcell::VolatileCell; |
| 4 | 4 | ||
diff --git a/embassy-stm32/src/eth/v2/mod.rs b/embassy-stm32/src/eth/v2/mod.rs index cf7a9901b..39a6e8b0f 100644 --- a/embassy-stm32/src/eth/v2/mod.rs +++ b/embassy-stm32/src/eth/v2/mod.rs | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | mod descriptors; | 1 | mod descriptors; |
| 2 | 2 | ||
| 3 | use core::marker::PhantomData; | 3 | use core::marker::PhantomData; |
| 4 | use core::sync::atomic::{fence, Ordering}; | 4 | use core::sync::atomic::{Ordering, fence}; |
| 5 | 5 | ||
| 6 | use embassy_hal_internal::Peri; | 6 | use embassy_hal_internal::Peri; |
| 7 | use stm32_metapac::syscfg::vals::EthSelPhy; | 7 | use stm32_metapac::syscfg::vals::EthSelPhy; |
| @@ -144,7 +144,9 @@ impl<'d, T: Instance, P: Phy> Ethernet<'d, T, P> { | |||
| 144 | .modify(|w| w.set_eth_sel_phy(EthSelPhy::MII_GMII)); | 144 | .modify(|w| w.set_eth_sel_phy(EthSelPhy::MII_GMII)); |
| 145 | }); | 145 | }); |
| 146 | 146 | ||
| 147 | config_pins!(rx_clk, tx_clk, mdio, mdc, rxdv, rx_d0, rx_d1, rx_d2, rx_d3, tx_d0, tx_d1, tx_d2, tx_d3, tx_en); | 147 | config_pins!( |
| 148 | rx_clk, tx_clk, mdio, mdc, rxdv, rx_d0, rx_d1, rx_d2, rx_d3, tx_d0, tx_d1, tx_d2, tx_d3, tx_en | ||
| 149 | ); | ||
| 148 | 150 | ||
| 149 | let pins = Pins::Mii([ | 151 | let pins = Pins::Mii([ |
| 150 | rx_clk.into(), | 152 | rx_clk.into(), |
diff --git a/embassy-stm32/src/exti.rs b/embassy-stm32/src/exti.rs index 9fce78f95..12600d4eb 100644 --- a/embassy-stm32/src/exti.rs +++ b/embassy-stm32/src/exti.rs | |||
| @@ -5,13 +5,13 @@ use core::marker::PhantomData; | |||
| 5 | use core::pin::Pin; | 5 | use core::pin::Pin; |
| 6 | use core::task::{Context, Poll}; | 6 | use core::task::{Context, Poll}; |
| 7 | 7 | ||
| 8 | use embassy_hal_internal::{impl_peripheral, PeripheralType}; | 8 | use embassy_hal_internal::{PeripheralType, impl_peripheral}; |
| 9 | use embassy_sync::waitqueue::AtomicWaker; | 9 | use embassy_sync::waitqueue::AtomicWaker; |
| 10 | 10 | ||
| 11 | use crate::gpio::{AnyPin, Input, Level, Pin as GpioPin, Pull}; | 11 | use crate::gpio::{AnyPin, Input, Level, Pin as GpioPin, Pull}; |
| 12 | use crate::pac::exti::regs::Lines; | ||
| 13 | use crate::pac::EXTI; | 12 | use crate::pac::EXTI; |
| 14 | use crate::{interrupt, pac, peripherals, Peri}; | 13 | use crate::pac::exti::regs::Lines; |
| 14 | use crate::{Peri, interrupt, pac, peripherals}; | ||
| 15 | 15 | ||
| 16 | const EXTI_COUNT: usize = 16; | 16 | const EXTI_COUNT: usize = 16; |
| 17 | static EXTI_WAKERS: [AtomicWaker; EXTI_COUNT] = [const { AtomicWaker::new() }; EXTI_COUNT]; | 17 | static EXTI_WAKERS: [AtomicWaker; EXTI_COUNT] = [const { AtomicWaker::new() }; EXTI_COUNT]; |
diff --git a/embassy-stm32/src/flash/asynch.rs b/embassy-stm32/src/flash/asynch.rs index 006dcddeb..a131217b7 100644 --- a/embassy-stm32/src/flash/asynch.rs +++ b/embassy-stm32/src/flash/asynch.rs | |||
| @@ -1,17 +1,17 @@ | |||
| 1 | use core::marker::PhantomData; | 1 | use core::marker::PhantomData; |
| 2 | use core::sync::atomic::{fence, Ordering}; | 2 | use core::sync::atomic::{Ordering, fence}; |
| 3 | 3 | ||
| 4 | use embassy_hal_internal::drop::OnDrop; | 4 | use embassy_hal_internal::drop::OnDrop; |
| 5 | use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex; | 5 | use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex; |
| 6 | use embassy_sync::mutex::Mutex; | 6 | use embassy_sync::mutex::Mutex; |
| 7 | 7 | ||
| 8 | use super::{ | 8 | use super::{ |
| 9 | blocking_read, ensure_sector_aligned, family, get_flash_regions, get_sector, Async, Error, Flash, FlashLayout, | 9 | Async, Error, FLASH_BASE, FLASH_SIZE, Flash, FlashLayout, WRITE_SIZE, blocking_read, ensure_sector_aligned, family, |
| 10 | FLASH_BASE, FLASH_SIZE, WRITE_SIZE, | 10 | get_flash_regions, get_sector, |
| 11 | }; | 11 | }; |
| 12 | use crate::interrupt::InterruptExt; | 12 | use crate::interrupt::InterruptExt; |
| 13 | use crate::peripherals::FLASH; | 13 | use crate::peripherals::FLASH; |
| 14 | use crate::{interrupt, Peri}; | 14 | use crate::{Peri, interrupt}; |
| 15 | 15 | ||
| 16 | pub(super) static REGION_ACCESS: Mutex<CriticalSectionRawMutex, ()> = Mutex::new(()); | 16 | pub(super) static REGION_ACCESS: Mutex<CriticalSectionRawMutex, ()> = Mutex::new(()); |
| 17 | 17 | ||
diff --git a/embassy-stm32/src/flash/common.rs b/embassy-stm32/src/flash/common.rs index 10023e637..b595938a6 100644 --- a/embassy-stm32/src/flash/common.rs +++ b/embassy-stm32/src/flash/common.rs | |||
| @@ -1,14 +1,14 @@ | |||
| 1 | use core::marker::PhantomData; | 1 | use core::marker::PhantomData; |
| 2 | use core::sync::atomic::{fence, Ordering}; | 2 | use core::sync::atomic::{Ordering, fence}; |
| 3 | 3 | ||
| 4 | use embassy_hal_internal::drop::OnDrop; | 4 | use embassy_hal_internal::drop::OnDrop; |
| 5 | 5 | ||
| 6 | use super::{ | 6 | use super::{ |
| 7 | family, get_flash_regions, Async, Blocking, Error, FlashBank, FlashLayout, FlashRegion, FlashSector, FLASH_SIZE, | 7 | Async, Blocking, Error, FLASH_SIZE, FlashBank, FlashLayout, FlashRegion, FlashSector, MAX_ERASE_SIZE, READ_SIZE, |
| 8 | MAX_ERASE_SIZE, READ_SIZE, WRITE_SIZE, | 8 | WRITE_SIZE, family, get_flash_regions, |
| 9 | }; | 9 | }; |
| 10 | use crate::Peri; | ||
| 11 | use crate::_generated::FLASH_BASE; | 10 | use crate::_generated::FLASH_BASE; |
| 11 | use crate::Peri; | ||
| 12 | use crate::peripherals::FLASH; | 12 | use crate::peripherals::FLASH; |
| 13 | 13 | ||
| 14 | /// Internal flash memory driver. | 14 | /// Internal flash memory driver. |
diff --git a/embassy-stm32/src/flash/eeprom.rs b/embassy-stm32/src/flash/eeprom.rs index cc3529eb9..39c497e3f 100644 --- a/embassy-stm32/src/flash/eeprom.rs +++ b/embassy-stm32/src/flash/eeprom.rs | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | use embassy_hal_internal::drop::OnDrop; | 1 | use embassy_hal_internal::drop::OnDrop; |
| 2 | 2 | ||
| 3 | use super::{family, Blocking, Error, Flash, EEPROM_BASE, EEPROM_SIZE}; | 3 | use super::{Blocking, EEPROM_BASE, EEPROM_SIZE, Error, Flash, family}; |
| 4 | 4 | ||
| 5 | #[cfg(eeprom)] | 5 | #[cfg(eeprom)] |
| 6 | impl<'d> Flash<'d, Blocking> { | 6 | impl<'d> Flash<'d, Blocking> { |
diff --git a/embassy-stm32/src/flash/f0.rs b/embassy-stm32/src/flash/f0.rs index 3f9dbe945..5c01fce9c 100644 --- a/embassy-stm32/src/flash/f0.rs +++ b/embassy-stm32/src/flash/f0.rs | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | use core::ptr::write_volatile; | 1 | use core::ptr::write_volatile; |
| 2 | use core::sync::atomic::{fence, Ordering}; | 2 | use core::sync::atomic::{Ordering, fence}; |
| 3 | 3 | ||
| 4 | use super::{FlashSector, WRITE_SIZE}; | 4 | use super::{FlashSector, WRITE_SIZE}; |
| 5 | use crate::flash::Error; | 5 | use crate::flash::Error; |
diff --git a/embassy-stm32/src/flash/f1f3.rs b/embassy-stm32/src/flash/f1f3.rs index bf9ad2893..9e469ffbc 100644 --- a/embassy-stm32/src/flash/f1f3.rs +++ b/embassy-stm32/src/flash/f1f3.rs | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | use core::ptr::write_volatile; | 1 | use core::ptr::write_volatile; |
| 2 | use core::sync::atomic::{fence, Ordering}; | 2 | use core::sync::atomic::{Ordering, fence}; |
| 3 | 3 | ||
| 4 | use super::{FlashSector, WRITE_SIZE}; | 4 | use super::{FlashSector, WRITE_SIZE}; |
| 5 | use crate::flash::Error; | 5 | use crate::flash::Error; |
diff --git a/embassy-stm32/src/flash/f2.rs b/embassy-stm32/src/flash/f2.rs index 67e380619..b48ab3b76 100644 --- a/embassy-stm32/src/flash/f2.rs +++ b/embassy-stm32/src/flash/f2.rs | |||
| @@ -1,9 +1,9 @@ | |||
| 1 | use core::ptr::write_volatile; | 1 | use core::ptr::write_volatile; |
| 2 | use core::sync::atomic::{fence, AtomicBool, Ordering}; | 2 | use core::sync::atomic::{AtomicBool, Ordering, fence}; |
| 3 | 3 | ||
| 4 | use pac::flash::regs::Sr; | 4 | use pac::flash::regs::Sr; |
| 5 | 5 | ||
| 6 | use super::{get_flash_regions, FlashBank, FlashSector, WRITE_SIZE}; | 6 | use super::{FlashBank, FlashSector, WRITE_SIZE, get_flash_regions}; |
| 7 | use crate::flash::Error; | 7 | use crate::flash::Error; |
| 8 | use crate::pac; | 8 | use crate::pac; |
| 9 | 9 | ||
diff --git a/embassy-stm32/src/flash/f4.rs b/embassy-stm32/src/flash/f4.rs index 62e0492b5..9c5051492 100644 --- a/embassy-stm32/src/flash/f4.rs +++ b/embassy-stm32/src/flash/f4.rs | |||
| @@ -1,10 +1,10 @@ | |||
| 1 | use core::ptr::write_volatile; | 1 | use core::ptr::write_volatile; |
| 2 | use core::sync::atomic::{fence, AtomicBool, Ordering}; | 2 | use core::sync::atomic::{AtomicBool, Ordering, fence}; |
| 3 | 3 | ||
| 4 | use embassy_sync::waitqueue::AtomicWaker; | 4 | use embassy_sync::waitqueue::AtomicWaker; |
| 5 | use pac::flash::regs::Sr; | 5 | use pac::flash::regs::Sr; |
| 6 | 6 | ||
| 7 | use super::{get_flash_regions, FlashBank, FlashSector, WRITE_SIZE}; | 7 | use super::{FlashBank, FlashSector, WRITE_SIZE, get_flash_regions}; |
| 8 | use crate::_generated::FLASH_SIZE; | 8 | use crate::_generated::FLASH_SIZE; |
| 9 | use crate::flash::Error; | 9 | use crate::flash::Error; |
| 10 | use crate::pac; | 10 | use crate::pac; |
| @@ -246,7 +246,9 @@ pub(crate) fn assert_not_corrupted_read(end_address: u32) { | |||
| 246 | feature = "stm32f439zi", | 246 | feature = "stm32f439zi", |
| 247 | ))] | 247 | ))] |
| 248 | if second_bank_read && pac::DBGMCU.idcode().read().rev_id() < REVISION_3 && !pa12_is_output_pull_low() { | 248 | if second_bank_read && pac::DBGMCU.idcode().read().rev_id() < REVISION_3 && !pa12_is_output_pull_low() { |
| 249 | panic!("Read corruption for stm32f42xxI and stm32f43xxI when PA12 is in use for chips below revision 3, see errata 2.2.11"); | 249 | panic!( |
| 250 | "Read corruption for stm32f42xxI and stm32f43xxI when PA12 is in use for chips below revision 3, see errata 2.2.11" | ||
| 251 | ); | ||
| 250 | } | 252 | } |
| 251 | 253 | ||
| 252 | #[cfg(any( | 254 | #[cfg(any( |
| @@ -270,14 +272,16 @@ pub(crate) fn assert_not_corrupted_read(end_address: u32) { | |||
| 270 | feature = "stm32f439zg", | 272 | feature = "stm32f439zg", |
| 271 | ))] | 273 | ))] |
| 272 | if second_bank_read && pac::DBGMCU.idcode().read().rev_id() < REVISION_3 && !pa12_is_output_pull_low() { | 274 | if second_bank_read && pac::DBGMCU.idcode().read().rev_id() < REVISION_3 && !pa12_is_output_pull_low() { |
| 273 | panic!("Read corruption for stm32f42xxG and stm32f43xxG in dual bank mode when PA12 is in use for chips below revision 3, see errata 2.2.11"); | 275 | panic!( |
| 276 | "Read corruption for stm32f42xxG and stm32f43xxG in dual bank mode when PA12 is in use for chips below revision 3, see errata 2.2.11" | ||
| 277 | ); | ||
| 274 | } | 278 | } |
| 275 | } | 279 | } |
| 276 | 280 | ||
| 277 | #[allow(unused)] | 281 | #[allow(unused)] |
| 278 | fn pa12_is_output_pull_low() -> bool { | 282 | fn pa12_is_output_pull_low() -> bool { |
| 279 | use pac::gpio::vals; | ||
| 280 | use pac::GPIOA; | 283 | use pac::GPIOA; |
| 284 | use pac::gpio::vals; | ||
| 281 | const PIN: usize = 12; | 285 | const PIN: usize = 12; |
| 282 | GPIOA.moder().read().moder(PIN) == vals::Moder::OUTPUT | 286 | GPIOA.moder().read().moder(PIN) == vals::Moder::OUTPUT |
| 283 | && GPIOA.pupdr().read().pupdr(PIN) == vals::Pupdr::PULL_DOWN | 287 | && GPIOA.pupdr().read().pupdr(PIN) == vals::Pupdr::PULL_DOWN |
| @@ -287,7 +291,7 @@ fn pa12_is_output_pull_low() -> bool { | |||
| 287 | #[cfg(test)] | 291 | #[cfg(test)] |
| 288 | mod tests { | 292 | mod tests { |
| 289 | use super::*; | 293 | use super::*; |
| 290 | use crate::flash::{get_sector, FlashBank}; | 294 | use crate::flash::{FlashBank, get_sector}; |
| 291 | 295 | ||
| 292 | #[test] | 296 | #[test] |
| 293 | #[cfg(stm32f429)] | 297 | #[cfg(stm32f429)] |
| @@ -370,9 +374,13 @@ mod tests { | |||
| 370 | #[cfg(all(bank_setup_configurable))] | 374 | #[cfg(all(bank_setup_configurable))] |
| 371 | pub(crate) fn check_bank_setup() { | 375 | pub(crate) fn check_bank_setup() { |
| 372 | if cfg!(feature = "single-bank") && pac::FLASH.optcr().read().db1m() { | 376 | if cfg!(feature = "single-bank") && pac::FLASH.optcr().read().db1m() { |
| 373 | panic!("Embassy is configured as single-bank, but the hardware is running in dual-bank mode. Change the hardware by changing the db1m value in the user option bytes or configure embassy to use dual-bank config"); | 377 | panic!( |
| 378 | "Embassy is configured as single-bank, but the hardware is running in dual-bank mode. Change the hardware by changing the db1m value in the user option bytes or configure embassy to use dual-bank config" | ||
| 379 | ); | ||
| 374 | } | 380 | } |
| 375 | if cfg!(feature = "dual-bank") && !pac::FLASH.optcr().read().db1m() { | 381 | if cfg!(feature = "dual-bank") && !pac::FLASH.optcr().read().db1m() { |
| 376 | panic!("Embassy is configured as dual-bank, but the hardware is running in single-bank mode. Change the hardware by changing the db1m value in the user option bytes or configure embassy to use single-bank config"); | 382 | panic!( |
| 383 | "Embassy is configured as dual-bank, but the hardware is running in single-bank mode. Change the hardware by changing the db1m value in the user option bytes or configure embassy to use single-bank config" | ||
| 384 | ); | ||
| 377 | } | 385 | } |
| 378 | } | 386 | } |
diff --git a/embassy-stm32/src/flash/f7.rs b/embassy-stm32/src/flash/f7.rs index 0547c747a..09389c417 100644 --- a/embassy-stm32/src/flash/f7.rs +++ b/embassy-stm32/src/flash/f7.rs | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | use core::ptr::write_volatile; | 1 | use core::ptr::write_volatile; |
| 2 | use core::sync::atomic::{fence, Ordering}; | 2 | use core::sync::atomic::{Ordering, fence}; |
| 3 | 3 | ||
| 4 | use super::{FlashSector, WRITE_SIZE}; | 4 | use super::{FlashSector, WRITE_SIZE}; |
| 5 | use crate::flash::Error; | 5 | use crate::flash::Error; |
| @@ -99,7 +99,7 @@ unsafe fn blocking_wait_ready() -> Result<(), Error> { | |||
| 99 | #[cfg(test)] | 99 | #[cfg(test)] |
| 100 | mod tests { | 100 | mod tests { |
| 101 | use super::*; | 101 | use super::*; |
| 102 | use crate::flash::{get_sector, FlashBank}; | 102 | use crate::flash::{FlashBank, get_sector}; |
| 103 | 103 | ||
| 104 | #[test] | 104 | #[test] |
| 105 | #[cfg(stm32f732)] | 105 | #[cfg(stm32f732)] |
| @@ -218,9 +218,13 @@ mod tests { | |||
| 218 | #[cfg(all(bank_setup_configurable))] | 218 | #[cfg(all(bank_setup_configurable))] |
| 219 | pub(crate) fn check_bank_setup() { | 219 | pub(crate) fn check_bank_setup() { |
| 220 | if cfg!(feature = "single-bank") && !pac::FLASH.optcr().read().n_dbank() { | 220 | if cfg!(feature = "single-bank") && !pac::FLASH.optcr().read().n_dbank() { |
| 221 | panic!("Embassy is configured as single-bank, but the hardware is running in dual-bank mode. Change the hardware by changing the ndbank value in the user option bytes or configure embassy to use dual-bank config"); | 221 | panic!( |
| 222 | "Embassy is configured as single-bank, but the hardware is running in dual-bank mode. Change the hardware by changing the ndbank value in the user option bytes or configure embassy to use dual-bank config" | ||
| 223 | ); | ||
| 222 | } | 224 | } |
| 223 | if cfg!(feature = "dual-bank") && pac::FLASH.optcr().read().n_dbank() { | 225 | if cfg!(feature = "dual-bank") && pac::FLASH.optcr().read().n_dbank() { |
| 224 | panic!("Embassy is configured as dual-bank, but the hardware is running in single-bank mode. Change the hardware by changing the ndbank value in the user option bytes or configure embassy to use single-bank config"); | 226 | panic!( |
| 227 | "Embassy is configured as dual-bank, but the hardware is running in single-bank mode. Change the hardware by changing the ndbank value in the user option bytes or configure embassy to use single-bank config" | ||
| 228 | ); | ||
| 225 | } | 229 | } |
| 226 | } | 230 | } |
diff --git a/embassy-stm32/src/flash/g.rs b/embassy-stm32/src/flash/g.rs index bc1fd360c..d026541a4 100644 --- a/embassy-stm32/src/flash/g.rs +++ b/embassy-stm32/src/flash/g.rs | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | use core::ptr::write_volatile; | 1 | use core::ptr::write_volatile; |
| 2 | use core::sync::atomic::{fence, Ordering}; | 2 | use core::sync::atomic::{Ordering, fence}; |
| 3 | 3 | ||
| 4 | use cortex_m::interrupt; | 4 | use cortex_m::interrupt; |
| 5 | 5 | ||
| @@ -105,19 +105,27 @@ fn wait_busy() { | |||
| 105 | #[cfg(all(bank_setup_configurable, any(flash_g4c2, flash_g4c3, flash_g4c4)))] | 105 | #[cfg(all(bank_setup_configurable, any(flash_g4c2, flash_g4c3, flash_g4c4)))] |
| 106 | pub(crate) fn check_bank_setup() { | 106 | pub(crate) fn check_bank_setup() { |
| 107 | if cfg!(feature = "single-bank") && pac::FLASH.optr().read().dbank() { | 107 | if cfg!(feature = "single-bank") && pac::FLASH.optr().read().dbank() { |
| 108 | panic!("Embassy is configured as single-bank, but the hardware is running in dual-bank mode. Change the hardware by changing the dbank value in the user option bytes or configure embassy to use dual-bank config"); | 108 | panic!( |
| 109 | "Embassy is configured as single-bank, but the hardware is running in dual-bank mode. Change the hardware by changing the dbank value in the user option bytes or configure embassy to use dual-bank config" | ||
| 110 | ); | ||
| 109 | } | 111 | } |
| 110 | if cfg!(feature = "dual-bank") && !pac::FLASH.optr().read().dbank() { | 112 | if cfg!(feature = "dual-bank") && !pac::FLASH.optr().read().dbank() { |
| 111 | panic!("Embassy is configured as dual-bank, but the hardware is running in single-bank mode. Change the hardware by changing the dbank value in the user option bytes or configure embassy to use single-bank config"); | 113 | panic!( |
| 114 | "Embassy is configured as dual-bank, but the hardware is running in single-bank mode. Change the hardware by changing the dbank value in the user option bytes or configure embassy to use single-bank config" | ||
| 115 | ); | ||
| 112 | } | 116 | } |
| 113 | } | 117 | } |
| 114 | 118 | ||
| 115 | #[cfg(all(bank_setup_configurable, flash_g0x1))] | 119 | #[cfg(all(bank_setup_configurable, flash_g0x1))] |
| 116 | pub(crate) fn check_bank_setup() { | 120 | pub(crate) fn check_bank_setup() { |
| 117 | if cfg!(feature = "single-bank") && pac::FLASH.optr().read().dual_bank() { | 121 | if cfg!(feature = "single-bank") && pac::FLASH.optr().read().dual_bank() { |
| 118 | panic!("Embassy is configured as single-bank, but the hardware is running in dual-bank mode. Change the hardware by changing the dual_bank value in the user option bytes or configure embassy to use dual-bank config"); | 122 | panic!( |
| 123 | "Embassy is configured as single-bank, but the hardware is running in dual-bank mode. Change the hardware by changing the dual_bank value in the user option bytes or configure embassy to use dual-bank config" | ||
| 124 | ); | ||
| 119 | } | 125 | } |
| 120 | if cfg!(feature = "dual-bank") && !pac::FLASH.optr().read().dual_bank() { | 126 | if cfg!(feature = "dual-bank") && !pac::FLASH.optr().read().dual_bank() { |
| 121 | panic!("Embassy is configured as dual-bank, but the hardware is running in single-bank mode. Change the hardware by changing the dual_bank value in the user option bytes or configure embassy to use single-bank config"); | 127 | panic!( |
| 128 | "Embassy is configured as dual-bank, but the hardware is running in single-bank mode. Change the hardware by changing the dual_bank value in the user option bytes or configure embassy to use single-bank config" | ||
| 129 | ); | ||
| 122 | } | 130 | } |
| 123 | } | 131 | } |
diff --git a/embassy-stm32/src/flash/h5.rs b/embassy-stm32/src/flash/h5.rs index fd9bfcc75..88f247879 100644 --- a/embassy-stm32/src/flash/h5.rs +++ b/embassy-stm32/src/flash/h5.rs | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | use core::ptr::write_volatile; | 1 | use core::ptr::write_volatile; |
| 2 | use core::sync::atomic::{fence, Ordering}; | 2 | use core::sync::atomic::{Ordering, fence}; |
| 3 | 3 | ||
| 4 | use super::{FlashSector, WRITE_SIZE}; | 4 | use super::{FlashSector, WRITE_SIZE}; |
| 5 | use crate::flash::Error; | 5 | use crate::flash::Error; |
diff --git a/embassy-stm32/src/flash/h50.rs b/embassy-stm32/src/flash/h50.rs index f8e210556..91d5da4d6 100644 --- a/embassy-stm32/src/flash/h50.rs +++ b/embassy-stm32/src/flash/h50.rs | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | /// STM32H50 series flash impl. See RM0492 | 1 | /// STM32H50 series flash impl. See RM0492 |
| 2 | use core::{ | 2 | use core::{ |
| 3 | ptr::write_volatile, | 3 | ptr::write_volatile, |
| 4 | sync::atomic::{fence, Ordering}, | 4 | sync::atomic::{Ordering, fence}, |
| 5 | }; | 5 | }; |
| 6 | 6 | ||
| 7 | use cortex_m::interrupt; | 7 | use cortex_m::interrupt; |
diff --git a/embassy-stm32/src/flash/h7.rs b/embassy-stm32/src/flash/h7.rs index f1d84101c..8a43cce3f 100644 --- a/embassy-stm32/src/flash/h7.rs +++ b/embassy-stm32/src/flash/h7.rs | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | use core::ptr::write_volatile; | 1 | use core::ptr::write_volatile; |
| 2 | use core::sync::atomic::{fence, Ordering}; | 2 | use core::sync::atomic::{Ordering, fence}; |
| 3 | 3 | ||
| 4 | use super::{FlashSector, BANK1_REGION, FLASH_REGIONS, WRITE_SIZE}; | 4 | use super::{BANK1_REGION, FLASH_REGIONS, FlashSector, WRITE_SIZE}; |
| 5 | use crate::flash::Error; | 5 | use crate::flash::Error; |
| 6 | use crate::pac; | 6 | use crate::pac; |
| 7 | 7 | ||
diff --git a/embassy-stm32/src/flash/l.rs b/embassy-stm32/src/flash/l.rs index 1b82704ec..cd23cda5c 100644 --- a/embassy-stm32/src/flash/l.rs +++ b/embassy-stm32/src/flash/l.rs | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | use core::ptr::write_volatile; | 1 | use core::ptr::write_volatile; |
| 2 | use core::sync::atomic::{fence, Ordering}; | 2 | use core::sync::atomic::{Ordering, fence}; |
| 3 | 3 | ||
| 4 | use super::{FlashSector, WRITE_SIZE}; | 4 | use super::{FlashSector, WRITE_SIZE}; |
| 5 | use crate::flash::Error; | 5 | use crate::flash::Error; |
| @@ -234,19 +234,27 @@ pub(crate) unsafe fn wait_ready_blocking() -> Result<(), Error> { | |||
| 234 | #[cfg(all(bank_setup_configurable, flash_l5))] | 234 | #[cfg(all(bank_setup_configurable, flash_l5))] |
| 235 | pub(crate) fn check_bank_setup() { | 235 | pub(crate) fn check_bank_setup() { |
| 236 | if cfg!(feature = "single-bank") && pac::FLASH.optr().read().dbank() { | 236 | if cfg!(feature = "single-bank") && pac::FLASH.optr().read().dbank() { |
| 237 | panic!("Embassy is configured as single-bank, but the hardware is running in dual-bank mode. Change the hardware by changing the dbank value in the user option bytes or configure embassy to use dual-bank config"); | 237 | panic!( |
| 238 | "Embassy is configured as single-bank, but the hardware is running in dual-bank mode. Change the hardware by changing the dbank value in the user option bytes or configure embassy to use dual-bank config" | ||
| 239 | ); | ||
| 238 | } | 240 | } |
| 239 | if cfg!(feature = "dual-bank") && !pac::FLASH.optr().read().dbank() { | 241 | if cfg!(feature = "dual-bank") && !pac::FLASH.optr().read().dbank() { |
| 240 | panic!("Embassy is configured as dual-bank, but the hardware is running in single-bank mode. Change the hardware by changing the dbank value in the user option bytes or configure embassy to use single-bank config"); | 242 | panic!( |
| 243 | "Embassy is configured as dual-bank, but the hardware is running in single-bank mode. Change the hardware by changing the dbank value in the user option bytes or configure embassy to use single-bank config" | ||
| 244 | ); | ||
| 241 | } | 245 | } |
| 242 | } | 246 | } |
| 243 | 247 | ||
| 244 | #[cfg(all(bank_setup_configurable, flash_l4))] | 248 | #[cfg(all(bank_setup_configurable, flash_l4))] |
| 245 | pub(crate) fn check_bank_setup() { | 249 | pub(crate) fn check_bank_setup() { |
| 246 | if cfg!(feature = "single-bank") && pac::FLASH.optr().read().dualbank() { | 250 | if cfg!(feature = "single-bank") && pac::FLASH.optr().read().dualbank() { |
| 247 | panic!("Embassy is configured as single-bank, but the hardware is running in dual-bank mode. Change the hardware by changing the dualbank value in the user option bytes or configure embassy to use dual-bank config"); | 251 | panic!( |
| 252 | "Embassy is configured as single-bank, but the hardware is running in dual-bank mode. Change the hardware by changing the dualbank value in the user option bytes or configure embassy to use dual-bank config" | ||
| 253 | ); | ||
| 248 | } | 254 | } |
| 249 | if cfg!(feature = "dual-bank") && !pac::FLASH.optr().read().dualbank() { | 255 | if cfg!(feature = "dual-bank") && !pac::FLASH.optr().read().dualbank() { |
| 250 | panic!("Embassy is configured as dual-bank, but the hardware is running in single-bank mode. Change the hardware by changing the dualbank value in the user option bytes or configure embassy to use single-bank config"); | 256 | panic!( |
| 257 | "Embassy is configured as dual-bank, but the hardware is running in single-bank mode. Change the hardware by changing the dualbank value in the user option bytes or configure embassy to use single-bank config" | ||
| 258 | ); | ||
| 251 | } | 259 | } |
| 252 | } | 260 | } |
diff --git a/embassy-stm32/src/flash/u0.rs b/embassy-stm32/src/flash/u0.rs index 68d847eca..a64f6c492 100644 --- a/embassy-stm32/src/flash/u0.rs +++ b/embassy-stm32/src/flash/u0.rs | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | use core::ptr::write_volatile; | 1 | use core::ptr::write_volatile; |
| 2 | use core::sync::atomic::{fence, Ordering}; | 2 | use core::sync::atomic::{Ordering, fence}; |
| 3 | 3 | ||
| 4 | use cortex_m::interrupt; | 4 | use cortex_m::interrupt; |
| 5 | 5 | ||
diff --git a/embassy-stm32/src/flash/u5.rs b/embassy-stm32/src/flash/u5.rs index 6c3d4b422..5f1f562c0 100644 --- a/embassy-stm32/src/flash/u5.rs +++ b/embassy-stm32/src/flash/u5.rs | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | use core::ptr::write_volatile; | 1 | use core::ptr::write_volatile; |
| 2 | use core::sync::atomic::{fence, Ordering}; | 2 | use core::sync::atomic::{Ordering, fence}; |
| 3 | 3 | ||
| 4 | use super::{FlashBank, FlashSector, WRITE_SIZE}; | 4 | use super::{FlashBank, FlashSector, WRITE_SIZE}; |
| 5 | use crate::flash::Error; | 5 | use crate::flash::Error; |
diff --git a/embassy-stm32/src/fmc.rs b/embassy-stm32/src/fmc.rs index ff18a8bee..8ecfbc522 100644 --- a/embassy-stm32/src/fmc.rs +++ b/embassy-stm32/src/fmc.rs | |||
| @@ -4,7 +4,7 @@ use core::marker::PhantomData; | |||
| 4 | use embassy_hal_internal::PeripheralType; | 4 | use embassy_hal_internal::PeripheralType; |
| 5 | 5 | ||
| 6 | use crate::gpio::{AfType, OutputType, Pull, Speed}; | 6 | use crate::gpio::{AfType, OutputType, Pull, Speed}; |
| 7 | use crate::{rcc, Peri}; | 7 | use crate::{Peri, rcc}; |
| 8 | 8 | ||
| 9 | /// FMC driver | 9 | /// FMC driver |
| 10 | pub struct Fmc<'d, T: Instance> { | 10 | pub struct Fmc<'d, T: Instance> { |
diff --git a/embassy-stm32/src/gpio.rs b/embassy-stm32/src/gpio.rs index 5a8d23183..b55baffdc 100644 --- a/embassy-stm32/src/gpio.rs +++ b/embassy-stm32/src/gpio.rs | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | use core::convert::Infallible; | 4 | use core::convert::Infallible; |
| 5 | 5 | ||
| 6 | use critical_section::CriticalSection; | 6 | use critical_section::CriticalSection; |
| 7 | use embassy_hal_internal::{impl_peripheral, Peri, PeripheralType}; | 7 | use embassy_hal_internal::{Peri, PeripheralType, impl_peripheral}; |
| 8 | 8 | ||
| 9 | use crate::pac::gpio::{self, vals}; | 9 | use crate::pac::gpio::{self, vals}; |
| 10 | use crate::peripherals; | 10 | use crate::peripherals; |
diff --git a/embassy-stm32/src/hash/mod.rs b/embassy-stm32/src/hash/mod.rs index 90c06c0d8..ba573267c 100644 --- a/embassy-stm32/src/hash/mod.rs +++ b/embassy-stm32/src/hash/mod.rs | |||
| @@ -19,7 +19,7 @@ use crate::interrupt::typelevel::Interrupt; | |||
| 19 | use crate::mode::Async; | 19 | use crate::mode::Async; |
| 20 | use crate::mode::{Blocking, Mode}; | 20 | use crate::mode::{Blocking, Mode}; |
| 21 | use crate::peripherals::HASH; | 21 | use crate::peripherals::HASH; |
| 22 | use crate::{interrupt, pac, peripherals, rcc, Peri}; | 22 | use crate::{Peri, interrupt, pac, peripherals, rcc}; |
| 23 | 23 | ||
| 24 | #[cfg(hash_v1)] | 24 | #[cfg(hash_v1)] |
| 25 | const NUM_CONTEXT_REGS: usize = 51; | 25 | const NUM_CONTEXT_REGS: usize = 51; |
| @@ -514,11 +514,7 @@ impl<'d, T: Instance> Hash<'d, T, Async> { | |||
| 514 | T::regs().imr().modify(|reg| reg.set_dcie(true)); | 514 | T::regs().imr().modify(|reg| reg.set_dcie(true)); |
| 515 | // Check for completion. | 515 | // Check for completion. |
| 516 | let bits = T::regs().sr().read(); | 516 | let bits = T::regs().sr().read(); |
| 517 | if bits.dcis() { | 517 | if bits.dcis() { Poll::Ready(()) } else { Poll::Pending } |
| 518 | Poll::Ready(()) | ||
| 519 | } else { | ||
| 520 | Poll::Pending | ||
| 521 | } | ||
| 522 | }) | 518 | }) |
| 523 | .await; | 519 | .await; |
| 524 | 520 | ||
diff --git a/embassy-stm32/src/hsem/mod.rs b/embassy-stm32/src/hsem/mod.rs index 573a1851d..4d3a5d68d 100644 --- a/embassy-stm32/src/hsem/mod.rs +++ b/embassy-stm32/src/hsem/mod.rs | |||
| @@ -2,13 +2,13 @@ | |||
| 2 | 2 | ||
| 3 | use embassy_hal_internal::PeripheralType; | 3 | use embassy_hal_internal::PeripheralType; |
| 4 | 4 | ||
| 5 | use crate::pac; | ||
| 6 | use crate::rcc::{self, RccPeripheral}; | ||
| 7 | // TODO: This code works for all HSEM implemenations except for the STM32WBA52/4/5xx MCUs. | 5 | // TODO: This code works for all HSEM implemenations except for the STM32WBA52/4/5xx MCUs. |
| 8 | // Those MCUs have a different HSEM implementation (Secure semaphore lock support, | 6 | // Those MCUs have a different HSEM implementation (Secure semaphore lock support, |
| 9 | // Privileged / unprivileged semaphore lock support, Semaphore lock protection via semaphore attribute), | 7 | // Privileged / unprivileged semaphore lock support, Semaphore lock protection via semaphore attribute), |
| 10 | // which is not yet supported by this code. | 8 | // which is not yet supported by this code. |
| 11 | use crate::Peri; | 9 | use crate::Peri; |
| 10 | use crate::pac; | ||
| 11 | use crate::rcc::{self, RccPeripheral}; | ||
| 12 | 12 | ||
| 13 | /// HSEM error. | 13 | /// HSEM error. |
| 14 | #[derive(Debug)] | 14 | #[derive(Debug)] |
diff --git a/embassy-stm32/src/hspi/mod.rs b/embassy-stm32/src/hspi/mod.rs index 95d9e5099..69baa708e 100644 --- a/embassy-stm32/src/hspi/mod.rs +++ b/embassy-stm32/src/hspi/mod.rs | |||
| @@ -16,7 +16,7 @@ use embassy_embedded_hal::{GetConfig, SetConfig}; | |||
| 16 | use embassy_hal_internal::{Peri, PeripheralType}; | 16 | use embassy_hal_internal::{Peri, PeripheralType}; |
| 17 | pub use enums::*; | 17 | pub use enums::*; |
| 18 | 18 | ||
| 19 | use crate::dma::{word, ChannelAndRequest}; | 19 | use crate::dma::{ChannelAndRequest, word}; |
| 20 | use crate::gpio::{AfType, AnyPin, OutputType, Pull, SealedPin as _, Speed}; | 20 | use crate::gpio::{AfType, AnyPin, OutputType, Pull, SealedPin as _, Speed}; |
| 21 | use crate::mode::{Async, Blocking, Mode as PeriMode}; | 21 | use crate::mode::{Async, Blocking, Mode as PeriMode}; |
| 22 | use crate::pac::hspi::Hspi as Regs; | 22 | use crate::pac::hspi::Hspi as Regs; |
diff --git a/embassy-stm32/src/i2c/mod.rs b/embassy-stm32/src/i2c/mod.rs index 249bac41c..f4bf55d34 100644 --- a/embassy-stm32/src/i2c/mod.rs +++ b/embassy-stm32/src/i2c/mod.rs | |||
| @@ -154,8 +154,8 @@ impl<'d> I2c<'d, Async, Master> { | |||
| 154 | scl: Peri<'d, if_afio!(impl SclPin<T, A>)>, | 154 | scl: Peri<'d, if_afio!(impl SclPin<T, A>)>, |
| 155 | sda: Peri<'d, if_afio!(impl SdaPin<T, A>)>, | 155 | sda: Peri<'d, if_afio!(impl SdaPin<T, A>)>, |
| 156 | _irq: impl interrupt::typelevel::Binding<T::EventInterrupt, EventInterruptHandler<T>> | 156 | _irq: impl interrupt::typelevel::Binding<T::EventInterrupt, EventInterruptHandler<T>> |
| 157 | + interrupt::typelevel::Binding<T::ErrorInterrupt, ErrorInterruptHandler<T>> | 157 | + interrupt::typelevel::Binding<T::ErrorInterrupt, ErrorInterruptHandler<T>> |
| 158 | + 'd, | 158 | + 'd, |
| 159 | tx_dma: Peri<'d, impl TxDma<T>>, | 159 | tx_dma: Peri<'d, impl TxDma<T>>, |
| 160 | rx_dma: Peri<'d, impl RxDma<T>>, | 160 | rx_dma: Peri<'d, impl RxDma<T>>, |
| 161 | config: Config, | 161 | config: Config, |
diff --git a/embassy-stm32/src/i2c/v1.rs b/embassy-stm32/src/i2c/v1.rs index 081eb1191..e6b6c7c42 100644 --- a/embassy-stm32/src/i2c/v1.rs +++ b/embassy-stm32/src/i2c/v1.rs | |||
| @@ -8,7 +8,7 @@ use core::future::poll_fn; | |||
| 8 | use core::task::Poll; | 8 | use core::task::Poll; |
| 9 | 9 | ||
| 10 | use embassy_embedded_hal::SetConfig; | 10 | use embassy_embedded_hal::SetConfig; |
| 11 | use embassy_futures::select::{select, Either}; | 11 | use embassy_futures::select::{Either, select}; |
| 12 | use embassy_hal_internal::drop::OnDrop; | 12 | use embassy_hal_internal::drop::OnDrop; |
| 13 | use embedded_hal_1::i2c::Operation; | 13 | use embedded_hal_1::i2c::Operation; |
| 14 | use mode::Master; | 14 | use mode::Master; |
| @@ -762,11 +762,7 @@ impl Timings { | |||
| 762 | mode = Mode::Standard; | 762 | mode = Mode::Standard; |
| 763 | ccr = { | 763 | ccr = { |
| 764 | let ccr = clock / (frequency * 2); | 764 | let ccr = clock / (frequency * 2); |
| 765 | if ccr < 4 { | 765 | if ccr < 4 { 4 } else { ccr } |
| 766 | 4 | ||
| 767 | } else { | ||
| 768 | ccr | ||
| 769 | } | ||
| 770 | }; | 766 | }; |
| 771 | } else { | 767 | } else { |
| 772 | const DUTYCYCLE: u8 = 0; | 768 | const DUTYCYCLE: u8 = 0; |
diff --git a/embassy-stm32/src/i2c/v2.rs b/embassy-stm32/src/i2c/v2.rs index 0bfc795ac..01b6b8800 100644 --- a/embassy-stm32/src/i2c/v2.rs +++ b/embassy-stm32/src/i2c/v2.rs | |||
| @@ -2,7 +2,7 @@ use core::cmp; | |||
| 2 | use core::future::poll_fn; | 2 | use core::future::poll_fn; |
| 3 | use core::task::Poll; | 3 | use core::task::Poll; |
| 4 | 4 | ||
| 5 | use config::{Address, OwnAddresses, OA2}; | 5 | use config::{Address, OA2, OwnAddresses}; |
| 6 | use embassy_embedded_hal::SetConfig; | 6 | use embassy_embedded_hal::SetConfig; |
| 7 | use embassy_hal_internal::drop::OnDrop; | 7 | use embassy_hal_internal::drop::OnDrop; |
| 8 | use embedded_hal_1::i2c::Operation; | 8 | use embedded_hal_1::i2c::Operation; |
diff --git a/embassy-stm32/src/i2s.rs b/embassy-stm32/src/i2s.rs index b6d3daf54..db22cfa11 100644 --- a/embassy-stm32/src/i2s.rs +++ b/embassy-stm32/src/i2s.rs | |||
| @@ -3,12 +3,12 @@ | |||
| 3 | use embassy_futures::join::join; | 3 | use embassy_futures::join::join; |
| 4 | use stm32_metapac::spi::vals; | 4 | use stm32_metapac::spi::vals; |
| 5 | 5 | ||
| 6 | use crate::dma::{ringbuffer, ChannelAndRequest, ReadableRingBuffer, TransferOptions, WritableRingBuffer}; | 6 | use crate::Peri; |
| 7 | use crate::dma::{ChannelAndRequest, ReadableRingBuffer, TransferOptions, WritableRingBuffer, ringbuffer}; | ||
| 7 | use crate::gpio::{AfType, AnyPin, OutputType, SealedPin, Speed}; | 8 | use crate::gpio::{AfType, AnyPin, OutputType, SealedPin, Speed}; |
| 8 | use crate::mode::Async; | 9 | use crate::mode::Async; |
| 9 | use crate::spi::{Config as SpiConfig, RegsExt as _, *}; | 10 | use crate::spi::{Config as SpiConfig, RegsExt as _, *}; |
| 10 | use crate::time::Hertz; | 11 | use crate::time::Hertz; |
| 11 | use crate::Peri; | ||
| 12 | 12 | ||
| 13 | /// I2S mode | 13 | /// I2S mode |
| 14 | #[derive(Copy, Clone)] | 14 | #[derive(Copy, Clone)] |
diff --git a/embassy-stm32/src/ipcc.rs b/embassy-stm32/src/ipcc.rs index 670d8332c..e1d8b1c2a 100644 --- a/embassy-stm32/src/ipcc.rs +++ b/embassy-stm32/src/ipcc.rs | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | //! Inter-Process Communication Controller (IPCC) | 1 | //! Inter-Process Communication Controller (IPCC) |
| 2 | 2 | ||
| 3 | use core::future::poll_fn; | 3 | use core::future::poll_fn; |
| 4 | use core::sync::atomic::{compiler_fence, Ordering}; | 4 | use core::sync::atomic::{Ordering, compiler_fence}; |
| 5 | use core::task::Poll; | 5 | use core::task::Poll; |
| 6 | 6 | ||
| 7 | use embassy_sync::waitqueue::AtomicWaker; | 7 | use embassy_sync::waitqueue::AtomicWaker; |
diff --git a/embassy-stm32/src/low_power.rs b/embassy-stm32/src/low_power.rs index 342f73bc8..1b66ca680 100644 --- a/embassy-stm32/src/low_power.rs +++ b/embassy-stm32/src/low_power.rs | |||
| @@ -56,13 +56,13 @@ | |||
| 56 | 56 | ||
| 57 | use core::arch::asm; | 57 | use core::arch::asm; |
| 58 | use core::marker::PhantomData; | 58 | use core::marker::PhantomData; |
| 59 | use core::sync::atomic::{compiler_fence, Ordering}; | 59 | use core::sync::atomic::{Ordering, compiler_fence}; |
| 60 | 60 | ||
| 61 | use cortex_m::peripheral::SCB; | 61 | use cortex_m::peripheral::SCB; |
| 62 | use embassy_executor::*; | 62 | use embassy_executor::*; |
| 63 | 63 | ||
| 64 | use crate::interrupt; | 64 | use crate::interrupt; |
| 65 | use crate::time_driver::{get_driver, RtcDriver}; | 65 | use crate::time_driver::{RtcDriver, get_driver}; |
| 66 | 66 | ||
| 67 | const THREAD_PENDER: usize = usize::MAX; | 67 | const THREAD_PENDER: usize = usize::MAX; |
| 68 | 68 | ||
diff --git a/embassy-stm32/src/lptim/pwm.rs b/embassy-stm32/src/lptim/pwm.rs index 96af9f4d9..a69db3caf 100644 --- a/embassy-stm32/src/lptim/pwm.rs +++ b/embassy-stm32/src/lptim/pwm.rs | |||
| @@ -4,12 +4,12 @@ use core::marker::PhantomData; | |||
| 4 | 4 | ||
| 5 | use embassy_hal_internal::Peri; | 5 | use embassy_hal_internal::Peri; |
| 6 | 6 | ||
| 7 | use super::timer::Timer; | ||
| 8 | #[cfg(not(any(lptim_v2a, lptim_v2b)))] | 7 | #[cfg(not(any(lptim_v2a, lptim_v2b)))] |
| 9 | use super::OutputPin; | 8 | use super::OutputPin; |
| 10 | #[cfg(any(lptim_v2a, lptim_v2b))] | 9 | use super::timer::Timer; |
| 11 | use super::{channel::Channel, timer::ChannelDirection, Channel1Pin, Channel2Pin}; | ||
| 12 | use super::{BasicInstance, Instance}; | 10 | use super::{BasicInstance, Instance}; |
| 11 | #[cfg(any(lptim_v2a, lptim_v2b))] | ||
| 12 | use super::{Channel1Pin, Channel2Pin, channel::Channel, timer::ChannelDirection}; | ||
| 13 | #[cfg(gpio_v2)] | 13 | #[cfg(gpio_v2)] |
| 14 | use crate::gpio::Pull; | 14 | use crate::gpio::Pull; |
| 15 | use crate::gpio::{AfType, AnyPin, OutputType, Speed}; | 15 | use crate::gpio::{AfType, AnyPin, OutputType, Speed}; |
diff --git a/embassy-stm32/src/ltdc.rs b/embassy-stm32/src/ltdc.rs index 0f6ef569c..de2db9872 100644 --- a/embassy-stm32/src/ltdc.rs +++ b/embassy-stm32/src/ltdc.rs | |||
| @@ -14,7 +14,7 @@ use stm32_metapac::ltdc::vals::{Bf1, Bf2, Cfuif, Clif, Crrif, Cterrif, Pf, Vbr}; | |||
| 14 | use crate::gpio::{AfType, OutputType, Speed}; | 14 | use crate::gpio::{AfType, OutputType, Speed}; |
| 15 | use crate::interrupt::typelevel::Interrupt; | 15 | use crate::interrupt::typelevel::Interrupt; |
| 16 | use crate::interrupt::{self}; | 16 | use crate::interrupt::{self}; |
| 17 | use crate::{peripherals, rcc, Peri}; | 17 | use crate::{Peri, peripherals, rcc}; |
| 18 | 18 | ||
| 19 | static LTDC_WAKER: AtomicWaker = AtomicWaker::new(); | 19 | static LTDC_WAKER: AtomicWaker = AtomicWaker::new(); |
| 20 | 20 | ||
diff --git a/embassy-stm32/src/opamp.rs b/embassy-stm32/src/opamp.rs index e36719ef3..ac8d5de21 100644 --- a/embassy-stm32/src/opamp.rs +++ b/embassy-stm32/src/opamp.rs | |||
| @@ -3,10 +3,10 @@ | |||
| 3 | 3 | ||
| 4 | use embassy_hal_internal::PeripheralType; | 4 | use embassy_hal_internal::PeripheralType; |
| 5 | 5 | ||
| 6 | use crate::Peri; | ||
| 6 | use crate::pac::opamp::vals::*; | 7 | use crate::pac::opamp::vals::*; |
| 7 | #[cfg(not(any(stm32g4, stm32f3)))] | 8 | #[cfg(not(any(stm32g4, stm32f3)))] |
| 8 | use crate::rcc::RccInfo; | 9 | use crate::rcc::RccInfo; |
| 9 | use crate::Peri; | ||
| 10 | 10 | ||
| 11 | /// Performs a busy-wait delay for a specified number of microseconds. | 11 | /// Performs a busy-wait delay for a specified number of microseconds. |
| 12 | #[cfg(opamp_v5)] | 12 | #[cfg(opamp_v5)] |
diff --git a/embassy-stm32/src/ospi/mod.rs b/embassy-stm32/src/ospi/mod.rs index d93cecb69..592a8594a 100644 --- a/embassy-stm32/src/ospi/mod.rs +++ b/embassy-stm32/src/ospi/mod.rs | |||
| @@ -12,14 +12,14 @@ use embassy_hal_internal::PeripheralType; | |||
| 12 | pub use enums::*; | 12 | pub use enums::*; |
| 13 | use stm32_metapac::octospi::vals::{PhaseMode, SizeInBits}; | 13 | use stm32_metapac::octospi::vals::{PhaseMode, SizeInBits}; |
| 14 | 14 | ||
| 15 | use crate::dma::{word, ChannelAndRequest}; | 15 | use crate::dma::{ChannelAndRequest, word}; |
| 16 | use crate::gpio::{AfType, AnyPin, OutputType, Pull, SealedPin as _, Speed}; | 16 | use crate::gpio::{AfType, AnyPin, OutputType, Pull, SealedPin as _, Speed}; |
| 17 | use crate::mode::{Async, Blocking, Mode as PeriMode}; | 17 | use crate::mode::{Async, Blocking, Mode as PeriMode}; |
| 18 | use crate::pac::octospi::{vals, Octospi as Regs}; | 18 | use crate::pac::octospi::{Octospi as Regs, vals}; |
| 19 | #[cfg(octospim_v1)] | 19 | #[cfg(octospim_v1)] |
| 20 | use crate::pac::octospim::Octospim; | 20 | use crate::pac::octospim::Octospim; |
| 21 | use crate::rcc::{self, RccPeripheral}; | 21 | use crate::rcc::{self, RccPeripheral}; |
| 22 | use crate::{peripherals, Peri}; | 22 | use crate::{Peri, peripherals}; |
| 23 | 23 | ||
| 24 | /// OPSI driver config. | 24 | /// OPSI driver config. |
| 25 | #[derive(Clone, Copy)] | 25 | #[derive(Clone, Copy)] |
diff --git a/embassy-stm32/src/qspi/mod.rs b/embassy-stm32/src/qspi/mod.rs index b03cd9009..bb4f4f1d0 100644 --- a/embassy-stm32/src/qspi/mod.rs +++ b/embassy-stm32/src/qspi/mod.rs | |||
| @@ -14,7 +14,7 @@ use crate::gpio::{AfType, AnyPin, OutputType, Pull, Speed}; | |||
| 14 | use crate::mode::{Async, Blocking, Mode as PeriMode}; | 14 | use crate::mode::{Async, Blocking, Mode as PeriMode}; |
| 15 | use crate::pac::quadspi::Quadspi as Regs; | 15 | use crate::pac::quadspi::Quadspi as Regs; |
| 16 | use crate::rcc::{self, RccPeripheral}; | 16 | use crate::rcc::{self, RccPeripheral}; |
| 17 | use crate::{peripherals, Peri}; | 17 | use crate::{Peri, peripherals}; |
| 18 | 18 | ||
| 19 | /// QSPI transfer configuration. | 19 | /// QSPI transfer configuration. |
| 20 | #[derive(Clone, Copy)] | 20 | #[derive(Clone, Copy)] |
diff --git a/embassy-stm32/src/rcc/bd.rs b/embassy-stm32/src/rcc/bd.rs index 63fc195dd..3b2a10581 100644 --- a/embassy-stm32/src/rcc/bd.rs +++ b/embassy-stm32/src/rcc/bd.rs | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | use core::sync::atomic::{compiler_fence, Ordering}; | 1 | use core::sync::atomic::{Ordering, compiler_fence}; |
| 2 | 2 | ||
| 3 | use crate::pac::common::{Reg, RW}; | 3 | use crate::pac::common::{RW, Reg}; |
| 4 | pub use crate::pac::rcc::vals::Rtcsel as RtcClockSource; | 4 | pub use crate::pac::rcc::vals::Rtcsel as RtcClockSource; |
| 5 | use crate::time::Hertz; | 5 | use crate::time::Hertz; |
| 6 | 6 | ||
diff --git a/embassy-stm32/src/rcc/f247.rs b/embassy-stm32/src/rcc/f247.rs index 8f2e8db5f..d941054cd 100644 --- a/embassy-stm32/src/rcc/f247.rs +++ b/embassy-stm32/src/rcc/f247.rs | |||
| @@ -1,13 +1,13 @@ | |||
| 1 | use stm32_metapac::flash::vals::Latency; | 1 | use stm32_metapac::flash::vals::Latency; |
| 2 | 2 | ||
| 3 | #[cfg(any(stm32f4, stm32f7))] | ||
| 4 | use crate::pac::PWR; | ||
| 3 | #[cfg(any(stm32f413, stm32f423, stm32f412))] | 5 | #[cfg(any(stm32f413, stm32f423, stm32f412))] |
| 4 | pub use crate::pac::rcc::vals::Plli2ssrc as Plli2sSource; | 6 | pub use crate::pac::rcc::vals::Plli2ssrc as Plli2sSource; |
| 5 | pub use crate::pac::rcc::vals::{ | 7 | pub use crate::pac::rcc::vals::{ |
| 6 | Hpre as AHBPrescaler, Pllm as PllPreDiv, Plln as PllMul, Pllp as PllPDiv, Pllq as PllQDiv, Pllr as PllRDiv, | 8 | Hpre as AHBPrescaler, Pllm as PllPreDiv, Plln as PllMul, Pllp as PllPDiv, Pllq as PllQDiv, Pllr as PllRDiv, |
| 7 | Pllsrc as PllSource, Ppre as APBPrescaler, Sw as Sysclk, | 9 | Pllsrc as PllSource, Ppre as APBPrescaler, Sw as Sysclk, |
| 8 | }; | 10 | }; |
| 9 | #[cfg(any(stm32f4, stm32f7))] | ||
| 10 | use crate::pac::PWR; | ||
| 11 | use crate::pac::{FLASH, RCC}; | 11 | use crate::pac::{FLASH, RCC}; |
| 12 | use crate::time::Hertz; | 12 | use crate::time::Hertz; |
| 13 | 13 | ||
diff --git a/embassy-stm32/src/rcc/h.rs b/embassy-stm32/src/rcc/h.rs index 331bab7a0..485edd390 100644 --- a/embassy-stm32/src/rcc/h.rs +++ b/embassy-stm32/src/rcc/h.rs | |||
| @@ -597,7 +597,10 @@ pub(crate) unsafe fn init(config: Config) { | |||
| 597 | Hertz(24_000_000) => Usbrefcksel::MHZ24, | 597 | Hertz(24_000_000) => Usbrefcksel::MHZ24, |
| 598 | Hertz(26_000_000) => Usbrefcksel::MHZ26, | 598 | Hertz(26_000_000) => Usbrefcksel::MHZ26, |
| 599 | Hertz(32_000_000) => Usbrefcksel::MHZ32, | 599 | Hertz(32_000_000) => Usbrefcksel::MHZ32, |
| 600 | _ => panic!("cannot select USBPHYC reference clock with source frequency of {}, must be one of 16, 19.2, 20, 24, 26, 32 MHz", clk_val), | 600 | _ => panic!( |
| 601 | "cannot select USBPHYC reference clock with source frequency of {}, must be one of 16, 19.2, 20, 24, 26, 32 MHz", | ||
| 602 | clk_val | ||
| 603 | ), | ||
| 601 | }, | 604 | }, |
| 602 | None => Usbrefcksel::MHZ24, | 605 | None => Usbrefcksel::MHZ24, |
| 603 | }; | 606 | }; |
diff --git a/embassy-stm32/src/rcc/l.rs b/embassy-stm32/src/rcc/l.rs index 81b89046e..2e1cbd702 100644 --- a/embassy-stm32/src/rcc/l.rs +++ b/embassy-stm32/src/rcc/l.rs | |||
| @@ -499,9 +499,9 @@ pub use pll::*; | |||
| 499 | 499 | ||
| 500 | #[cfg(any(stm32l0, stm32l1))] | 500 | #[cfg(any(stm32l0, stm32l1))] |
| 501 | mod pll { | 501 | mod pll { |
| 502 | use super::{pll_enable, PllInstance}; | 502 | use super::{PllInstance, pll_enable}; |
| 503 | pub use crate::pac::rcc::vals::{Plldiv as PllDiv, Pllmul as PllMul, Pllsrc as PllSource}; | ||
| 504 | use crate::pac::RCC; | 503 | use crate::pac::RCC; |
| 504 | pub use crate::pac::rcc::vals::{Plldiv as PllDiv, Pllmul as PllMul, Pllsrc as PllSource}; | ||
| 505 | use crate::time::Hertz; | 505 | use crate::time::Hertz; |
| 506 | 506 | ||
| 507 | #[derive(Clone, Copy)] | 507 | #[derive(Clone, Copy)] |
| @@ -563,11 +563,11 @@ mod pll { | |||
| 563 | 563 | ||
| 564 | #[cfg(any(stm32l4, stm32l5, stm32wb, stm32wl, stm32u0))] | 564 | #[cfg(any(stm32l4, stm32l5, stm32wb, stm32wl, stm32u0))] |
| 565 | mod pll { | 565 | mod pll { |
| 566 | use super::{pll_enable, PllInstance}; | 566 | use super::{PllInstance, pll_enable}; |
| 567 | use crate::pac::RCC; | ||
| 567 | pub use crate::pac::rcc::vals::{ | 568 | pub use crate::pac::rcc::vals::{ |
| 568 | Pllm as PllPreDiv, Plln as PllMul, Pllp as PllPDiv, Pllq as PllQDiv, Pllr as PllRDiv, Pllsrc as PllSource, | 569 | Pllm as PllPreDiv, Plln as PllMul, Pllp as PllPDiv, Pllq as PllQDiv, Pllr as PllRDiv, Pllsrc as PllSource, |
| 569 | }; | 570 | }; |
| 570 | use crate::pac::RCC; | ||
| 571 | use crate::time::Hertz; | 571 | use crate::time::Hertz; |
| 572 | 572 | ||
| 573 | #[derive(Clone, Copy)] | 573 | #[derive(Clone, Copy)] |
diff --git a/embassy-stm32/src/rcc/mco.rs b/embassy-stm32/src/rcc/mco.rs index fa4b45a20..3d961df03 100644 --- a/embassy-stm32/src/rcc/mco.rs +++ b/embassy-stm32/src/rcc/mco.rs | |||
| @@ -3,6 +3,7 @@ use core::marker::PhantomData; | |||
| 3 | use embassy_hal_internal::PeripheralType; | 3 | use embassy_hal_internal::PeripheralType; |
| 4 | 4 | ||
| 5 | use crate::gpio::{AfType, OutputType, Speed}; | 5 | use crate::gpio::{AfType, OutputType, Speed}; |
| 6 | use crate::pac::RCC; | ||
| 6 | #[cfg(not(any(stm32f1, rcc_f0v1, rcc_f3v1, rcc_f37)))] | 7 | #[cfg(not(any(stm32f1, rcc_f0v1, rcc_f3v1, rcc_f37)))] |
| 7 | pub use crate::pac::rcc::vals::Mcopre as McoPrescaler; | 8 | pub use crate::pac::rcc::vals::Mcopre as McoPrescaler; |
| 8 | #[cfg(not(any( | 9 | #[cfg(not(any( |
| @@ -31,8 +32,7 @@ pub use crate::pac::rcc::vals::Mcosel as McoSource; | |||
| 31 | rcc_h7rs | 32 | rcc_h7rs |
| 32 | ))] | 33 | ))] |
| 33 | pub use crate::pac::rcc::vals::{Mco1sel as Mco1Source, Mco2sel as Mco2Source}; | 34 | pub use crate::pac::rcc::vals::{Mco1sel as Mco1Source, Mco2sel as Mco2Source}; |
| 34 | use crate::pac::RCC; | 35 | use crate::{Peri, peripherals}; |
| 35 | use crate::{peripherals, Peri}; | ||
| 36 | 36 | ||
| 37 | #[cfg(any(stm32f1, rcc_f0v1, rcc_f3v1, rcc_f37))] | 37 | #[cfg(any(stm32f1, rcc_f0v1, rcc_f3v1, rcc_f37))] |
| 38 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 38 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
diff --git a/embassy-stm32/src/rcc/mod.rs b/embassy-stm32/src/rcc/mod.rs index c41f81816..addfca3c3 100644 --- a/embassy-stm32/src/rcc/mod.rs +++ b/embassy-stm32/src/rcc/mod.rs | |||
| @@ -33,7 +33,7 @@ mod _version; | |||
| 33 | pub use _version::*; | 33 | pub use _version::*; |
| 34 | use stm32_metapac::RCC; | 34 | use stm32_metapac::RCC; |
| 35 | 35 | ||
| 36 | pub use crate::_generated::{mux, Clocks}; | 36 | pub use crate::_generated::{Clocks, mux}; |
| 37 | use crate::time::Hertz; | 37 | use crate::time::Hertz; |
| 38 | 38 | ||
| 39 | #[cfg(feature = "low-power")] | 39 | #[cfg(feature = "low-power")] |
diff --git a/embassy-stm32/src/rcc/u5.rs b/embassy-stm32/src/rcc/u5.rs index 06895a99a..7b0dcb63f 100644 --- a/embassy-stm32/src/rcc/u5.rs +++ b/embassy-stm32/src/rcc/u5.rs | |||
| @@ -6,9 +6,9 @@ pub use crate::pac::rcc::vals::{ | |||
| 6 | Pllsrc as PllSource, Ppre as APBPrescaler, Sw as Sysclk, | 6 | Pllsrc as PllSource, Ppre as APBPrescaler, Sw as Sysclk, |
| 7 | }; | 7 | }; |
| 8 | use crate::pac::rcc::vals::{Hseext, Msipllfast, Msipllsel, Msirgsel, Pllmboost, Pllrge}; | 8 | use crate::pac::rcc::vals::{Hseext, Msipllfast, Msipllsel, Msirgsel, Pllmboost, Pllrge}; |
| 9 | #[cfg(all(peri_usb_otg_hs))] | ||
| 10 | pub use crate::pac::{syscfg::vals::Usbrefcksel, SYSCFG}; | ||
| 11 | use crate::pac::{FLASH, PWR, RCC}; | 9 | use crate::pac::{FLASH, PWR, RCC}; |
| 10 | #[cfg(all(peri_usb_otg_hs))] | ||
| 11 | pub use crate::pac::{SYSCFG, syscfg::vals::Usbrefcksel}; | ||
| 12 | use crate::rcc::LSI_FREQ; | 12 | use crate::rcc::LSI_FREQ; |
| 13 | use crate::time::Hertz; | 13 | use crate::time::Hertz; |
| 14 | 14 | ||
| @@ -442,7 +442,10 @@ pub(crate) unsafe fn init(config: Config) { | |||
| 442 | Hertz(24_000_000) => Usbrefcksel::MHZ24, | 442 | Hertz(24_000_000) => Usbrefcksel::MHZ24, |
| 443 | Hertz(26_000_000) => Usbrefcksel::MHZ26, | 443 | Hertz(26_000_000) => Usbrefcksel::MHZ26, |
| 444 | Hertz(32_000_000) => Usbrefcksel::MHZ32, | 444 | Hertz(32_000_000) => Usbrefcksel::MHZ32, |
| 445 | _ => panic!("cannot select OTG_HS reference clock with source frequency of {}, must be one of 16, 19.2, 20, 24, 26, 32 MHz", clk_val), | 445 | _ => panic!( |
| 446 | "cannot select OTG_HS reference clock with source frequency of {}, must be one of 16, 19.2, 20, 24, 26, 32 MHz", | ||
| 447 | clk_val | ||
| 448 | ), | ||
| 446 | }, | 449 | }, |
| 447 | None => Usbrefcksel::MHZ24, | 450 | None => Usbrefcksel::MHZ24, |
| 448 | }; | 451 | }; |
diff --git a/embassy-stm32/src/rcc/wba.rs b/embassy-stm32/src/rcc/wba.rs index 481437939..2528996d5 100644 --- a/embassy-stm32/src/rcc/wba.rs +++ b/embassy-stm32/src/rcc/wba.rs | |||
| @@ -7,9 +7,9 @@ pub use crate::pac::rcc::vals::{ | |||
| 7 | Hdiv5, Hpre as AHBPrescaler, Hpre5 as AHB5Prescaler, Hsepre as HsePrescaler, Plldiv as PllDiv, Pllm as PllPreDiv, | 7 | Hdiv5, Hpre as AHBPrescaler, Hpre5 as AHB5Prescaler, Hsepre as HsePrescaler, Plldiv as PllDiv, Pllm as PllPreDiv, |
| 8 | Plln as PllMul, Pllsrc as PllSource, Ppre as APBPrescaler, Sai1sel, Sw as Sysclk, | 8 | Plln as PllMul, Pllsrc as PllSource, Ppre as APBPrescaler, Sai1sel, Sw as Sysclk, |
| 9 | }; | 9 | }; |
| 10 | #[cfg(all(peri_usb_otg_hs))] | ||
| 11 | pub use crate::pac::{syscfg::vals::Usbrefcksel, SYSCFG}; | ||
| 12 | use crate::pac::{FLASH, RCC}; | 10 | use crate::pac::{FLASH, RCC}; |
| 11 | #[cfg(all(peri_usb_otg_hs))] | ||
| 12 | pub use crate::pac::{SYSCFG, syscfg::vals::Usbrefcksel}; | ||
| 13 | use crate::rcc::LSI_FREQ; | 13 | use crate::rcc::LSI_FREQ; |
| 14 | use crate::time::Hertz; | 14 | use crate::time::Hertz; |
| 15 | 15 | ||
| @@ -245,7 +245,10 @@ pub(crate) unsafe fn init(config: Config) { | |||
| 245 | Hertz(24_000_000) => Usbrefcksel::MHZ24, | 245 | Hertz(24_000_000) => Usbrefcksel::MHZ24, |
| 246 | Hertz(26_000_000) => Usbrefcksel::MHZ26, | 246 | Hertz(26_000_000) => Usbrefcksel::MHZ26, |
| 247 | Hertz(32_000_000) => Usbrefcksel::MHZ32, | 247 | Hertz(32_000_000) => Usbrefcksel::MHZ32, |
| 248 | _ => panic!("cannot select OTG_HS reference clock with source frequency of {}, must be one of 16, 19.2, 20, 24, 26, 32 MHz", clk_val), | 248 | _ => panic!( |
| 249 | "cannot select OTG_HS reference clock with source frequency of {}, must be one of 16, 19.2, 20, 24, 26, 32 MHz", | ||
| 250 | clk_val | ||
| 251 | ), | ||
| 249 | }, | 252 | }, |
| 250 | None => Usbrefcksel::MHZ24, | 253 | None => Usbrefcksel::MHZ24, |
| 251 | }; | 254 | }; |
diff --git a/embassy-stm32/src/rng.rs b/embassy-stm32/src/rng.rs index 63654639e..dada9bda1 100644 --- a/embassy-stm32/src/rng.rs +++ b/embassy-stm32/src/rng.rs | |||
| @@ -9,7 +9,7 @@ use embassy_hal_internal::PeripheralType; | |||
| 9 | use embassy_sync::waitqueue::AtomicWaker; | 9 | use embassy_sync::waitqueue::AtomicWaker; |
| 10 | 10 | ||
| 11 | use crate::interrupt::typelevel::Interrupt; | 11 | use crate::interrupt::typelevel::Interrupt; |
| 12 | use crate::{interrupt, pac, peripherals, rcc, Peri}; | 12 | use crate::{Peri, interrupt, pac, peripherals, rcc}; |
| 13 | 13 | ||
| 14 | static RNG_WAKER: AtomicWaker = AtomicWaker::new(); | 14 | static RNG_WAKER: AtomicWaker = AtomicWaker::new(); |
| 15 | 15 | ||
diff --git a/embassy-stm32/src/rtc/low_power.rs b/embassy-stm32/src/rtc/low_power.rs index a81ac6746..999f24714 100644 --- a/embassy-stm32/src/rtc/low_power.rs +++ b/embassy-stm32/src/rtc/low_power.rs | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | #[cfg(feature = "time")] | 1 | #[cfg(feature = "time")] |
| 2 | use embassy_time::{Duration, TICK_HZ}; | 2 | use embassy_time::{Duration, TICK_HZ}; |
| 3 | 3 | ||
| 4 | use super::{bcd2_to_byte, DateTimeError, Rtc, RtcError}; | 4 | use super::{DateTimeError, Rtc, RtcError, bcd2_to_byte}; |
| 5 | use crate::interrupt::typelevel::Interrupt; | 5 | use crate::interrupt::typelevel::Interrupt; |
| 6 | use crate::peripherals::RTC; | 6 | use crate::peripherals::RTC; |
| 7 | use crate::rtc::SealedInstance; | 7 | use crate::rtc::SealedInstance; |
diff --git a/embassy-stm32/src/rtc/mod.rs b/embassy-stm32/src/rtc/mod.rs index 92dec0960..bc6df528b 100644 --- a/embassy-stm32/src/rtc/mod.rs +++ b/embassy-stm32/src/rtc/mod.rs | |||
| @@ -8,12 +8,12 @@ mod low_power; | |||
| 8 | use core::cell::Cell; | 8 | use core::cell::Cell; |
| 9 | 9 | ||
| 10 | #[cfg(feature = "low-power")] | 10 | #[cfg(feature = "low-power")] |
| 11 | use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex; | ||
| 12 | #[cfg(feature = "low-power")] | ||
| 13 | use embassy_sync::blocking_mutex::Mutex; | 11 | use embassy_sync::blocking_mutex::Mutex; |
| 12 | #[cfg(feature = "low-power")] | ||
| 13 | use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex; | ||
| 14 | 14 | ||
| 15 | use self::datetime::{day_of_week_from_u8, day_of_week_to_u8}; | ||
| 16 | pub use self::datetime::{DateTime, DayOfWeek, Error as DateTimeError}; | 15 | pub use self::datetime::{DateTime, DayOfWeek, Error as DateTimeError}; |
| 16 | use self::datetime::{day_of_week_from_u8, day_of_week_to_u8}; | ||
| 17 | use crate::pac::rtc::regs::{Dr, Tr}; | 17 | use crate::pac::rtc::regs::{Dr, Tr}; |
| 18 | use crate::time::Hertz; | 18 | use crate::time::Hertz; |
| 19 | 19 | ||
| @@ -25,8 +25,8 @@ mod _version; | |||
| 25 | #[allow(unused_imports)] | 25 | #[allow(unused_imports)] |
| 26 | pub use _version::*; | 26 | pub use _version::*; |
| 27 | 27 | ||
| 28 | use crate::peripherals::RTC; | ||
| 29 | use crate::Peri; | 28 | use crate::Peri; |
| 29 | use crate::peripherals::RTC; | ||
| 30 | 30 | ||
| 31 | /// Errors that can occur on methods on [RtcClock] | 31 | /// Errors that can occur on methods on [RtcClock] |
| 32 | #[non_exhaustive] | 32 | #[non_exhaustive] |
diff --git a/embassy-stm32/src/rtc/v3.rs b/embassy-stm32/src/rtc/v3.rs index d0b52049e..01da5d70a 100644 --- a/embassy-stm32/src/rtc/v3.rs +++ b/embassy-stm32/src/rtc/v3.rs | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | use stm32_metapac::rtc::vals::{Calp, Calw16, Calw8, Fmt, Key, Osel, Pol, TampalrmType}; | 1 | use stm32_metapac::rtc::vals::{Calp, Calw8, Calw16, Fmt, Key, Osel, Pol, TampalrmType}; |
| 2 | 2 | ||
| 3 | use super::RtcCalibrationCyclePeriod; | 3 | use super::RtcCalibrationCyclePeriod; |
| 4 | use crate::pac::rtc::Rtc; | 4 | use crate::pac::rtc::Rtc; |
diff --git a/embassy-stm32/src/sai/mod.rs b/embassy-stm32/src/sai/mod.rs index fb8b23b79..726d1729a 100644 --- a/embassy-stm32/src/sai/mod.rs +++ b/embassy-stm32/src/sai/mod.rs | |||
| @@ -6,12 +6,12 @@ use core::marker::PhantomData; | |||
| 6 | use embassy_hal_internal::PeripheralType; | 6 | use embassy_hal_internal::PeripheralType; |
| 7 | 7 | ||
| 8 | pub use crate::dma::word; | 8 | pub use crate::dma::word; |
| 9 | use crate::dma::{ringbuffer, Channel, ReadableRingBuffer, Request, TransferOptions, WritableRingBuffer}; | 9 | use crate::dma::{Channel, ReadableRingBuffer, Request, TransferOptions, WritableRingBuffer, ringbuffer}; |
| 10 | use crate::gpio::{AfType, AnyPin, OutputType, Pull, SealedPin as _, Speed}; | 10 | use crate::gpio::{AfType, AnyPin, OutputType, Pull, SealedPin as _, Speed}; |
| 11 | pub use crate::pac::sai::vals::Mckdiv as MasterClockDivider; | 11 | pub use crate::pac::sai::vals::Mckdiv as MasterClockDivider; |
| 12 | use crate::pac::sai::{vals, Sai as Regs}; | 12 | use crate::pac::sai::{Sai as Regs, vals}; |
| 13 | use crate::rcc::{self, RccPeripheral}; | 13 | use crate::rcc::{self, RccPeripheral}; |
| 14 | use crate::{peripherals, Peri}; | 14 | use crate::{Peri, peripherals}; |
| 15 | 15 | ||
| 16 | /// SAI error | 16 | /// SAI error |
| 17 | #[derive(Debug, PartialEq, Eq, Clone, Copy)] | 17 | #[derive(Debug, PartialEq, Eq, Clone, Copy)] |
diff --git a/embassy-stm32/src/sdmmc/mod.rs b/embassy-stm32/src/sdmmc/mod.rs index ccbd16cbf..408d1b764 100644 --- a/embassy-stm32/src/sdmmc/mod.rs +++ b/embassy-stm32/src/sdmmc/mod.rs | |||
| @@ -11,9 +11,9 @@ use embassy_hal_internal::drop::OnDrop; | |||
| 11 | use embassy_hal_internal::{Peri, PeripheralType}; | 11 | use embassy_hal_internal::{Peri, PeripheralType}; |
| 12 | use embassy_sync::waitqueue::AtomicWaker; | 12 | use embassy_sync::waitqueue::AtomicWaker; |
| 13 | use sdio_host::common_cmd::{self, Resp, ResponseLen}; | 13 | use sdio_host::common_cmd::{self, Resp, ResponseLen}; |
| 14 | use sdio_host::emmc::{ExtCSD, EMMC}; | 14 | use sdio_host::emmc::{EMMC, ExtCSD}; |
| 15 | use sdio_host::sd::{BusWidth, CardCapacity, CardStatus, CurrentState, SDStatus, CIC, CID, CSD, OCR, RCA, SCR, SD}; | 15 | use sdio_host::sd::{BusWidth, CIC, CID, CSD, CardCapacity, CardStatus, CurrentState, OCR, RCA, SCR, SD, SDStatus}; |
| 16 | use sdio_host::{emmc_cmd, sd_cmd, Cmd}; | 16 | use sdio_host::{Cmd, emmc_cmd, sd_cmd}; |
| 17 | 17 | ||
| 18 | #[cfg(sdmmc_v1)] | 18 | #[cfg(sdmmc_v1)] |
| 19 | use crate::dma::ChannelAndRequest; | 19 | use crate::dma::ChannelAndRequest; |
diff --git a/embassy-stm32/src/spdifrx/mod.rs b/embassy-stm32/src/spdifrx/mod.rs index b0a32d5d1..6f2d24560 100644 --- a/embassy-stm32/src/spdifrx/mod.rs +++ b/embassy-stm32/src/spdifrx/mod.rs | |||
| @@ -13,7 +13,7 @@ use crate::gpio::{AfType, AnyPin, Pull, SealedPin as _}; | |||
| 13 | use crate::interrupt::typelevel::Interrupt; | 13 | use crate::interrupt::typelevel::Interrupt; |
| 14 | use crate::pac::spdifrx::Spdifrx as Regs; | 14 | use crate::pac::spdifrx::Spdifrx as Regs; |
| 15 | use crate::rcc::{RccInfo, SealedRccPeripheral}; | 15 | use crate::rcc::{RccInfo, SealedRccPeripheral}; |
| 16 | use crate::{interrupt, peripherals, Peri}; | 16 | use crate::{Peri, interrupt, peripherals}; |
| 17 | 17 | ||
| 18 | /// Possible S/PDIF preamble types. | 18 | /// Possible S/PDIF preamble types. |
| 19 | #[allow(dead_code)] | 19 | #[allow(dead_code)] |
diff --git a/embassy-stm32/src/spi/mod.rs b/embassy-stm32/src/spi/mod.rs index c5373a54d..c27d09ea7 100644 --- a/embassy-stm32/src/spi/mod.rs +++ b/embassy-stm32/src/spi/mod.rs | |||
| @@ -6,15 +6,15 @@ use core::ptr; | |||
| 6 | 6 | ||
| 7 | use embassy_embedded_hal::SetConfig; | 7 | use embassy_embedded_hal::SetConfig; |
| 8 | use embassy_futures::join::join; | 8 | use embassy_futures::join::join; |
| 9 | pub use embedded_hal_02::spi::{Mode, Phase, Polarity, MODE_0, MODE_1, MODE_2, MODE_3}; | 9 | pub use embedded_hal_02::spi::{MODE_0, MODE_1, MODE_2, MODE_3, Mode, Phase, Polarity}; |
| 10 | 10 | ||
| 11 | use crate::dma::{word, ChannelAndRequest}; | 11 | use crate::Peri; |
| 12 | use crate::dma::{ChannelAndRequest, word}; | ||
| 12 | use crate::gpio::{AfType, AnyPin, OutputType, Pull, SealedPin as _, Speed}; | 13 | use crate::gpio::{AfType, AnyPin, OutputType, Pull, SealedPin as _, Speed}; |
| 13 | use crate::mode::{Async, Blocking, Mode as PeriMode}; | 14 | use crate::mode::{Async, Blocking, Mode as PeriMode}; |
| 14 | use crate::pac::spi::{regs, vals, Spi as Regs}; | 15 | use crate::pac::spi::{Spi as Regs, regs, vals}; |
| 15 | use crate::rcc::{RccInfo, SealedRccPeripheral}; | 16 | use crate::rcc::{RccInfo, SealedRccPeripheral}; |
| 16 | use crate::time::Hertz; | 17 | use crate::time::Hertz; |
| 17 | use crate::Peri; | ||
| 18 | 18 | ||
| 19 | /// SPI error. | 19 | /// SPI error. |
| 20 | #[derive(Debug, PartialEq, Eq, Clone, Copy)] | 20 | #[derive(Debug, PartialEq, Eq, Clone, Copy)] |
diff --git a/embassy-stm32/src/time_driver.rs b/embassy-stm32/src/time_driver.rs index 7db74bdf6..74b10a183 100644 --- a/embassy-stm32/src/time_driver.rs +++ b/embassy-stm32/src/time_driver.rs | |||
| @@ -1,14 +1,14 @@ | |||
| 1 | #![allow(non_snake_case)] | 1 | #![allow(non_snake_case)] |
| 2 | 2 | ||
| 3 | use core::cell::{Cell, RefCell}; | 3 | use core::cell::{Cell, RefCell}; |
| 4 | use core::sync::atomic::{compiler_fence, AtomicU32, Ordering}; | 4 | use core::sync::atomic::{AtomicU32, Ordering, compiler_fence}; |
| 5 | 5 | ||
| 6 | use critical_section::CriticalSection; | 6 | use critical_section::CriticalSection; |
| 7 | use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex; | ||
| 8 | use embassy_sync::blocking_mutex::Mutex; | 7 | use embassy_sync::blocking_mutex::Mutex; |
| 8 | use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex; | ||
| 9 | use embassy_time_driver::{Driver, TICK_HZ}; | 9 | use embassy_time_driver::{Driver, TICK_HZ}; |
| 10 | use embassy_time_queue_utils::Queue; | 10 | use embassy_time_queue_utils::Queue; |
| 11 | use stm32_metapac::timer::{regs, TimGp16}; | 11 | use stm32_metapac::timer::{TimGp16, regs}; |
| 12 | 12 | ||
| 13 | use crate::interrupt::typelevel::Interrupt; | 13 | use crate::interrupt::typelevel::Interrupt; |
| 14 | use crate::pac::timer::vals; | 14 | use crate::pac::timer::vals; |
diff --git a/embassy-stm32/src/timer/complementary_pwm.rs b/embassy-stm32/src/timer/complementary_pwm.rs index 484aae1d0..75a83629c 100644 --- a/embassy-stm32/src/timer/complementary_pwm.rs +++ b/embassy-stm32/src/timer/complementary_pwm.rs | |||
| @@ -7,11 +7,11 @@ pub use stm32_metapac::timer::vals::{Ckd, Ossi, Ossr}; | |||
| 7 | use super::low_level::{CountingMode, OutputPolarity, Timer}; | 7 | use super::low_level::{CountingMode, OutputPolarity, Timer}; |
| 8 | use super::simple_pwm::PwmPin; | 8 | use super::simple_pwm::PwmPin; |
| 9 | use super::{AdvancedInstance4Channel, Ch1, Ch2, Ch3, Ch4, Channel, TimerComplementaryPin}; | 9 | use super::{AdvancedInstance4Channel, Ch1, Ch2, Ch3, Ch4, Channel, TimerComplementaryPin}; |
| 10 | use crate::Peri; | ||
| 10 | use crate::gpio::{AnyPin, OutputType}; | 11 | use crate::gpio::{AnyPin, OutputType}; |
| 11 | use crate::time::Hertz; | 12 | use crate::time::Hertz; |
| 12 | use crate::timer::low_level::OutputCompareMode; | ||
| 13 | use crate::timer::TimerChannel; | 13 | use crate::timer::TimerChannel; |
| 14 | use crate::Peri; | 14 | use crate::timer::low_level::OutputCompareMode; |
| 15 | 15 | ||
| 16 | /// Complementary PWM pin wrapper. | 16 | /// Complementary PWM pin wrapper. |
| 17 | /// | 17 | /// |
| @@ -388,7 +388,7 @@ fn compute_dead_time_value(value: u16) -> (Ckd, u8) { | |||
| 388 | 388 | ||
| 389 | #[cfg(test)] | 389 | #[cfg(test)] |
| 390 | mod tests { | 390 | mod tests { |
| 391 | use super::{compute_dead_time_value, Ckd}; | 391 | use super::{Ckd, compute_dead_time_value}; |
| 392 | 392 | ||
| 393 | #[test] | 393 | #[test] |
| 394 | fn test_compute_dead_time_value() { | 394 | fn test_compute_dead_time_value() { |
diff --git a/embassy-stm32/src/timer/input_capture.rs b/embassy-stm32/src/timer/input_capture.rs index 7a25e6c21..2a4ec2db0 100644 --- a/embassy-stm32/src/timer/input_capture.rs +++ b/embassy-stm32/src/timer/input_capture.rs | |||
| @@ -8,11 +8,11 @@ use core::task::{Context, Poll}; | |||
| 8 | use super::low_level::{CountingMode, FilterValue, InputCaptureMode, InputTISelection, Timer}; | 8 | use super::low_level::{CountingMode, FilterValue, InputCaptureMode, InputTISelection, Timer}; |
| 9 | use super::{CaptureCompareInterruptHandler, Channel, GeneralInstance4Channel, TimerPin}; | 9 | use super::{CaptureCompareInterruptHandler, Channel, GeneralInstance4Channel, TimerPin}; |
| 10 | pub use super::{Ch1, Ch2, Ch3, Ch4}; | 10 | pub use super::{Ch1, Ch2, Ch3, Ch4}; |
| 11 | use crate::Peri; | ||
| 11 | use crate::gpio::{AfType, AnyPin, Pull}; | 12 | use crate::gpio::{AfType, AnyPin, Pull}; |
| 12 | use crate::interrupt::typelevel::{Binding, Interrupt}; | 13 | use crate::interrupt::typelevel::{Binding, Interrupt}; |
| 13 | use crate::time::Hertz; | 14 | use crate::time::Hertz; |
| 14 | use crate::timer::TimerChannel; | 15 | use crate::timer::TimerChannel; |
| 15 | use crate::Peri; | ||
| 16 | 16 | ||
| 17 | /// Capture pin wrapper. | 17 | /// Capture pin wrapper. |
| 18 | /// | 18 | /// |
diff --git a/embassy-stm32/src/timer/one_pulse.rs b/embassy-stm32/src/timer/one_pulse.rs index a75b41bd7..fe8681356 100644 --- a/embassy-stm32/src/timer/one_pulse.rs +++ b/embassy-stm32/src/timer/one_pulse.rs | |||
| @@ -11,12 +11,12 @@ use super::low_level::{ | |||
| 11 | }; | 11 | }; |
| 12 | use super::{CaptureCompareInterruptHandler, Channel, ExternalTriggerPin, GeneralInstance4Channel, TimerPin}; | 12 | use super::{CaptureCompareInterruptHandler, Channel, ExternalTriggerPin, GeneralInstance4Channel, TimerPin}; |
| 13 | pub use super::{Ch1, Ch2}; | 13 | pub use super::{Ch1, Ch2}; |
| 14 | use crate::Peri; | ||
| 14 | use crate::gpio::{AfType, AnyPin, Pull}; | 15 | use crate::gpio::{AfType, AnyPin, Pull}; |
| 15 | use crate::interrupt::typelevel::{Binding, Interrupt}; | 16 | use crate::interrupt::typelevel::{Binding, Interrupt}; |
| 16 | use crate::pac::timer::vals::Etp; | 17 | use crate::pac::timer::vals::Etp; |
| 17 | use crate::time::Hertz; | 18 | use crate::time::Hertz; |
| 18 | use crate::timer::TimerChannel; | 19 | use crate::timer::TimerChannel; |
| 19 | use crate::Peri; | ||
| 20 | 20 | ||
| 21 | /// External input marker type. | 21 | /// External input marker type. |
| 22 | pub enum Ext {} | 22 | pub enum Ext {} |
diff --git a/embassy-stm32/src/timer/pwm_input.rs b/embassy-stm32/src/timer/pwm_input.rs index 159b5a177..da8a79b09 100644 --- a/embassy-stm32/src/timer/pwm_input.rs +++ b/embassy-stm32/src/timer/pwm_input.rs | |||
| @@ -2,9 +2,9 @@ | |||
| 2 | 2 | ||
| 3 | use super::low_level::{CountingMode, InputCaptureMode, InputTISelection, SlaveMode, Timer, TriggerSource}; | 3 | use super::low_level::{CountingMode, InputCaptureMode, InputTISelection, SlaveMode, Timer, TriggerSource}; |
| 4 | use super::{Ch1, Ch2, Channel, GeneralInstance4Channel, TimerPin}; | 4 | use super::{Ch1, Ch2, Channel, GeneralInstance4Channel, TimerPin}; |
| 5 | use crate::Peri; | ||
| 5 | use crate::gpio::{AfType, Pull}; | 6 | use crate::gpio::{AfType, Pull}; |
| 6 | use crate::time::Hertz; | 7 | use crate::time::Hertz; |
| 7 | use crate::Peri; | ||
| 8 | 8 | ||
| 9 | /// PWM Input driver. | 9 | /// PWM Input driver. |
| 10 | /// | 10 | /// |
diff --git a/embassy-stm32/src/timer/qei.rs b/embassy-stm32/src/timer/qei.rs index bb152731c..a547a2a19 100644 --- a/embassy-stm32/src/timer/qei.rs +++ b/embassy-stm32/src/timer/qei.rs | |||
| @@ -5,9 +5,9 @@ use stm32_metapac::timer::vals::{self, Sms}; | |||
| 5 | use super::low_level::Timer; | 5 | use super::low_level::Timer; |
| 6 | pub use super::{Ch1, Ch2}; | 6 | pub use super::{Ch1, Ch2}; |
| 7 | use super::{GeneralInstance4Channel, TimerPin}; | 7 | use super::{GeneralInstance4Channel, TimerPin}; |
| 8 | use crate::Peri; | ||
| 8 | use crate::gpio::{AfType, AnyPin, Pull}; | 9 | use crate::gpio::{AfType, AnyPin, Pull}; |
| 9 | use crate::timer::TimerChannel; | 10 | use crate::timer::TimerChannel; |
| 10 | use crate::Peri; | ||
| 11 | 11 | ||
| 12 | /// Qei driver config. | 12 | /// Qei driver config. |
| 13 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 13 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
diff --git a/embassy-stm32/src/timer/simple_pwm.rs b/embassy-stm32/src/timer/simple_pwm.rs index e6165e42b..06315d7f3 100644 --- a/embassy-stm32/src/timer/simple_pwm.rs +++ b/embassy-stm32/src/timer/simple_pwm.rs | |||
| @@ -5,11 +5,11 @@ use core::mem::ManuallyDrop; | |||
| 5 | 5 | ||
| 6 | use super::low_level::{CountingMode, OutputCompareMode, OutputPolarity, Timer}; | 6 | use super::low_level::{CountingMode, OutputCompareMode, OutputPolarity, Timer}; |
| 7 | use super::{Ch1, Ch2, Ch3, Ch4, Channel, GeneralInstance4Channel, TimerBits, TimerChannel, TimerPin}; | 7 | use super::{Ch1, Ch2, Ch3, Ch4, Channel, GeneralInstance4Channel, TimerBits, TimerChannel, TimerPin}; |
| 8 | use crate::Peri; | ||
| 8 | #[cfg(gpio_v2)] | 9 | #[cfg(gpio_v2)] |
| 9 | use crate::gpio::Pull; | 10 | use crate::gpio::Pull; |
| 10 | use crate::gpio::{AfType, AnyPin, OutputType, Speed}; | 11 | use crate::gpio::{AfType, AnyPin, OutputType, Speed}; |
| 11 | use crate::time::Hertz; | 12 | use crate::time::Hertz; |
| 12 | use crate::Peri; | ||
| 13 | 13 | ||
| 14 | /// PWM pin wrapper. | 14 | /// PWM pin wrapper. |
| 15 | /// | 15 | /// |
diff --git a/embassy-stm32/src/tsc/acquisition_banks.rs b/embassy-stm32/src/tsc/acquisition_banks.rs index 7d6442b48..097cf7942 100644 --- a/embassy-stm32/src/tsc/acquisition_banks.rs +++ b/embassy-stm32/src/tsc/acquisition_banks.rs | |||
| @@ -1,11 +1,11 @@ | |||
| 1 | use super::TSC_NUM_GROUPS; | ||
| 1 | use super::io_pin::*; | 2 | use super::io_pin::*; |
| 2 | #[cfg(any(tsc_v2, tsc_v3))] | 3 | #[cfg(any(tsc_v2, tsc_v3))] |
| 3 | use super::pin_groups::G7; | 4 | use super::pin_groups::G7; |
| 4 | #[cfg(tsc_v3)] | 5 | #[cfg(tsc_v3)] |
| 5 | use super::pin_groups::G8; | 6 | use super::pin_groups::G8; |
| 6 | use super::pin_groups::{pin_roles, G1, G2, G3, G4, G5, G6}; | 7 | use super::pin_groups::{G1, G2, G3, G4, G5, G6, pin_roles}; |
| 7 | use super::types::{Group, GroupStatus}; | 8 | use super::types::{Group, GroupStatus}; |
| 8 | use super::TSC_NUM_GROUPS; | ||
| 9 | 9 | ||
| 10 | /// Represents a collection of TSC (Touch Sensing Controller) pins for an acquisition bank. | 10 | /// Represents a collection of TSC (Touch Sensing Controller) pins for an acquisition bank. |
| 11 | /// | 11 | /// |
diff --git a/embassy-stm32/src/tsc/pin_groups.rs b/embassy-stm32/src/tsc/pin_groups.rs index 84421f7ff..9347e6bc0 100644 --- a/embassy-stm32/src/tsc/pin_groups.rs +++ b/embassy-stm32/src/tsc/pin_groups.rs | |||
| @@ -1,11 +1,11 @@ | |||
| 1 | use core::marker::PhantomData; | 1 | use core::marker::PhantomData; |
| 2 | use core::ops::BitOr; | 2 | use core::ops::BitOr; |
| 3 | 3 | ||
| 4 | use super::Instance; | ||
| 4 | use super::errors::GroupError; | 5 | use super::errors::GroupError; |
| 5 | use super::io_pin::*; | 6 | use super::io_pin::*; |
| 6 | use super::Instance; | ||
| 7 | use crate::gpio::{AfType, AnyPin, OutputType, Speed}; | ||
| 8 | use crate::Peri; | 7 | use crate::Peri; |
| 8 | use crate::gpio::{AfType, AnyPin, OutputType, Speed}; | ||
| 9 | 9 | ||
| 10 | /// Pin type definition to control IO parameters | 10 | /// Pin type definition to control IO parameters |
| 11 | #[derive(PartialEq, Clone, Copy)] | 11 | #[derive(PartialEq, Clone, Copy)] |
diff --git a/embassy-stm32/src/ucpd.rs b/embassy-stm32/src/ucpd.rs index 18aff4fbd..8f259a917 100644 --- a/embassy-stm32/src/ucpd.rs +++ b/embassy-stm32/src/ucpd.rs | |||
| @@ -19,8 +19,8 @@ use core::marker::PhantomData; | |||
| 19 | use core::sync::atomic::{AtomicBool, Ordering}; | 19 | use core::sync::atomic::{AtomicBool, Ordering}; |
| 20 | use core::task::Poll; | 20 | use core::task::Poll; |
| 21 | 21 | ||
| 22 | use embassy_hal_internal::drop::OnDrop; | ||
| 23 | use embassy_hal_internal::PeripheralType; | 22 | use embassy_hal_internal::PeripheralType; |
| 23 | use embassy_hal_internal::drop::OnDrop; | ||
| 24 | use embassy_sync::waitqueue::AtomicWaker; | 24 | use embassy_sync::waitqueue::AtomicWaker; |
| 25 | 25 | ||
| 26 | use crate::dma::{ChannelAndRequest, TransferOptions}; | 26 | use crate::dma::{ChannelAndRequest, TransferOptions}; |
| @@ -28,7 +28,7 @@ use crate::interrupt::typelevel::Interrupt; | |||
| 28 | use crate::pac::ucpd::vals::{Anamode, Ccenable, PscUsbpdclk, Txmode}; | 28 | use crate::pac::ucpd::vals::{Anamode, Ccenable, PscUsbpdclk, Txmode}; |
| 29 | pub use crate::pac::ucpd::vals::{Phyccsel as CcSel, Rxordset, TypecVstateCc as CcVState}; | 29 | pub use crate::pac::ucpd::vals::{Phyccsel as CcSel, Rxordset, TypecVstateCc as CcVState}; |
| 30 | use crate::rcc::{self, RccPeripheral}; | 30 | use crate::rcc::{self, RccPeripheral}; |
| 31 | use crate::{interrupt, Peri}; | 31 | use crate::{Peri, interrupt}; |
| 32 | 32 | ||
| 33 | pub(crate) fn init( | 33 | pub(crate) fn init( |
| 34 | _cs: critical_section::CriticalSection, | 34 | _cs: critical_section::CriticalSection, |
diff --git a/embassy-stm32/src/usart/buffered.rs b/embassy-stm32/src/usart/buffered.rs index 10dc02334..69c3a740f 100644 --- a/embassy-stm32/src/usart/buffered.rs +++ b/embassy-stm32/src/usart/buffered.rs | |||
| @@ -5,16 +5,16 @@ use core::sync::atomic::{AtomicBool, AtomicU8, AtomicUsize, Ordering}; | |||
| 5 | use core::task::Poll; | 5 | use core::task::Poll; |
| 6 | 6 | ||
| 7 | use embassy_embedded_hal::SetConfig; | 7 | use embassy_embedded_hal::SetConfig; |
| 8 | use embassy_hal_internal::atomic_ring_buffer::RingBuffer; | ||
| 9 | use embassy_hal_internal::Peri; | 8 | use embassy_hal_internal::Peri; |
| 9 | use embassy_hal_internal::atomic_ring_buffer::RingBuffer; | ||
| 10 | use embassy_sync::waitqueue::AtomicWaker; | 10 | use embassy_sync::waitqueue::AtomicWaker; |
| 11 | 11 | ||
| 12 | #[cfg(not(any(usart_v1, usart_v2)))] | 12 | #[cfg(not(any(usart_v1, usart_v2)))] |
| 13 | use super::DePin; | 13 | use super::DePin; |
| 14 | use super::{ | 14 | use super::{ |
| 15 | Config, ConfigError, CtsPin, Duplex, Error, HalfDuplexReadback, Info, Instance, Regs, RtsPin, RxPin, TxPin, | ||
| 15 | clear_interrupt_flags, configure, half_duplex_set_rx_tx_before_write, rdr, reconfigure, send_break, set_baudrate, | 16 | clear_interrupt_flags, configure, half_duplex_set_rx_tx_before_write, rdr, reconfigure, send_break, set_baudrate, |
| 16 | sr, tdr, Config, ConfigError, CtsPin, Duplex, Error, HalfDuplexReadback, Info, Instance, Regs, RtsPin, RxPin, | 17 | sr, tdr, |
| 17 | TxPin, | ||
| 18 | }; | 18 | }; |
| 19 | use crate::gpio::{AfType, AnyPin, Pull, SealedPin as _}; | 19 | use crate::gpio::{AfType, AnyPin, Pull, SealedPin as _}; |
| 20 | use crate::interrupt::{self, InterruptExt}; | 20 | use crate::interrupt::{self, InterruptExt}; |
diff --git a/embassy-stm32/src/usart/mod.rs b/embassy-stm32/src/usart/mod.rs index 0d2d86aca..0e7da634d 100644 --- a/embassy-stm32/src/usart/mod.rs +++ b/embassy-stm32/src/usart/mod.rs | |||
| @@ -4,15 +4,16 @@ | |||
| 4 | 4 | ||
| 5 | use core::future::poll_fn; | 5 | use core::future::poll_fn; |
| 6 | use core::marker::PhantomData; | 6 | use core::marker::PhantomData; |
| 7 | use core::sync::atomic::{compiler_fence, AtomicU8, AtomicUsize, Ordering}; | 7 | use core::sync::atomic::{AtomicU8, AtomicUsize, Ordering, compiler_fence}; |
| 8 | use core::task::Poll; | 8 | use core::task::Poll; |
| 9 | 9 | ||
| 10 | use embassy_embedded_hal::SetConfig; | 10 | use embassy_embedded_hal::SetConfig; |
| 11 | use embassy_hal_internal::drop::OnDrop; | ||
| 12 | use embassy_hal_internal::PeripheralType; | 11 | use embassy_hal_internal::PeripheralType; |
| 12 | use embassy_hal_internal::drop::OnDrop; | ||
| 13 | use embassy_sync::waitqueue::AtomicWaker; | 13 | use embassy_sync::waitqueue::AtomicWaker; |
| 14 | use futures_util::future::{select, Either}; | 14 | use futures_util::future::{Either, select}; |
| 15 | 15 | ||
| 16 | use crate::Peri; | ||
| 16 | use crate::dma::ChannelAndRequest; | 17 | use crate::dma::ChannelAndRequest; |
| 17 | use crate::gpio::{AfType, AnyPin, OutputType, Pull, SealedPin as _, Speed}; | 18 | use crate::gpio::{AfType, AnyPin, OutputType, Pull, SealedPin as _, Speed}; |
| 18 | use crate::interrupt::typelevel::Interrupt as _; | 19 | use crate::interrupt::typelevel::Interrupt as _; |
| @@ -25,7 +26,6 @@ use crate::pac::usart::Usart as Regs; | |||
| 25 | use crate::pac::usart::{regs, vals}; | 26 | use crate::pac::usart::{regs, vals}; |
| 26 | use crate::rcc::{RccInfo, SealedRccPeripheral}; | 27 | use crate::rcc::{RccInfo, SealedRccPeripheral}; |
| 27 | use crate::time::Hertz; | 28 | use crate::time::Hertz; |
| 28 | use crate::Peri; | ||
| 29 | 29 | ||
| 30 | /// Interrupt handler. | 30 | /// Interrupt handler. |
| 31 | pub struct InterruptHandler<T: Instance> { | 31 | pub struct InterruptHandler<T: Instance> { |
diff --git a/embassy-stm32/src/usart/ringbuffered.rs b/embassy-stm32/src/usart/ringbuffered.rs index 27071fb31..20bfefd9e 100644 --- a/embassy-stm32/src/usart/ringbuffered.rs +++ b/embassy-stm32/src/usart/ringbuffered.rs | |||
| @@ -1,19 +1,19 @@ | |||
| 1 | use core::future::poll_fn; | 1 | use core::future::poll_fn; |
| 2 | use core::mem; | 2 | use core::mem; |
| 3 | use core::sync::atomic::{compiler_fence, Ordering}; | 3 | use core::sync::atomic::{Ordering, compiler_fence}; |
| 4 | use core::task::Poll; | 4 | use core::task::Poll; |
| 5 | 5 | ||
| 6 | use embassy_embedded_hal::SetConfig; | 6 | use embassy_embedded_hal::SetConfig; |
| 7 | use embedded_io_async::ReadReady; | 7 | use embedded_io_async::ReadReady; |
| 8 | use futures_util::future::{select, Either}; | 8 | use futures_util::future::{Either, select}; |
| 9 | 9 | ||
| 10 | use super::{rdr, reconfigure, set_baudrate, sr, Config, ConfigError, Error, Info, State, UartRx}; | 10 | use super::{Config, ConfigError, Error, Info, State, UartRx, rdr, reconfigure, set_baudrate, sr}; |
| 11 | use crate::Peri; | ||
| 11 | use crate::dma::ReadableRingBuffer; | 12 | use crate::dma::ReadableRingBuffer; |
| 12 | use crate::gpio::{AnyPin, SealedPin as _}; | 13 | use crate::gpio::{AnyPin, SealedPin as _}; |
| 13 | use crate::mode::Async; | 14 | use crate::mode::Async; |
| 14 | use crate::time::Hertz; | 15 | use crate::time::Hertz; |
| 15 | use crate::usart::Regs; | 16 | use crate::usart::Regs; |
| 16 | use crate::Peri; | ||
| 17 | 17 | ||
| 18 | /// Rx-only Ring-buffered UART Driver | 18 | /// Rx-only Ring-buffered UART Driver |
| 19 | /// | 19 | /// |
diff --git a/embassy-stm32/src/usb/otg.rs b/embassy-stm32/src/usb/otg.rs index 5ce81b131..f6b1a81db 100644 --- a/embassy-stm32/src/usb/otg.rs +++ b/embassy-stm32/src/usb/otg.rs | |||
| @@ -2,18 +2,18 @@ use core::marker::PhantomData; | |||
| 2 | 2 | ||
| 3 | use embassy_hal_internal::PeripheralType; | 3 | use embassy_hal_internal::PeripheralType; |
| 4 | use embassy_usb_driver::{EndpointAddress, EndpointAllocError, EndpointType, Event, Unsupported}; | 4 | use embassy_usb_driver::{EndpointAddress, EndpointAllocError, EndpointType, Event, Unsupported}; |
| 5 | use embassy_usb_synopsys_otg::otg_v1::vals::Dspd; | ||
| 6 | use embassy_usb_synopsys_otg::otg_v1::Otg; | ||
| 7 | pub use embassy_usb_synopsys_otg::Config; | 5 | pub use embassy_usb_synopsys_otg::Config; |
| 6 | use embassy_usb_synopsys_otg::otg_v1::Otg; | ||
| 7 | use embassy_usb_synopsys_otg::otg_v1::vals::Dspd; | ||
| 8 | use embassy_usb_synopsys_otg::{ | 8 | use embassy_usb_synopsys_otg::{ |
| 9 | on_interrupt as on_interrupt_impl, Bus as OtgBus, ControlPipe, Driver as OtgDriver, Endpoint, In, OtgInstance, Out, | 9 | Bus as OtgBus, ControlPipe, Driver as OtgDriver, Endpoint, In, OtgInstance, Out, PhyType, State, |
| 10 | PhyType, State, | 10 | on_interrupt as on_interrupt_impl, |
| 11 | }; | 11 | }; |
| 12 | 12 | ||
| 13 | use crate::gpio::{AfType, OutputType, Speed}; | 13 | use crate::gpio::{AfType, OutputType, Speed}; |
| 14 | use crate::interrupt::typelevel::Interrupt; | 14 | use crate::interrupt::typelevel::Interrupt; |
| 15 | use crate::rcc::{self, RccPeripheral}; | 15 | use crate::rcc::{self, RccPeripheral}; |
| 16 | use crate::{interrupt, Peri}; | 16 | use crate::{Peri, interrupt}; |
| 17 | 17 | ||
| 18 | const MAX_EP_COUNT: usize = 9; | 18 | const MAX_EP_COUNT: usize = 9; |
| 19 | 19 | ||
diff --git a/embassy-stm32/src/usb/usb.rs b/embassy-stm32/src/usb/usb.rs index 9e08d99b3..d405e4802 100644 --- a/embassy-stm32/src/usb/usb.rs +++ b/embassy-stm32/src/usb/usb.rs | |||
| @@ -12,11 +12,11 @@ use embassy_usb_driver::{ | |||
| 12 | Direction, EndpointAddress, EndpointAllocError, EndpointError, EndpointInfo, EndpointType, Event, Unsupported, | 12 | Direction, EndpointAddress, EndpointAllocError, EndpointError, EndpointInfo, EndpointType, Event, Unsupported, |
| 13 | }; | 13 | }; |
| 14 | 14 | ||
| 15 | use crate::pac::USBRAM; | ||
| 15 | use crate::pac::usb::regs; | 16 | use crate::pac::usb::regs; |
| 16 | use crate::pac::usb::vals::{EpType, Stat}; | 17 | use crate::pac::usb::vals::{EpType, Stat}; |
| 17 | use crate::pac::USBRAM; | ||
| 18 | use crate::rcc::RccPeripheral; | 18 | use crate::rcc::RccPeripheral; |
| 19 | use crate::{interrupt, Peri}; | 19 | use crate::{Peri, interrupt}; |
| 20 | 20 | ||
| 21 | /// Interrupt handler. | 21 | /// Interrupt handler. |
| 22 | pub struct InterruptHandler<T: Instance> { | 22 | pub struct InterruptHandler<T: Instance> { |
diff --git a/embassy-stm32/src/vrefbuf/mod.rs b/embassy-stm32/src/vrefbuf/mod.rs index ccbd748d5..b061306a0 100644 --- a/embassy-stm32/src/vrefbuf/mod.rs +++ b/embassy-stm32/src/vrefbuf/mod.rs | |||
| @@ -62,8 +62,7 @@ impl<'d, T: Instance> VoltageReferenceBuffer<'d, T> { | |||
| 62 | } | 62 | } |
| 63 | trace!( | 63 | trace!( |
| 64 | "Vrefbuf configured with voltage scale {} and impedance mode {}", | 64 | "Vrefbuf configured with voltage scale {} and impedance mode {}", |
| 65 | voltage_scale as u8, | 65 | voltage_scale as u8, impedance_mode as u8, |
| 66 | impedance_mode as u8, | ||
| 67 | ); | 66 | ); |
| 68 | VoltageReferenceBuffer { vrefbuf: PhantomData } | 67 | VoltageReferenceBuffer { vrefbuf: PhantomData } |
| 69 | } | 68 | } |
diff --git a/embassy-stm32/src/wdg/mod.rs b/embassy-stm32/src/wdg/mod.rs index fb5c3d930..1164739ff 100644 --- a/embassy-stm32/src/wdg/mod.rs +++ b/embassy-stm32/src/wdg/mod.rs | |||
| @@ -4,8 +4,8 @@ use core::marker::PhantomData; | |||
| 4 | use embassy_hal_internal::PeripheralType; | 4 | use embassy_hal_internal::PeripheralType; |
| 5 | use stm32_metapac::iwdg::vals::{Key, Pr}; | 5 | use stm32_metapac::iwdg::vals::{Key, Pr}; |
| 6 | 6 | ||
| 7 | use crate::rcc::LSI_FREQ; | ||
| 8 | use crate::Peri; | 7 | use crate::Peri; |
| 8 | use crate::rcc::LSI_FREQ; | ||
| 9 | 9 | ||
| 10 | /// Independent watchdog (IWDG) driver. | 10 | /// Independent watchdog (IWDG) driver. |
| 11 | pub struct IndependentWatchdog<'d, T: Instance> { | 11 | pub struct IndependentWatchdog<'d, T: Instance> { |
diff --git a/embassy-stm32/src/xspi/mod.rs b/embassy-stm32/src/xspi/mod.rs index 901569f64..a80a2692b 100644 --- a/embassy-stm32/src/xspi/mod.rs +++ b/embassy-stm32/src/xspi/mod.rs | |||
| @@ -11,15 +11,15 @@ use embassy_embedded_hal::{GetConfig, SetConfig}; | |||
| 11 | use embassy_hal_internal::PeripheralType; | 11 | use embassy_hal_internal::PeripheralType; |
| 12 | pub use enums::*; | 12 | pub use enums::*; |
| 13 | 13 | ||
| 14 | use crate::dma::{word, ChannelAndRequest}; | 14 | use crate::dma::{ChannelAndRequest, word}; |
| 15 | use crate::gpio::{AfType, AnyPin, OutputType, Pull, SealedPin as _, Speed}; | 15 | use crate::gpio::{AfType, AnyPin, OutputType, Pull, SealedPin as _, Speed}; |
| 16 | use crate::mode::{Async, Blocking, Mode as PeriMode}; | 16 | use crate::mode::{Async, Blocking, Mode as PeriMode}; |
| 17 | use crate::pac::xspi::vals::*; | ||
| 18 | use crate::pac::xspi::Xspi as Regs; | 17 | use crate::pac::xspi::Xspi as Regs; |
| 18 | use crate::pac::xspi::vals::*; | ||
| 19 | #[cfg(xspim_v1)] | 19 | #[cfg(xspim_v1)] |
| 20 | use crate::pac::xspim::Xspim; | 20 | use crate::pac::xspim::Xspim; |
| 21 | use crate::rcc::{self, RccPeripheral}; | 21 | use crate::rcc::{self, RccPeripheral}; |
| 22 | use crate::{peripherals, Peri}; | 22 | use crate::{Peri, peripherals}; |
| 23 | 23 | ||
| 24 | /// XPSI driver config. | 24 | /// XPSI driver config. |
| 25 | #[derive(Clone, Copy)] | 25 | #[derive(Clone, Copy)] |
diff --git a/embassy-sync/src/channel.rs b/embassy-sync/src/channel.rs index de437cc52..dbd24a6c7 100644 --- a/embassy-sync/src/channel.rs +++ b/embassy-sync/src/channel.rs | |||
| @@ -50,8 +50,8 @@ use core::task::{Context, Poll}; | |||
| 50 | 50 | ||
| 51 | use heapless::Deque; | 51 | use heapless::Deque; |
| 52 | 52 | ||
| 53 | use crate::blocking_mutex::raw::RawMutex; | ||
| 54 | use crate::blocking_mutex::Mutex; | 53 | use crate::blocking_mutex::Mutex; |
| 54 | use crate::blocking_mutex::raw::RawMutex; | ||
| 55 | use crate::waitqueue::WakerRegistration; | 55 | use crate::waitqueue::WakerRegistration; |
| 56 | 56 | ||
| 57 | /// Send-only access to a [`Channel`]. | 57 | /// Send-only access to a [`Channel`]. |
| @@ -1112,11 +1112,13 @@ mod tests { | |||
| 1112 | static CHANNEL: StaticCell<Channel<CriticalSectionRawMutex, u32, 3>> = StaticCell::new(); | 1112 | static CHANNEL: StaticCell<Channel<CriticalSectionRawMutex, u32, 3>> = StaticCell::new(); |
| 1113 | let c = &*CHANNEL.init(Channel::new()); | 1113 | let c = &*CHANNEL.init(Channel::new()); |
| 1114 | let c2 = c; | 1114 | let c2 = c; |
| 1115 | assert!(executor | 1115 | assert!( |
| 1116 | .spawn(async move { | 1116 | executor |
| 1117 | assert!(c2.try_send(1).is_ok()); | 1117 | .spawn(async move { |
| 1118 | }) | 1118 | assert!(c2.try_send(1).is_ok()); |
| 1119 | .is_ok()); | 1119 | }) |
| 1120 | .is_ok() | ||
| 1121 | ); | ||
| 1120 | assert_eq!(c.receive().await, 1); | 1122 | assert_eq!(c.receive().await, 1); |
| 1121 | } | 1123 | } |
| 1122 | 1124 | ||
| @@ -1143,13 +1145,15 @@ mod tests { | |||
| 1143 | // However, I've used the debugger to observe that the send does indeed wait. | 1145 | // However, I've used the debugger to observe that the send does indeed wait. |
| 1144 | Delay::new(Duration::from_millis(500)).await; | 1146 | Delay::new(Duration::from_millis(500)).await; |
| 1145 | assert_eq!(c.receive().await, 1); | 1147 | assert_eq!(c.receive().await, 1); |
| 1146 | assert!(executor | 1148 | assert!( |
| 1147 | .spawn(async move { | 1149 | executor |
| 1148 | loop { | 1150 | .spawn(async move { |
| 1149 | c.receive().await; | 1151 | loop { |
| 1150 | } | 1152 | c.receive().await; |
| 1151 | }) | 1153 | } |
| 1152 | .is_ok()); | 1154 | }) |
| 1155 | .is_ok() | ||
| 1156 | ); | ||
| 1153 | send_task_1.unwrap().await; | 1157 | send_task_1.unwrap().await; |
| 1154 | send_task_2.unwrap().await; | 1158 | send_task_2.unwrap().await; |
| 1155 | } | 1159 | } |
diff --git a/embassy-sync/src/mutex.rs b/embassy-sync/src/mutex.rs index aea682899..96b834f02 100644 --- a/embassy-sync/src/mutex.rs +++ b/embassy-sync/src/mutex.rs | |||
| @@ -2,13 +2,13 @@ | |||
| 2 | //! | 2 | //! |
| 3 | //! This module provides a mutex that can be used to synchronize data between asynchronous tasks. | 3 | //! This module provides a mutex that can be used to synchronize data between asynchronous tasks. |
| 4 | use core::cell::{RefCell, UnsafeCell}; | 4 | use core::cell::{RefCell, UnsafeCell}; |
| 5 | use core::future::{poll_fn, Future}; | 5 | use core::future::{Future, poll_fn}; |
| 6 | use core::ops::{Deref, DerefMut}; | 6 | use core::ops::{Deref, DerefMut}; |
| 7 | use core::task::Poll; | 7 | use core::task::Poll; |
| 8 | use core::{fmt, mem}; | 8 | use core::{fmt, mem}; |
| 9 | 9 | ||
| 10 | use crate::blocking_mutex::raw::RawMutex; | ||
| 11 | use crate::blocking_mutex::Mutex as BlockingMutex; | 10 | use crate::blocking_mutex::Mutex as BlockingMutex; |
| 11 | use crate::blocking_mutex::raw::RawMutex; | ||
| 12 | use crate::waitqueue::WakerRegistration; | 12 | use crate::waitqueue::WakerRegistration; |
| 13 | 13 | ||
| 14 | /// Error returned by [`Mutex::try_lock`] | 14 | /// Error returned by [`Mutex::try_lock`] |
diff --git a/embassy-sync/src/once_lock.rs b/embassy-sync/src/once_lock.rs index 73edfea9a..2af19ca20 100644 --- a/embassy-sync/src/once_lock.rs +++ b/embassy-sync/src/once_lock.rs | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | 2 | ||
| 3 | use core::cell::Cell; | 3 | use core::cell::Cell; |
| 4 | use core::fmt::{Debug, Formatter}; | 4 | use core::fmt::{Debug, Formatter}; |
| 5 | use core::future::{poll_fn, Future}; | 5 | use core::future::{Future, poll_fn}; |
| 6 | use core::mem::MaybeUninit; | 6 | use core::mem::MaybeUninit; |
| 7 | use core::sync::atomic::{AtomicBool, Ordering}; | 7 | use core::sync::atomic::{AtomicBool, Ordering}; |
| 8 | use core::task::Poll; | 8 | use core::task::Poll; |
diff --git a/embassy-sync/src/pipe.rs b/embassy-sync/src/pipe.rs index 6d624979a..215a556d9 100644 --- a/embassy-sync/src/pipe.rs +++ b/embassy-sync/src/pipe.rs | |||
| @@ -7,8 +7,8 @@ use core::ops::Range; | |||
| 7 | use core::pin::Pin; | 7 | use core::pin::Pin; |
| 8 | use core::task::{Context, Poll}; | 8 | use core::task::{Context, Poll}; |
| 9 | 9 | ||
| 10 | use crate::blocking_mutex::raw::RawMutex; | ||
| 11 | use crate::blocking_mutex::Mutex; | 10 | use crate::blocking_mutex::Mutex; |
| 11 | use crate::blocking_mutex::raw::RawMutex; | ||
| 12 | use crate::ring_buffer::RingBuffer; | 12 | use crate::ring_buffer::RingBuffer; |
| 13 | use crate::waitqueue::WakerRegistration; | 13 | use crate::waitqueue::WakerRegistration; |
| 14 | 14 | ||
diff --git a/embassy-sync/src/priority_channel.rs b/embassy-sync/src/priority_channel.rs index 715a20e86..1af7d9221 100644 --- a/embassy-sync/src/priority_channel.rs +++ b/embassy-sync/src/priority_channel.rs | |||
| @@ -8,11 +8,11 @@ use core::future::Future; | |||
| 8 | use core::pin::Pin; | 8 | use core::pin::Pin; |
| 9 | use core::task::{Context, Poll}; | 9 | use core::task::{Context, Poll}; |
| 10 | 10 | ||
| 11 | pub use heapless::binary_heap::{Kind, Max, Min}; | ||
| 12 | use heapless::BinaryHeap; | 11 | use heapless::BinaryHeap; |
| 12 | pub use heapless::binary_heap::{Kind, Max, Min}; | ||
| 13 | 13 | ||
| 14 | use crate::blocking_mutex::raw::RawMutex; | ||
| 15 | use crate::blocking_mutex::Mutex; | 14 | use crate::blocking_mutex::Mutex; |
| 15 | use crate::blocking_mutex::raw::RawMutex; | ||
| 16 | use crate::channel::{DynamicChannel, DynamicReceiver, DynamicSender, TryReceiveError, TrySendError}; | 16 | use crate::channel::{DynamicChannel, DynamicReceiver, DynamicSender, TryReceiveError, TrySendError}; |
| 17 | use crate::waitqueue::WakerRegistration; | 17 | use crate::waitqueue::WakerRegistration; |
| 18 | 18 | ||
| @@ -799,11 +799,13 @@ mod tests { | |||
| 799 | static CHANNEL: StaticCell<PriorityChannel<CriticalSectionRawMutex, u32, Max, 3>> = StaticCell::new(); | 799 | static CHANNEL: StaticCell<PriorityChannel<CriticalSectionRawMutex, u32, Max, 3>> = StaticCell::new(); |
| 800 | let c = &*CHANNEL.init(PriorityChannel::new()); | 800 | let c = &*CHANNEL.init(PriorityChannel::new()); |
| 801 | let c2 = c; | 801 | let c2 = c; |
| 802 | assert!(executor | 802 | assert!( |
| 803 | .spawn(async move { | 803 | executor |
| 804 | assert!(c2.try_send(1).is_ok()); | 804 | .spawn(async move { |
| 805 | }) | 805 | assert!(c2.try_send(1).is_ok()); |
| 806 | .is_ok()); | 806 | }) |
| 807 | .is_ok() | ||
| 808 | ); | ||
| 807 | assert_eq!(c.receive().await, 1); | 809 | assert_eq!(c.receive().await, 1); |
| 808 | } | 810 | } |
| 809 | 811 | ||
| @@ -830,13 +832,15 @@ mod tests { | |||
| 830 | // However, I've used the debugger to observe that the send does indeed wait. | 832 | // However, I've used the debugger to observe that the send does indeed wait. |
| 831 | Delay::new(Duration::from_millis(500)).await; | 833 | Delay::new(Duration::from_millis(500)).await; |
| 832 | assert_eq!(c.receive().await, 1); | 834 | assert_eq!(c.receive().await, 1); |
| 833 | assert!(executor | 835 | assert!( |
| 834 | .spawn(async move { | 836 | executor |
| 835 | loop { | 837 | .spawn(async move { |
| 836 | c.receive().await; | 838 | loop { |
| 837 | } | 839 | c.receive().await; |
| 838 | }) | 840 | } |
| 839 | .is_ok()); | 841 | }) |
| 842 | .is_ok() | ||
| 843 | ); | ||
| 840 | send_task_1.unwrap().await; | 844 | send_task_1.unwrap().await; |
| 841 | send_task_2.unwrap().await; | 845 | send_task_2.unwrap().await; |
| 842 | } | 846 | } |
diff --git a/embassy-sync/src/pubsub/mod.rs b/embassy-sync/src/pubsub/mod.rs index ad9402f5a..127a208f1 100644 --- a/embassy-sync/src/pubsub/mod.rs +++ b/embassy-sync/src/pubsub/mod.rs | |||
| @@ -10,8 +10,8 @@ use heapless::Deque; | |||
| 10 | 10 | ||
| 11 | use self::publisher::{ImmediatePub, Pub}; | 11 | use self::publisher::{ImmediatePub, Pub}; |
| 12 | use self::subscriber::Sub; | 12 | use self::subscriber::Sub; |
| 13 | use crate::blocking_mutex::raw::RawMutex; | ||
| 14 | use crate::blocking_mutex::Mutex; | 13 | use crate::blocking_mutex::Mutex; |
| 14 | use crate::blocking_mutex::raw::RawMutex; | ||
| 15 | use crate::waitqueue::MultiWakerRegistration; | 15 | use crate::waitqueue::MultiWakerRegistration; |
| 16 | 16 | ||
| 17 | pub mod publisher; | 17 | pub mod publisher; |
diff --git a/embassy-sync/src/ring_buffer.rs b/embassy-sync/src/ring_buffer.rs index f03b7dd8f..608447cd6 100644 --- a/embassy-sync/src/ring_buffer.rs +++ b/embassy-sync/src/ring_buffer.rs | |||
| @@ -95,11 +95,7 @@ impl<const N: usize> RingBuffer<N> { | |||
| 95 | 95 | ||
| 96 | fn wrap(&self, n: usize) -> usize { | 96 | fn wrap(&self, n: usize) -> usize { |
| 97 | assert!(n <= N); | 97 | assert!(n <= N); |
| 98 | if n == N { | 98 | if n == N { 0 } else { n } |
| 99 | 0 | ||
| 100 | } else { | ||
| 101 | n | ||
| 102 | } | ||
| 103 | } | 99 | } |
| 104 | } | 100 | } |
| 105 | 101 | ||
diff --git a/embassy-sync/src/rwlock.rs b/embassy-sync/src/rwlock.rs index e43388c4d..918a6aa41 100644 --- a/embassy-sync/src/rwlock.rs +++ b/embassy-sync/src/rwlock.rs | |||
| @@ -3,12 +3,12 @@ | |||
| 3 | //! This module provides a read-write lock that can be used to synchronize data between asynchronous tasks. | 3 | //! This module provides a read-write lock that can be used to synchronize data between asynchronous tasks. |
| 4 | use core::cell::{RefCell, UnsafeCell}; | 4 | use core::cell::{RefCell, UnsafeCell}; |
| 5 | use core::fmt; | 5 | use core::fmt; |
| 6 | use core::future::{poll_fn, Future}; | 6 | use core::future::{Future, poll_fn}; |
| 7 | use core::ops::{Deref, DerefMut}; | 7 | use core::ops::{Deref, DerefMut}; |
| 8 | use core::task::Poll; | 8 | use core::task::Poll; |
| 9 | 9 | ||
| 10 | use crate::blocking_mutex::raw::RawMutex; | ||
| 11 | use crate::blocking_mutex::Mutex as BlockingMutex; | 10 | use crate::blocking_mutex::Mutex as BlockingMutex; |
| 11 | use crate::blocking_mutex::raw::RawMutex; | ||
| 12 | use crate::waitqueue::WakerRegistration; | 12 | use crate::waitqueue::WakerRegistration; |
| 13 | 13 | ||
| 14 | /// Error returned by [`RwLock::try_read`] and [`RwLock::try_write`] when the lock is already held. | 14 | /// Error returned by [`RwLock::try_read`] and [`RwLock::try_write`] when the lock is already held. |
diff --git a/embassy-sync/src/semaphore.rs b/embassy-sync/src/semaphore.rs index 4e82b0fcd..8d2413931 100644 --- a/embassy-sync/src/semaphore.rs +++ b/embassy-sync/src/semaphore.rs | |||
| @@ -1,13 +1,13 @@ | |||
| 1 | //! A synchronization primitive for controlling access to a pool of resources. | 1 | //! A synchronization primitive for controlling access to a pool of resources. |
| 2 | use core::cell::{Cell, RefCell}; | 2 | use core::cell::{Cell, RefCell}; |
| 3 | use core::convert::Infallible; | 3 | use core::convert::Infallible; |
| 4 | use core::future::{poll_fn, Future}; | 4 | use core::future::{Future, poll_fn}; |
| 5 | use core::task::{Poll, Waker}; | 5 | use core::task::{Poll, Waker}; |
| 6 | 6 | ||
| 7 | use heapless::Deque; | 7 | use heapless::Deque; |
| 8 | 8 | ||
| 9 | use crate::blocking_mutex::raw::RawMutex; | ||
| 10 | use crate::blocking_mutex::Mutex; | 9 | use crate::blocking_mutex::Mutex; |
| 10 | use crate::blocking_mutex::raw::RawMutex; | ||
| 11 | use crate::waitqueue::WakerRegistration; | 11 | use crate::waitqueue::WakerRegistration; |
| 12 | 12 | ||
| 13 | /// An asynchronous semaphore. | 13 | /// An asynchronous semaphore. |
diff --git a/embassy-sync/src/signal.rs b/embassy-sync/src/signal.rs index 229b1fa99..cc02228cf 100644 --- a/embassy-sync/src/signal.rs +++ b/embassy-sync/src/signal.rs | |||
| @@ -1,10 +1,10 @@ | |||
| 1 | //! A synchronization primitive for passing the latest value to a task. | 1 | //! A synchronization primitive for passing the latest value to a task. |
| 2 | use core::cell::Cell; | 2 | use core::cell::Cell; |
| 3 | use core::future::{poll_fn, Future}; | 3 | use core::future::{Future, poll_fn}; |
| 4 | use core::task::{Context, Poll, Waker}; | 4 | use core::task::{Context, Poll, Waker}; |
| 5 | 5 | ||
| 6 | use crate::blocking_mutex::raw::RawMutex; | ||
| 7 | use crate::blocking_mutex::Mutex; | 6 | use crate::blocking_mutex::Mutex; |
| 7 | use crate::blocking_mutex::raw::RawMutex; | ||
| 8 | 8 | ||
| 9 | /// Single-slot signaling primitive for a _single_ consumer. | 9 | /// Single-slot signaling primitive for a _single_ consumer. |
| 10 | /// | 10 | /// |
diff --git a/embassy-sync/src/waitqueue/atomic_waker.rs b/embassy-sync/src/waitqueue/atomic_waker.rs index 5a9910e7f..d2bf890e5 100644 --- a/embassy-sync/src/waitqueue/atomic_waker.rs +++ b/embassy-sync/src/waitqueue/atomic_waker.rs | |||
| @@ -1,8 +1,8 @@ | |||
| 1 | use core::cell::Cell; | 1 | use core::cell::Cell; |
| 2 | use core::task::Waker; | 2 | use core::task::Waker; |
| 3 | 3 | ||
| 4 | use crate::blocking_mutex::raw::{CriticalSectionRawMutex, RawMutex}; | ||
| 5 | use crate::blocking_mutex::Mutex; | 4 | use crate::blocking_mutex::Mutex; |
| 5 | use crate::blocking_mutex::raw::{CriticalSectionRawMutex, RawMutex}; | ||
| 6 | 6 | ||
| 7 | /// Utility struct to register and wake a waker. | 7 | /// Utility struct to register and wake a waker. |
| 8 | /// If a waker is registered, registering another waker will replace the previous one without waking it. | 8 | /// If a waker is registered, registering another waker will replace the previous one without waking it. |
diff --git a/embassy-sync/src/watch.rs b/embassy-sync/src/watch.rs index 332ab5405..0f8a8d679 100644 --- a/embassy-sync/src/watch.rs +++ b/embassy-sync/src/watch.rs | |||
| @@ -1,13 +1,13 @@ | |||
| 1 | //! A synchronization primitive for passing the latest value to **multiple** receivers. | 1 | //! A synchronization primitive for passing the latest value to **multiple** receivers. |
| 2 | 2 | ||
| 3 | use core::cell::RefCell; | 3 | use core::cell::RefCell; |
| 4 | use core::future::{poll_fn, Future}; | 4 | use core::future::{Future, poll_fn}; |
| 5 | use core::marker::PhantomData; | 5 | use core::marker::PhantomData; |
| 6 | use core::ops::{Deref, DerefMut}; | 6 | use core::ops::{Deref, DerefMut}; |
| 7 | use core::task::{Context, Poll}; | 7 | use core::task::{Context, Poll}; |
| 8 | 8 | ||
| 9 | use crate::blocking_mutex::raw::RawMutex; | ||
| 10 | use crate::blocking_mutex::Mutex; | 9 | use crate::blocking_mutex::Mutex; |
| 10 | use crate::blocking_mutex::raw::RawMutex; | ||
| 11 | use crate::waitqueue::MultiWakerRegistration; | 11 | use crate::waitqueue::MultiWakerRegistration; |
| 12 | 12 | ||
| 13 | /// The `Watch` is a single-slot signaling primitive that allows _multiple_ (`N`) receivers to concurrently await | 13 | /// The `Watch` is a single-slot signaling primitive that allows _multiple_ (`N`) receivers to concurrently await |
diff --git a/embassy-sync/src/zerocopy_channel.rs b/embassy-sync/src/zerocopy_channel.rs index b3f7dbe8c..c572592b8 100644 --- a/embassy-sync/src/zerocopy_channel.rs +++ b/embassy-sync/src/zerocopy_channel.rs | |||
| @@ -15,12 +15,12 @@ | |||
| 15 | //! another message will result in an error being returned. | 15 | //! another message will result in an error being returned. |
| 16 | 16 | ||
| 17 | use core::cell::RefCell; | 17 | use core::cell::RefCell; |
| 18 | use core::future::{poll_fn, Future}; | 18 | use core::future::{Future, poll_fn}; |
| 19 | use core::marker::PhantomData; | 19 | use core::marker::PhantomData; |
| 20 | use core::task::{Context, Poll}; | 20 | use core::task::{Context, Poll}; |
| 21 | 21 | ||
| 22 | use crate::blocking_mutex::raw::RawMutex; | ||
| 23 | use crate::blocking_mutex::Mutex; | 22 | use crate::blocking_mutex::Mutex; |
| 23 | use crate::blocking_mutex::raw::RawMutex; | ||
| 24 | use crate::waitqueue::WakerRegistration; | 24 | use crate::waitqueue::WakerRegistration; |
| 25 | 25 | ||
| 26 | /// A bounded zero-copy channel for communicating between asynchronous tasks | 26 | /// A bounded zero-copy channel for communicating between asynchronous tasks |
| @@ -296,11 +296,7 @@ struct State { | |||
| 296 | 296 | ||
| 297 | impl State { | 297 | impl State { |
| 298 | fn increment(&self, i: usize) -> usize { | 298 | fn increment(&self, i: usize) -> usize { |
| 299 | if i + 1 == self.capacity { | 299 | if i + 1 == self.capacity { 0 } else { i + 1 } |
| 300 | 0 | ||
| 301 | } else { | ||
| 302 | i + 1 | ||
| 303 | } | ||
| 304 | } | 300 | } |
| 305 | 301 | ||
| 306 | fn clear(&mut self) { | 302 | fn clear(&mut self) { |
diff --git a/embassy-time-queue-utils/src/queue_generic.rs b/embassy-time-queue-utils/src/queue_generic.rs index bff7a4735..88986953d 100644 --- a/embassy-time-queue-utils/src/queue_generic.rs +++ b/embassy-time-queue-utils/src/queue_generic.rs | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | //! | 2 | //! |
| 3 | //! Time queue drivers may use this to simplify their implementation. | 3 | //! Time queue drivers may use this to simplify their implementation. |
| 4 | 4 | ||
| 5 | use core::cmp::{min, Ordering}; | 5 | use core::cmp::{Ordering, min}; |
| 6 | use core::task::Waker; | 6 | use core::task::Waker; |
| 7 | 7 | ||
| 8 | use heapless::Vec; | 8 | use heapless::Vec; |
diff --git a/embassy-time/src/duration.rs b/embassy-time/src/duration.rs index b3ea0468d..b2bfd6de9 100644 --- a/embassy-time/src/duration.rs +++ b/embassy-time/src/duration.rs | |||
| @@ -175,13 +175,7 @@ impl Duration { | |||
| 175 | /// NOTE: Giving this function a hz >= the TICK_HZ of your platform will clamp the Duration to 1 | 175 | /// NOTE: Giving this function a hz >= the TICK_HZ of your platform will clamp the Duration to 1 |
| 176 | /// tick. Doing so will not deadlock, but will certainly not produce the desired output. | 176 | /// tick. Doing so will not deadlock, but will certainly not produce the desired output. |
| 177 | pub const fn from_hz(hz: u64) -> Duration { | 177 | pub const fn from_hz(hz: u64) -> Duration { |
| 178 | let ticks = { | 178 | let ticks = { if hz >= TICK_HZ { 1 } else { (TICK_HZ + hz / 2) / hz } }; |
| 179 | if hz >= TICK_HZ { | ||
| 180 | 1 | ||
| 181 | } else { | ||
| 182 | (TICK_HZ + hz / 2) / hz | ||
| 183 | } | ||
| 184 | }; | ||
| 185 | Duration { ticks } | 179 | Duration { ticks } |
| 186 | } | 180 | } |
| 187 | 181 | ||
diff --git a/embassy-time/src/lib.rs b/embassy-time/src/lib.rs index 5a511a0bd..e375fe93e 100644 --- a/embassy-time/src/lib.rs +++ b/embassy-time/src/lib.rs | |||
| @@ -28,18 +28,14 @@ mod driver_std; | |||
| 28 | #[cfg(feature = "wasm")] | 28 | #[cfg(feature = "wasm")] |
| 29 | mod driver_wasm; | 29 | mod driver_wasm; |
| 30 | 30 | ||
| 31 | pub use delay::{block_for, Delay}; | 31 | pub use delay::{Delay, block_for}; |
| 32 | pub use duration::Duration; | 32 | pub use duration::Duration; |
| 33 | pub use embassy_time_driver::TICK_HZ; | 33 | pub use embassy_time_driver::TICK_HZ; |
| 34 | pub use instant::Instant; | 34 | pub use instant::Instant; |
| 35 | pub use timer::{with_deadline, with_timeout, Ticker, TimeoutError, Timer, WithTimeout}; | 35 | pub use timer::{Ticker, TimeoutError, Timer, WithTimeout, with_deadline, with_timeout}; |
| 36 | 36 | ||
| 37 | const fn gcd(a: u64, b: u64) -> u64 { | 37 | const fn gcd(a: u64, b: u64) -> u64 { |
| 38 | if b == 0 { | 38 | if b == 0 { a } else { gcd(b, a % b) } |
| 39 | a | ||
| 40 | } else { | ||
| 41 | gcd(b, a % b) | ||
| 42 | } | ||
| 43 | } | 39 | } |
| 44 | 40 | ||
| 45 | pub(crate) const GCD_1K: u64 = gcd(TICK_HZ, 1_000); | 41 | pub(crate) const GCD_1K: u64 = gcd(TICK_HZ, 1_000); |
diff --git a/embassy-time/src/timer.rs b/embassy-time/src/timer.rs index fcf79f58e..2f5967c63 100644 --- a/embassy-time/src/timer.rs +++ b/embassy-time/src/timer.rs | |||
| @@ -1,9 +1,9 @@ | |||
| 1 | use core::future::{poll_fn, Future}; | 1 | use core::future::{Future, poll_fn}; |
| 2 | use core::pin::Pin; | 2 | use core::pin::Pin; |
| 3 | use core::task::{Context, Poll}; | 3 | use core::task::{Context, Poll}; |
| 4 | 4 | ||
| 5 | use futures_core::stream::FusedStream; | ||
| 6 | use futures_core::Stream; | 5 | use futures_core::Stream; |
| 6 | use futures_core::stream::FusedStream; | ||
| 7 | 7 | ||
| 8 | use crate::{Duration, Instant}; | 8 | use crate::{Duration, Instant}; |
| 9 | 9 | ||
diff --git a/embassy-usb-dfu/src/application.rs b/embassy-usb-dfu/src/application.rs index 78eb2c083..1ea1a74fe 100644 --- a/embassy-usb-dfu/src/application.rs +++ b/embassy-usb-dfu/src/application.rs | |||
| @@ -6,11 +6,11 @@ use embassy_usb::driver::Driver; | |||
| 6 | use embassy_usb::{Builder, FunctionBuilder, Handler}; | 6 | use embassy_usb::{Builder, FunctionBuilder, Handler}; |
| 7 | use embedded_storage::nor_flash::NorFlash; | 7 | use embedded_storage::nor_flash::NorFlash; |
| 8 | 8 | ||
| 9 | use crate::Reset; | ||
| 9 | use crate::consts::{ | 10 | use crate::consts::{ |
| 10 | DfuAttributes, Request, State, Status, APPN_SPEC_SUBCLASS_DFU, DESC_DFU_FUNCTIONAL, DFU_PROTOCOL_RT, | 11 | APPN_SPEC_SUBCLASS_DFU, DESC_DFU_FUNCTIONAL, DFU_PROTOCOL_RT, DfuAttributes, Request, State, Status, |
| 11 | USB_CLASS_APPN_SPEC, | 12 | USB_CLASS_APPN_SPEC, |
| 12 | }; | 13 | }; |
| 13 | use crate::Reset; | ||
| 14 | 14 | ||
| 15 | /// Generic interface for a system that can signal to the bootloader that USB DFU mode is needed on the next boot. | 15 | /// Generic interface for a system that can signal to the bootloader that USB DFU mode is needed on the next boot. |
| 16 | /// | 16 | /// |
diff --git a/embassy-usb-dfu/src/dfu.rs b/embassy-usb-dfu/src/dfu.rs index 7c28d04cf..2ed4511ce 100644 --- a/embassy-usb-dfu/src/dfu.rs +++ b/embassy-usb-dfu/src/dfu.rs | |||
| @@ -5,11 +5,11 @@ use embassy_usb::driver::Driver; | |||
| 5 | use embassy_usb::{Builder, FunctionBuilder, Handler}; | 5 | use embassy_usb::{Builder, FunctionBuilder, Handler}; |
| 6 | use embedded_storage::nor_flash::{NorFlash, NorFlashErrorKind}; | 6 | use embedded_storage::nor_flash::{NorFlash, NorFlashErrorKind}; |
| 7 | 7 | ||
| 8 | use crate::Reset; | ||
| 8 | use crate::consts::{ | 9 | use crate::consts::{ |
| 9 | DfuAttributes, Request, State, Status, APPN_SPEC_SUBCLASS_DFU, DESC_DFU_FUNCTIONAL, DFU_PROTOCOL_DFU, | 10 | APPN_SPEC_SUBCLASS_DFU, DESC_DFU_FUNCTIONAL, DFU_PROTOCOL_DFU, DfuAttributes, Request, State, Status, |
| 10 | USB_CLASS_APPN_SPEC, | 11 | USB_CLASS_APPN_SPEC, |
| 11 | }; | 12 | }; |
| 12 | use crate::Reset; | ||
| 13 | 13 | ||
| 14 | /// Internal state for USB DFU | 14 | /// Internal state for USB DFU |
| 15 | pub struct Control<'d, DFU: NorFlash, STATE: NorFlash, RST: Reset, const BLOCK_SIZE: usize> { | 15 | pub struct Control<'d, DFU: NorFlash, STATE: NorFlash, RST: Reset, const BLOCK_SIZE: usize> { |
diff --git a/embassy-usb-synopsys-otg/src/lib.rs b/embassy-usb-synopsys-otg/src/lib.rs index b8750491d..d94209f45 100644 --- a/embassy-usb-synopsys-otg/src/lib.rs +++ b/embassy-usb-synopsys-otg/src/lib.rs | |||
| @@ -23,7 +23,7 @@ use crate::fmt::Bytes; | |||
| 23 | 23 | ||
| 24 | pub mod otg_v1; | 24 | pub mod otg_v1; |
| 25 | 25 | ||
| 26 | use otg_v1::{regs, vals, Otg}; | 26 | use otg_v1::{Otg, regs, vals}; |
| 27 | 27 | ||
| 28 | /// Handle interrupts. | 28 | /// Handle interrupts. |
| 29 | pub unsafe fn on_interrupt<const MAX_EP_COUNT: usize>(r: Otg, state: &State<MAX_EP_COUNT>, ep_count: usize) { | 29 | pub unsafe fn on_interrupt<const MAX_EP_COUNT: usize>(r: Otg, state: &State<MAX_EP_COUNT>, ep_count: usize) { |
| @@ -680,9 +680,7 @@ impl<'d, const MAX_EP_COUNT: usize> Bus<'d, MAX_EP_COUNT> { | |||
| 680 | if let Some(ep) = self.ep_in[i] { | 680 | if let Some(ep) = self.ep_in[i] { |
| 681 | trace!( | 681 | trace!( |
| 682 | "configuring tx fifo ep={}, offset={}, size={}", | 682 | "configuring tx fifo ep={}, offset={}, size={}", |
| 683 | i, | 683 | i, fifo_top, ep.fifo_size_words |
| 684 | fifo_top, | ||
| 685 | ep.fifo_size_words | ||
| 686 | ); | 684 | ); |
| 687 | 685 | ||
| 688 | let dieptxf = if i == 0 { regs.dieptxf0() } else { regs.dieptxf(i - 1) }; | 686 | let dieptxf = if i == 0 { regs.dieptxf0() } else { regs.dieptxf(i - 1) }; |
| @@ -1159,9 +1157,7 @@ impl<'d> embassy_usb_driver::EndpointIn for Endpoint<'d, In> { | |||
| 1159 | let dtxfsts = self.regs.dtxfsts(index).read(); | 1157 | let dtxfsts = self.regs.dtxfsts(index).read(); |
| 1160 | trace!( | 1158 | trace!( |
| 1161 | "write ep={:?}: diepctl {:08x} ftxfsts {:08x}", | 1159 | "write ep={:?}: diepctl {:08x} ftxfsts {:08x}", |
| 1162 | self.info.addr, | 1160 | self.info.addr, diepctl.0, dtxfsts.0 |
| 1163 | diepctl.0, | ||
| 1164 | dtxfsts.0 | ||
| 1165 | ); | 1161 | ); |
| 1166 | if !diepctl.usbaep() { | 1162 | if !diepctl.usbaep() { |
| 1167 | trace!("write ep={:?} wait for prev: error disabled", self.info.addr); | 1163 | trace!("write ep={:?} wait for prev: error disabled", self.info.addr); |
| @@ -1376,11 +1372,7 @@ fn ep_irq_mask(eps: &[Option<EndpointData>]) -> u16 { | |||
| 1376 | eps.iter().enumerate().fold( | 1372 | eps.iter().enumerate().fold( |
| 1377 | 0, | 1373 | 0, |
| 1378 | |mask, (index, ep)| { | 1374 | |mask, (index, ep)| { |
| 1379 | if ep.is_some() { | 1375 | if ep.is_some() { mask | (1 << index) } else { mask } |
| 1380 | mask | (1 << index) | ||
| 1381 | } else { | ||
| 1382 | mask | ||
| 1383 | } | ||
| 1384 | }, | 1376 | }, |
| 1385 | ) | 1377 | ) |
| 1386 | } | 1378 | } |
diff --git a/embassy-usb/src/builder.rs b/embassy-usb/src/builder.rs index 8d7abe46c..6fc2a5a22 100644 --- a/embassy-usb/src/builder.rs +++ b/embassy-usb/src/builder.rs | |||
| @@ -5,7 +5,7 @@ use crate::descriptor::{BosWriter, DescriptorWriter, SynchronizationType, UsageT | |||
| 5 | use crate::driver::{Driver, Endpoint, EndpointAddress, EndpointInfo, EndpointType}; | 5 | use crate::driver::{Driver, Endpoint, EndpointAddress, EndpointInfo, EndpointType}; |
| 6 | use crate::msos::{DeviceLevelDescriptor, FunctionLevelDescriptor, MsOsDescriptorWriter}; | 6 | use crate::msos::{DeviceLevelDescriptor, FunctionLevelDescriptor, MsOsDescriptorWriter}; |
| 7 | use crate::types::{InterfaceNumber, StringIndex}; | 7 | use crate::types::{InterfaceNumber, StringIndex}; |
| 8 | use crate::{Handler, Interface, UsbDevice, MAX_INTERFACE_COUNT, STRING_INDEX_CUSTOM_START}; | 8 | use crate::{Handler, Interface, MAX_INTERFACE_COUNT, STRING_INDEX_CUSTOM_START, UsbDevice}; |
| 9 | 9 | ||
| 10 | #[derive(Debug, Copy, Clone)] | 10 | #[derive(Debug, Copy, Clone)] |
| 11 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 11 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| @@ -176,7 +176,9 @@ impl<'d, D: Driver<'d>> Builder<'d, D> { | |||
| 176 | if config.composite_with_iads | 176 | if config.composite_with_iads |
| 177 | && (config.device_class != 0xEF || config.device_sub_class != 0x02 || config.device_protocol != 0x01) | 177 | && (config.device_class != 0xEF || config.device_sub_class != 0x02 || config.device_protocol != 0x01) |
| 178 | { | 178 | { |
| 179 | panic!("if composite_with_iads is set, you must set device_class = 0xEF, device_sub_class = 0x02, device_protocol = 0x01"); | 179 | panic!( |
| 180 | "if composite_with_iads is set, you must set device_class = 0xEF, device_sub_class = 0x02, device_protocol = 0x01" | ||
| 181 | ); | ||
| 180 | } | 182 | } |
| 181 | 183 | ||
| 182 | assert!( | 184 | assert!( |
| @@ -337,7 +339,8 @@ impl<'a, 'd, D: Driver<'d>> FunctionBuilder<'a, 'd, D> { | |||
| 337 | num_alt_settings: 0, | 339 | num_alt_settings: 0, |
| 338 | }; | 340 | }; |
| 339 | 341 | ||
| 340 | assert!(self.builder.interfaces.push(iface).is_ok(), | 342 | assert!( |
| 343 | self.builder.interfaces.push(iface).is_ok(), | ||
| 341 | "embassy-usb: interface list full. Increase the `max_interface_count` compile-time setting. Current value: {}", | 344 | "embassy-usb: interface list full. Increase the `max_interface_count` compile-time setting. Current value: {}", |
| 342 | MAX_INTERFACE_COUNT | 345 | MAX_INTERFACE_COUNT |
| 343 | ); | 346 | ); |
diff --git a/embassy-usb/src/class/cdc_acm.rs b/embassy-usb/src/class/cdc_acm.rs index 0a1a5e64f..388e21fbd 100644 --- a/embassy-usb/src/class/cdc_acm.rs +++ b/embassy-usb/src/class/cdc_acm.rs | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | //! CDC-ACM class implementation, aka Serial over USB. | 1 | //! CDC-ACM class implementation, aka Serial over USB. |
| 2 | 2 | ||
| 3 | use core::cell::{Cell, RefCell}; | 3 | use core::cell::{Cell, RefCell}; |
| 4 | use core::future::{poll_fn, Future}; | 4 | use core::future::{Future, poll_fn}; |
| 5 | use core::mem::{self, MaybeUninit}; | 5 | use core::mem::{self, MaybeUninit}; |
| 6 | use core::sync::atomic::{AtomicBool, Ordering}; | 6 | use core::sync::atomic::{AtomicBool, Ordering}; |
| 7 | use core::task::Poll; | 7 | use core::task::Poll; |
diff --git a/embassy-usb/src/class/cdc_ncm/embassy_net.rs b/embassy-usb/src/class/cdc_ncm/embassy_net.rs index 57d322946..c83ff468a 100644 --- a/embassy-usb/src/class/cdc_ncm/embassy_net.rs +++ b/embassy-usb/src/class/cdc_ncm/embassy_net.rs | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | //! [`embassy-net`](https://crates.io/crates/embassy-net) driver for the CDC-NCM class. | 1 | //! [`embassy-net`](https://crates.io/crates/embassy-net) driver for the CDC-NCM class. |
| 2 | 2 | ||
| 3 | use embassy_futures::select::{select, Either}; | 3 | use embassy_futures::select::{Either, select}; |
| 4 | use embassy_net_driver_channel as ch; | 4 | use embassy_net_driver_channel as ch; |
| 5 | use embassy_net_driver_channel::driver::LinkState; | 5 | use embassy_net_driver_channel::driver::LinkState; |
| 6 | use embassy_usb_driver::Driver; | 6 | use embassy_usb_driver::Driver; |
diff --git a/embassy-usb/src/class/cdc_ncm/mod.rs b/embassy-usb/src/class/cdc_ncm/mod.rs index 3af853091..9b6dd9f21 100644 --- a/embassy-usb/src/class/cdc_ncm/mod.rs +++ b/embassy-usb/src/class/cdc_ncm/mod.rs | |||
| @@ -14,7 +14,7 @@ | |||
| 14 | //! This is due to regex spaghetti: <https://android.googlesource.com/platform/frameworks/base/+/refs/tags/android-mainline-12.0.0_r84/core/res/res/values/config.xml#417> | 14 | //! This is due to regex spaghetti: <https://android.googlesource.com/platform/frameworks/base/+/refs/tags/android-mainline-12.0.0_r84/core/res/res/values/config.xml#417> |
| 15 | //! and this nonsense in the linux kernel: <https://github.com/torvalds/linux/blob/c00c5e1d157bec0ef0b0b59aa5482eb8dc7e8e49/drivers/net/usb/usbnet.c#L1751-L1757> | 15 | //! and this nonsense in the linux kernel: <https://github.com/torvalds/linux/blob/c00c5e1d157bec0ef0b0b59aa5482eb8dc7e8e49/drivers/net/usb/usbnet.c#L1751-L1757> |
| 16 | 16 | ||
| 17 | use core::mem::{size_of, MaybeUninit}; | 17 | use core::mem::{MaybeUninit, size_of}; |
| 18 | use core::ptr::{addr_of, copy_nonoverlapping}; | 18 | use core::ptr::{addr_of, copy_nonoverlapping}; |
| 19 | 19 | ||
| 20 | use crate::control::{self, InResponse, OutResponse, Recipient, Request, RequestType}; | 20 | use crate::control::{self, InResponse, OutResponse, Recipient, Request, RequestType}; |
diff --git a/embassy-usb/src/class/cmsis_dap_v2.rs b/embassy-usb/src/class/cmsis_dap_v2.rs index a9fd9cdf0..0e2356f17 100644 --- a/embassy-usb/src/class/cmsis_dap_v2.rs +++ b/embassy-usb/src/class/cmsis_dap_v2.rs | |||
| @@ -4,7 +4,7 @@ use core::mem::MaybeUninit; | |||
| 4 | 4 | ||
| 5 | use crate::driver::{Driver, Endpoint, EndpointError, EndpointIn, EndpointOut}; | 5 | use crate::driver::{Driver, Endpoint, EndpointError, EndpointIn, EndpointOut}; |
| 6 | use crate::types::StringIndex; | 6 | use crate::types::StringIndex; |
| 7 | use crate::{msos, Builder, Handler}; | 7 | use crate::{Builder, Handler, msos}; |
| 8 | 8 | ||
| 9 | /// State for the CMSIS-DAP v2 USB class. | 9 | /// State for the CMSIS-DAP v2 USB class. |
| 10 | pub struct State { | 10 | pub struct State { |
diff --git a/embassy-usb/src/class/midi.rs b/embassy-usb/src/class/midi.rs index 1d152ca44..d29172be1 100644 --- a/embassy-usb/src/class/midi.rs +++ b/embassy-usb/src/class/midi.rs | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | //! MIDI class implementation. | 1 | //! MIDI class implementation. |
| 2 | 2 | ||
| 3 | use crate::driver::{Driver, Endpoint, EndpointError, EndpointIn, EndpointOut}; | ||
| 4 | use crate::Builder; | 3 | use crate::Builder; |
| 4 | use crate::driver::{Driver, Endpoint, EndpointError, EndpointIn, EndpointOut}; | ||
| 5 | 5 | ||
| 6 | /// This should be used as `device_class` when building the `UsbDevice`. | 6 | /// This should be used as `device_class` when building the `UsbDevice`. |
| 7 | pub const USB_AUDIO_CLASS: u8 = 0x01; | 7 | pub const USB_AUDIO_CLASS: u8 = 0x01; |
diff --git a/embassy-usb/src/class/uac1/speaker.rs b/embassy-usb/src/class/uac1/speaker.rs index 9565e2a25..46e0420d5 100644 --- a/embassy-usb/src/class/uac1/speaker.rs +++ b/embassy-usb/src/class/uac1/speaker.rs | |||
| @@ -11,7 +11,7 @@ | |||
| 11 | //! The class provides volume and mute controls for each channel. | 11 | //! The class provides volume and mute controls for each channel. |
| 12 | 12 | ||
| 13 | use core::cell::{Cell, RefCell}; | 13 | use core::cell::{Cell, RefCell}; |
| 14 | use core::future::{poll_fn, Future}; | 14 | use core::future::{Future, poll_fn}; |
| 15 | use core::marker::PhantomData; | 15 | use core::marker::PhantomData; |
| 16 | use core::sync::atomic::{AtomicBool, AtomicU32, Ordering}; | 16 | use core::sync::atomic::{AtomicBool, AtomicU32, Ordering}; |
| 17 | use core::task::Poll; | 17 | use core::task::Poll; |
| @@ -22,7 +22,7 @@ use heapless::Vec; | |||
| 22 | 22 | ||
| 23 | use super::class_codes::*; | 23 | use super::class_codes::*; |
| 24 | use super::terminal_type::TerminalType; | 24 | use super::terminal_type::TerminalType; |
| 25 | use super::{Channel, ChannelConfig, FeedbackRefresh, SampleWidth, MAX_AUDIO_CHANNEL_COUNT, MAX_AUDIO_CHANNEL_INDEX}; | 25 | use super::{Channel, ChannelConfig, FeedbackRefresh, MAX_AUDIO_CHANNEL_COUNT, MAX_AUDIO_CHANNEL_INDEX, SampleWidth}; |
| 26 | use crate::control::{self, InResponse, OutResponse, Recipient, Request, RequestType}; | 26 | use crate::control::{self, InResponse, OutResponse, Recipient, Request, RequestType}; |
| 27 | use crate::descriptor::{SynchronizationType, UsageType}; | 27 | use crate::descriptor::{SynchronizationType, UsageType}; |
| 28 | use crate::driver::{Driver, Endpoint, EndpointError, EndpointIn, EndpointOut, EndpointType}; | 28 | use crate::driver::{Driver, Endpoint, EndpointError, EndpointIn, EndpointOut, EndpointType}; |
diff --git a/embassy-usb/src/descriptor.rs b/embassy-usb/src/descriptor.rs index e9a6fd79a..c79dd02eb 100644 --- a/embassy-usb/src/descriptor.rs +++ b/embassy-usb/src/descriptor.rs | |||
| @@ -1,10 +1,10 @@ | |||
| 1 | //! Utilities for writing USB descriptors. | 1 | //! Utilities for writing USB descriptors. |
| 2 | use embassy_usb_driver::EndpointType; | 2 | use embassy_usb_driver::EndpointType; |
| 3 | 3 | ||
| 4 | use crate::CONFIGURATION_VALUE; | ||
| 4 | use crate::builder::Config; | 5 | use crate::builder::Config; |
| 5 | use crate::driver::EndpointInfo; | 6 | use crate::driver::EndpointInfo; |
| 6 | use crate::types::{InterfaceNumber, StringIndex}; | 7 | use crate::types::{InterfaceNumber, StringIndex}; |
| 7 | use crate::CONFIGURATION_VALUE; | ||
| 8 | 8 | ||
| 9 | /// Standard descriptor types | 9 | /// Standard descriptor types |
| 10 | #[allow(missing_docs)] | 10 | #[allow(missing_docs)] |
diff --git a/embassy-usb/src/lib.rs b/embassy-usb/src/lib.rs index 7f78de29d..0c10c08df 100644 --- a/embassy-usb/src/lib.rs +++ b/embassy-usb/src/lib.rs | |||
| @@ -21,7 +21,7 @@ mod config { | |||
| 21 | include!(concat!(env!("OUT_DIR"), "/config.rs")); | 21 | include!(concat!(env!("OUT_DIR"), "/config.rs")); |
| 22 | } | 22 | } |
| 23 | 23 | ||
| 24 | use embassy_futures::select::{select, Either}; | 24 | use embassy_futures::select::{Either, select}; |
| 25 | use heapless::Vec; | 25 | use heapless::Vec; |
| 26 | 26 | ||
| 27 | pub use crate::builder::{Builder, Config, FunctionBuilder, InterfaceAltBuilder, InterfaceBuilder, UsbVersion}; | 27 | pub use crate::builder::{Builder, Config, FunctionBuilder, InterfaceAltBuilder, InterfaceBuilder, UsbVersion}; |
diff --git a/embassy-usb/src/msos.rs b/embassy-usb/src/msos.rs index 9f4e1a57b..66689871e 100644 --- a/embassy-usb/src/msos.rs +++ b/embassy-usb/src/msos.rs | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | 4 | ||
| 5 | use core::mem::size_of; | 5 | use core::mem::size_of; |
| 6 | 6 | ||
| 7 | use crate::descriptor::{capability_type, BosWriter}; | 7 | use crate::descriptor::{BosWriter, capability_type}; |
| 8 | use crate::types::InterfaceNumber; | 8 | use crate::types::InterfaceNumber; |
| 9 | 9 | ||
| 10 | /// A serialized Microsoft OS 2.0 Descriptor set. | 10 | /// A serialized Microsoft OS 2.0 Descriptor set. |
diff --git a/examples/boot/application/stm32wb-dfu/src/main.rs b/examples/boot/application/stm32wb-dfu/src/main.rs index 5e7b71f5a..1ae28bf3a 100644 --- a/examples/boot/application/stm32wb-dfu/src/main.rs +++ b/examples/boot/application/stm32wb-dfu/src/main.rs | |||
| @@ -13,9 +13,9 @@ use embassy_stm32::usb::{self, Driver}; | |||
| 13 | use embassy_stm32::{bind_interrupts, peripherals}; | 13 | use embassy_stm32::{bind_interrupts, peripherals}; |
| 14 | use embassy_sync::blocking_mutex::Mutex; | 14 | use embassy_sync::blocking_mutex::Mutex; |
| 15 | use embassy_time::Duration; | 15 | use embassy_time::Duration; |
| 16 | use embassy_usb::{msos, Builder}; | 16 | use embassy_usb::{Builder, msos}; |
| 17 | use embassy_usb_dfu::consts::DfuAttributes; | 17 | use embassy_usb_dfu::consts::DfuAttributes; |
| 18 | use embassy_usb_dfu::{usb_dfu, Control, ResetImmediate}; | 18 | use embassy_usb_dfu::{Control, ResetImmediate, usb_dfu}; |
| 19 | use panic_reset as _; | 19 | use panic_reset as _; |
| 20 | 20 | ||
| 21 | bind_interrupts!(struct Irqs { | 21 | bind_interrupts!(struct Irqs { |
diff --git a/examples/boot/application/stm32wba-dfu/src/main.rs b/examples/boot/application/stm32wba-dfu/src/main.rs index bf17a7150..8adb2e7c0 100644 --- a/examples/boot/application/stm32wba-dfu/src/main.rs +++ b/examples/boot/application/stm32wba-dfu/src/main.rs | |||
| @@ -12,9 +12,9 @@ use embassy_stm32::usb::{self, Driver}; | |||
| 12 | use embassy_stm32::{bind_interrupts, peripherals}; | 12 | use embassy_stm32::{bind_interrupts, peripherals}; |
| 13 | use embassy_sync::blocking_mutex::Mutex; | 13 | use embassy_sync::blocking_mutex::Mutex; |
| 14 | use embassy_time::Duration; | 14 | use embassy_time::Duration; |
| 15 | use embassy_usb::{msos, Builder}; | 15 | use embassy_usb::{Builder, msos}; |
| 16 | use embassy_usb_dfu::consts::DfuAttributes; | 16 | use embassy_usb_dfu::consts::DfuAttributes; |
| 17 | use embassy_usb_dfu::{usb_dfu, Control, ResetImmediate}; | 17 | use embassy_usb_dfu::{Control, ResetImmediate, usb_dfu}; |
| 18 | use panic_reset as _; | 18 | use panic_reset as _; |
| 19 | 19 | ||
| 20 | bind_interrupts!(struct Irqs { | 20 | bind_interrupts!(struct Irqs { |
diff --git a/examples/boot/application/stm32wl/src/bin/a.rs b/examples/boot/application/stm32wl/src/bin/a.rs index e4526927f..3f381fd80 100644 --- a/examples/boot/application/stm32wl/src/bin/a.rs +++ b/examples/boot/application/stm32wl/src/bin/a.rs | |||
| @@ -8,10 +8,10 @@ use defmt_rtt::*; | |||
| 8 | use embassy_boot_stm32::{AlignedBuffer, FirmwareUpdater, FirmwareUpdaterConfig}; | 8 | use embassy_boot_stm32::{AlignedBuffer, FirmwareUpdater, FirmwareUpdaterConfig}; |
| 9 | use embassy_embedded_hal::adapter::BlockingAsync; | 9 | use embassy_embedded_hal::adapter::BlockingAsync; |
| 10 | use embassy_executor::Spawner; | 10 | use embassy_executor::Spawner; |
| 11 | use embassy_stm32::SharedData; | ||
| 11 | use embassy_stm32::exti::ExtiInput; | 12 | use embassy_stm32::exti::ExtiInput; |
| 12 | use embassy_stm32::flash::{Flash, WRITE_SIZE}; | 13 | use embassy_stm32::flash::{Flash, WRITE_SIZE}; |
| 13 | use embassy_stm32::gpio::{Level, Output, Pull, Speed}; | 14 | use embassy_stm32::gpio::{Level, Output, Pull, Speed}; |
| 14 | use embassy_stm32::SharedData; | ||
| 15 | use embassy_sync::mutex::Mutex; | 15 | use embassy_sync::mutex::Mutex; |
| 16 | use panic_reset as _; | 16 | use panic_reset as _; |
| 17 | 17 | ||
diff --git a/examples/boot/application/stm32wl/src/bin/b.rs b/examples/boot/application/stm32wl/src/bin/b.rs index 6016a9555..952e94a58 100644 --- a/examples/boot/application/stm32wl/src/bin/b.rs +++ b/examples/boot/application/stm32wl/src/bin/b.rs | |||
| @@ -6,8 +6,8 @@ use core::mem::MaybeUninit; | |||
| 6 | #[cfg(feature = "defmt")] | 6 | #[cfg(feature = "defmt")] |
| 7 | use defmt_rtt::*; | 7 | use defmt_rtt::*; |
| 8 | use embassy_executor::Spawner; | 8 | use embassy_executor::Spawner; |
| 9 | use embassy_stm32::gpio::{Level, Output, Speed}; | ||
| 10 | use embassy_stm32::SharedData; | 9 | use embassy_stm32::SharedData; |
| 10 | use embassy_stm32::gpio::{Level, Output, Speed}; | ||
| 11 | use embassy_time::Timer; | 11 | use embassy_time::Timer; |
| 12 | use panic_reset as _; | 12 | use panic_reset as _; |
| 13 | 13 | ||
diff --git a/examples/boot/bootloader/stm32-dual-bank/src/main.rs b/examples/boot/bootloader/stm32-dual-bank/src/main.rs index ea81e1fe5..f0063fb5c 100644 --- a/examples/boot/bootloader/stm32-dual-bank/src/main.rs +++ b/examples/boot/bootloader/stm32-dual-bank/src/main.rs | |||
| @@ -7,7 +7,7 @@ use cortex_m_rt::{entry, exception}; | |||
| 7 | #[cfg(feature = "defmt")] | 7 | #[cfg(feature = "defmt")] |
| 8 | use defmt_rtt as _; | 8 | use defmt_rtt as _; |
| 9 | use embassy_boot_stm32::*; | 9 | use embassy_boot_stm32::*; |
| 10 | use embassy_stm32::flash::{Flash, BANK1_REGION}; | 10 | use embassy_stm32::flash::{BANK1_REGION, Flash}; |
| 11 | use embassy_sync::blocking_mutex::Mutex; | 11 | use embassy_sync::blocking_mutex::Mutex; |
| 12 | 12 | ||
| 13 | #[entry] | 13 | #[entry] |
diff --git a/examples/boot/bootloader/stm32/src/main.rs b/examples/boot/bootloader/stm32/src/main.rs index f74edd75f..383ad912d 100644 --- a/examples/boot/bootloader/stm32/src/main.rs +++ b/examples/boot/bootloader/stm32/src/main.rs | |||
| @@ -7,7 +7,7 @@ use cortex_m_rt::{entry, exception}; | |||
| 7 | #[cfg(feature = "defmt")] | 7 | #[cfg(feature = "defmt")] |
| 8 | use defmt_rtt as _; | 8 | use defmt_rtt as _; |
| 9 | use embassy_boot_stm32::*; | 9 | use embassy_boot_stm32::*; |
| 10 | use embassy_stm32::flash::{Flash, BANK1_REGION}; | 10 | use embassy_stm32::flash::{BANK1_REGION, Flash}; |
| 11 | use embassy_sync::blocking_mutex::Mutex; | 11 | use embassy_sync::blocking_mutex::Mutex; |
| 12 | 12 | ||
| 13 | #[entry] | 13 | #[entry] |
diff --git a/examples/boot/bootloader/stm32wb-dfu/src/main.rs b/examples/boot/bootloader/stm32wb-dfu/src/main.rs index 475f1234d..9ee82846d 100644 --- a/examples/boot/bootloader/stm32wb-dfu/src/main.rs +++ b/examples/boot/bootloader/stm32wb-dfu/src/main.rs | |||
| @@ -7,14 +7,14 @@ use cortex_m_rt::{entry, exception}; | |||
| 7 | #[cfg(feature = "defmt")] | 7 | #[cfg(feature = "defmt")] |
| 8 | use defmt_rtt as _; | 8 | use defmt_rtt as _; |
| 9 | use embassy_boot_stm32::*; | 9 | use embassy_boot_stm32::*; |
| 10 | use embassy_stm32::flash::{Flash, BANK1_REGION, WRITE_SIZE}; | 10 | use embassy_stm32::flash::{BANK1_REGION, Flash, WRITE_SIZE}; |
| 11 | use embassy_stm32::rcc::WPAN_DEFAULT; | 11 | use embassy_stm32::rcc::WPAN_DEFAULT; |
| 12 | use embassy_stm32::usb::Driver; | 12 | use embassy_stm32::usb::Driver; |
| 13 | use embassy_stm32::{bind_interrupts, peripherals, usb}; | 13 | use embassy_stm32::{bind_interrupts, peripherals, usb}; |
| 14 | use embassy_sync::blocking_mutex::Mutex; | 14 | use embassy_sync::blocking_mutex::Mutex; |
| 15 | use embassy_usb::{msos, Builder}; | 15 | use embassy_usb::{Builder, msos}; |
| 16 | use embassy_usb_dfu::consts::DfuAttributes; | 16 | use embassy_usb_dfu::consts::DfuAttributes; |
| 17 | use embassy_usb_dfu::{usb_dfu, Control, ResetImmediate}; | 17 | use embassy_usb_dfu::{Control, ResetImmediate, usb_dfu}; |
| 18 | 18 | ||
| 19 | bind_interrupts!(struct Irqs { | 19 | bind_interrupts!(struct Irqs { |
| 20 | USB_LP => usb::InterruptHandler<peripherals::USB>; | 20 | USB_LP => usb::InterruptHandler<peripherals::USB>; |
diff --git a/examples/boot/bootloader/stm32wba-dfu/src/main.rs b/examples/boot/bootloader/stm32wba-dfu/src/main.rs index e4aacbca9..b33a75d95 100644 --- a/examples/boot/bootloader/stm32wba-dfu/src/main.rs +++ b/examples/boot/bootloader/stm32wba-dfu/src/main.rs | |||
| @@ -7,13 +7,13 @@ use cortex_m_rt::{entry, exception}; | |||
| 7 | #[cfg(feature = "defmt")] | 7 | #[cfg(feature = "defmt")] |
| 8 | use defmt_rtt as _; | 8 | use defmt_rtt as _; |
| 9 | use embassy_boot_stm32::*; | 9 | use embassy_boot_stm32::*; |
| 10 | use embassy_stm32::flash::{Flash, BANK1_REGION, WRITE_SIZE}; | 10 | use embassy_stm32::flash::{BANK1_REGION, Flash, WRITE_SIZE}; |
| 11 | use embassy_stm32::usb::Driver; | 11 | use embassy_stm32::usb::Driver; |
| 12 | use embassy_stm32::{bind_interrupts, peripherals, usb, Config}; | 12 | use embassy_stm32::{Config, bind_interrupts, peripherals, usb}; |
| 13 | use embassy_sync::blocking_mutex::Mutex; | 13 | use embassy_sync::blocking_mutex::Mutex; |
| 14 | use embassy_usb::{msos, Builder}; | 14 | use embassy_usb::{Builder, msos}; |
| 15 | use embassy_usb_dfu::consts::DfuAttributes; | 15 | use embassy_usb_dfu::consts::DfuAttributes; |
| 16 | use embassy_usb_dfu::{usb_dfu, Control, ResetImmediate}; | 16 | use embassy_usb_dfu::{Control, ResetImmediate, usb_dfu}; |
| 17 | 17 | ||
| 18 | bind_interrupts!(struct Irqs { | 18 | bind_interrupts!(struct Irqs { |
| 19 | USB_OTG_HS => usb::InterruptHandler<peripherals::USB_OTG_HS>; | 19 | USB_OTG_HS => usb::InterruptHandler<peripherals::USB_OTG_HS>; |
diff --git a/examples/mimxrt6/src/bin/button.rs b/examples/mimxrt6/src/bin/button.rs index efb7f14af..a9bdde98e 100644 --- a/examples/mimxrt6/src/bin/button.rs +++ b/examples/mimxrt6/src/bin/button.rs | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | 3 | ||
| 4 | use defmt::info; | 4 | use defmt::info; |
| 5 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| 6 | use embassy_futures::select::{select, Either}; | 6 | use embassy_futures::select::{Either, select}; |
| 7 | use embassy_imxrt::gpio; | 7 | use embassy_imxrt::gpio; |
| 8 | use {defmt_rtt as _, embassy_imxrt_examples as _, panic_probe as _}; | 8 | use {defmt_rtt as _, embassy_imxrt_examples as _, panic_probe as _}; |
| 9 | 9 | ||
diff --git a/examples/mspm0c1104/src/bin/blinky.rs b/examples/mspm0c1104/src/bin/blinky.rs index 0d974cc5e..345077b37 100644 --- a/examples/mspm0c1104/src/bin/blinky.rs +++ b/examples/mspm0c1104/src/bin/blinky.rs | |||
| @@ -3,8 +3,8 @@ | |||
| 3 | 3 | ||
| 4 | use defmt::*; | 4 | use defmt::*; |
| 5 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| 6 | use embassy_mspm0::gpio::{Level, Output}; | ||
| 7 | use embassy_mspm0::Config; | 6 | use embassy_mspm0::Config; |
| 7 | use embassy_mspm0::gpio::{Level, Output}; | ||
| 8 | use embassy_time::Timer; | 8 | use embassy_time::Timer; |
| 9 | use {defmt_rtt as _, panic_halt as _}; | 9 | use {defmt_rtt as _, panic_halt as _}; |
| 10 | 10 | ||
diff --git a/examples/mspm0c1104/src/bin/button.rs b/examples/mspm0c1104/src/bin/button.rs index 7face1618..557d997cd 100644 --- a/examples/mspm0c1104/src/bin/button.rs +++ b/examples/mspm0c1104/src/bin/button.rs | |||
| @@ -3,8 +3,8 @@ | |||
| 3 | 3 | ||
| 4 | use defmt::*; | 4 | use defmt::*; |
| 5 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| 6 | use embassy_mspm0::gpio::{Input, Level, Output, Pull}; | ||
| 7 | use embassy_mspm0::Config; | 6 | use embassy_mspm0::Config; |
| 7 | use embassy_mspm0::gpio::{Input, Level, Output, Pull}; | ||
| 8 | use {defmt_rtt as _, panic_halt as _}; | 8 | use {defmt_rtt as _, panic_halt as _}; |
| 9 | 9 | ||
| 10 | #[embassy_executor::main] | 10 | #[embassy_executor::main] |
diff --git a/examples/mspm0g3507/src/bin/adc.rs b/examples/mspm0g3507/src/bin/adc.rs index ceccc7c02..cf1abb471 100644 --- a/examples/mspm0g3507/src/bin/adc.rs +++ b/examples/mspm0g3507/src/bin/adc.rs | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | use defmt::*; | 4 | use defmt::*; |
| 5 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| 6 | use embassy_mspm0::adc::{self, Adc, Vrsel}; | 6 | use embassy_mspm0::adc::{self, Adc, Vrsel}; |
| 7 | use embassy_mspm0::{bind_interrupts, peripherals, Config}; | 7 | use embassy_mspm0::{Config, bind_interrupts, peripherals}; |
| 8 | use embassy_time::Timer; | 8 | use embassy_time::Timer; |
| 9 | use {defmt_rtt as _, panic_halt as _}; | 9 | use {defmt_rtt as _, panic_halt as _}; |
| 10 | 10 | ||
diff --git a/examples/mspm0g3507/src/bin/blinky.rs b/examples/mspm0g3507/src/bin/blinky.rs index 055a5cd81..47eaf1535 100644 --- a/examples/mspm0g3507/src/bin/blinky.rs +++ b/examples/mspm0g3507/src/bin/blinky.rs | |||
| @@ -3,8 +3,8 @@ | |||
| 3 | 3 | ||
| 4 | use defmt::*; | 4 | use defmt::*; |
| 5 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| 6 | use embassy_mspm0::gpio::{Level, Output}; | ||
| 7 | use embassy_mspm0::Config; | 6 | use embassy_mspm0::Config; |
| 7 | use embassy_mspm0::gpio::{Level, Output}; | ||
| 8 | use embassy_time::Timer; | 8 | use embassy_time::Timer; |
| 9 | use {defmt_rtt as _, panic_halt as _}; | 9 | use {defmt_rtt as _, panic_halt as _}; |
| 10 | 10 | ||
diff --git a/examples/mspm0g3507/src/bin/button.rs b/examples/mspm0g3507/src/bin/button.rs index cde1f2892..76f3a1aba 100644 --- a/examples/mspm0g3507/src/bin/button.rs +++ b/examples/mspm0g3507/src/bin/button.rs | |||
| @@ -3,8 +3,8 @@ | |||
| 3 | 3 | ||
| 4 | use defmt::*; | 4 | use defmt::*; |
| 5 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| 6 | use embassy_mspm0::gpio::{Input, Level, Output, Pull}; | ||
| 7 | use embassy_mspm0::Config; | 6 | use embassy_mspm0::Config; |
| 7 | use embassy_mspm0::gpio::{Input, Level, Output, Pull}; | ||
| 8 | use {defmt_rtt as _, panic_halt as _}; | 8 | use {defmt_rtt as _, panic_halt as _}; |
| 9 | 9 | ||
| 10 | #[embassy_executor::main] | 10 | #[embassy_executor::main] |
diff --git a/examples/mspm0g3519/src/bin/blinky.rs b/examples/mspm0g3519/src/bin/blinky.rs index 055a5cd81..47eaf1535 100644 --- a/examples/mspm0g3519/src/bin/blinky.rs +++ b/examples/mspm0g3519/src/bin/blinky.rs | |||
| @@ -3,8 +3,8 @@ | |||
| 3 | 3 | ||
| 4 | use defmt::*; | 4 | use defmt::*; |
| 5 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| 6 | use embassy_mspm0::gpio::{Level, Output}; | ||
| 7 | use embassy_mspm0::Config; | 6 | use embassy_mspm0::Config; |
| 7 | use embassy_mspm0::gpio::{Level, Output}; | ||
| 8 | use embassy_time::Timer; | 8 | use embassy_time::Timer; |
| 9 | use {defmt_rtt as _, panic_halt as _}; | 9 | use {defmt_rtt as _, panic_halt as _}; |
| 10 | 10 | ||
diff --git a/examples/mspm0g3519/src/bin/button.rs b/examples/mspm0g3519/src/bin/button.rs index c81cc2918..21e7873d8 100644 --- a/examples/mspm0g3519/src/bin/button.rs +++ b/examples/mspm0g3519/src/bin/button.rs | |||
| @@ -3,8 +3,8 @@ | |||
| 3 | 3 | ||
| 4 | use defmt::*; | 4 | use defmt::*; |
| 5 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| 6 | use embassy_mspm0::gpio::{Input, Level, Output, Pull}; | ||
| 7 | use embassy_mspm0::Config; | 6 | use embassy_mspm0::Config; |
| 7 | use embassy_mspm0::gpio::{Input, Level, Output, Pull}; | ||
| 8 | use {defmt_rtt as _, panic_halt as _}; | 8 | use {defmt_rtt as _, panic_halt as _}; |
| 9 | 9 | ||
| 10 | #[embassy_executor::main] | 10 | #[embassy_executor::main] |
diff --git a/examples/mspm0l1306/src/bin/adc.rs b/examples/mspm0l1306/src/bin/adc.rs index 2806b98cc..235396b8a 100644 --- a/examples/mspm0l1306/src/bin/adc.rs +++ b/examples/mspm0l1306/src/bin/adc.rs | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | use defmt::*; | 4 | use defmt::*; |
| 5 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| 6 | use embassy_mspm0::adc::{self, Adc, Vrsel}; | 6 | use embassy_mspm0::adc::{self, Adc, Vrsel}; |
| 7 | use embassy_mspm0::{bind_interrupts, peripherals, Config}; | 7 | use embassy_mspm0::{Config, bind_interrupts, peripherals}; |
| 8 | use embassy_time::Timer; | 8 | use embassy_time::Timer; |
| 9 | use {defmt_rtt as _, panic_halt as _}; | 9 | use {defmt_rtt as _, panic_halt as _}; |
| 10 | 10 | ||
diff --git a/examples/mspm0l1306/src/bin/blinky.rs b/examples/mspm0l1306/src/bin/blinky.rs index 055a5cd81..47eaf1535 100644 --- a/examples/mspm0l1306/src/bin/blinky.rs +++ b/examples/mspm0l1306/src/bin/blinky.rs | |||
| @@ -3,8 +3,8 @@ | |||
| 3 | 3 | ||
| 4 | use defmt::*; | 4 | use defmt::*; |
| 5 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| 6 | use embassy_mspm0::gpio::{Level, Output}; | ||
| 7 | use embassy_mspm0::Config; | 6 | use embassy_mspm0::Config; |
| 7 | use embassy_mspm0::gpio::{Level, Output}; | ||
| 8 | use embassy_time::Timer; | 8 | use embassy_time::Timer; |
| 9 | use {defmt_rtt as _, panic_halt as _}; | 9 | use {defmt_rtt as _, panic_halt as _}; |
| 10 | 10 | ||
diff --git a/examples/mspm0l1306/src/bin/button.rs b/examples/mspm0l1306/src/bin/button.rs index d8c85947f..33e682272 100644 --- a/examples/mspm0l1306/src/bin/button.rs +++ b/examples/mspm0l1306/src/bin/button.rs | |||
| @@ -3,8 +3,8 @@ | |||
| 3 | 3 | ||
| 4 | use defmt::*; | 4 | use defmt::*; |
| 5 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| 6 | use embassy_mspm0::gpio::{Input, Level, Output, Pull}; | ||
| 7 | use embassy_mspm0::Config; | 6 | use embassy_mspm0::Config; |
| 7 | use embassy_mspm0::gpio::{Input, Level, Output, Pull}; | ||
| 8 | use {defmt_rtt as _, panic_halt as _}; | 8 | use {defmt_rtt as _, panic_halt as _}; |
| 9 | 9 | ||
| 10 | #[embassy_executor::main] | 10 | #[embassy_executor::main] |
diff --git a/examples/mspm0l2228/src/bin/blinky.rs b/examples/mspm0l2228/src/bin/blinky.rs index 055a5cd81..47eaf1535 100644 --- a/examples/mspm0l2228/src/bin/blinky.rs +++ b/examples/mspm0l2228/src/bin/blinky.rs | |||
| @@ -3,8 +3,8 @@ | |||
| 3 | 3 | ||
| 4 | use defmt::*; | 4 | use defmt::*; |
| 5 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| 6 | use embassy_mspm0::gpio::{Level, Output}; | ||
| 7 | use embassy_mspm0::Config; | 6 | use embassy_mspm0::Config; |
| 7 | use embassy_mspm0::gpio::{Level, Output}; | ||
| 8 | use embassy_time::Timer; | 8 | use embassy_time::Timer; |
| 9 | use {defmt_rtt as _, panic_halt as _}; | 9 | use {defmt_rtt as _, panic_halt as _}; |
| 10 | 10 | ||
diff --git a/examples/mspm0l2228/src/bin/button.rs b/examples/mspm0l2228/src/bin/button.rs index 47bfd274b..bad1cb138 100644 --- a/examples/mspm0l2228/src/bin/button.rs +++ b/examples/mspm0l2228/src/bin/button.rs | |||
| @@ -3,8 +3,8 @@ | |||
| 3 | 3 | ||
| 4 | use defmt::*; | 4 | use defmt::*; |
| 5 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| 6 | use embassy_mspm0::gpio::{Input, Level, Output, Pull}; | ||
| 7 | use embassy_mspm0::Config; | 6 | use embassy_mspm0::Config; |
| 7 | use embassy_mspm0::gpio::{Input, Level, Output, Pull}; | ||
| 8 | use {defmt_rtt as _, panic_halt as _}; | 8 | use {defmt_rtt as _, panic_halt as _}; |
| 9 | 9 | ||
| 10 | #[embassy_executor::main] | 10 | #[embassy_executor::main] |
diff --git a/examples/nrf52840-edf/src/bin/basic.rs b/examples/nrf52840-edf/src/bin/basic.rs index d888e17d1..f7214790d 100644 --- a/examples/nrf52840-edf/src/bin/basic.rs +++ b/examples/nrf52840-edf/src/bin/basic.rs | |||
| @@ -12,7 +12,7 @@ | |||
| 12 | #![no_std] | 12 | #![no_std] |
| 13 | #![no_main] | 13 | #![no_main] |
| 14 | 14 | ||
| 15 | use core::sync::atomic::{compiler_fence, Ordering}; | 15 | use core::sync::atomic::{Ordering, compiler_fence}; |
| 16 | 16 | ||
| 17 | use defmt::unwrap; | 17 | use defmt::unwrap; |
| 18 | use embassy_executor::Spawner; | 18 | use embassy_executor::Spawner; |
diff --git a/examples/nrf52840-rtic/src/bin/blinky.rs b/examples/nrf52840-rtic/src/bin/blinky.rs index 2adac7e0a..671082117 100644 --- a/examples/nrf52840-rtic/src/bin/blinky.rs +++ b/examples/nrf52840-rtic/src/bin/blinky.rs | |||
| @@ -7,7 +7,7 @@ use {defmt_rtt as _, panic_probe as _}; | |||
| 7 | mod app { | 7 | mod app { |
| 8 | use defmt::info; | 8 | use defmt::info; |
| 9 | use embassy_nrf::gpio::{Level, Output, OutputDrive}; | 9 | use embassy_nrf::gpio::{Level, Output, OutputDrive}; |
| 10 | use embassy_nrf::{peripherals, Peri}; | 10 | use embassy_nrf::{Peri, peripherals}; |
| 11 | use embassy_time::Timer; | 11 | use embassy_time::Timer; |
| 12 | 12 | ||
| 13 | #[shared] | 13 | #[shared] |
diff --git a/examples/nrf52840/src/bin/channel_sender_receiver.rs b/examples/nrf52840/src/bin/channel_sender_receiver.rs index 09050db68..de694eaa0 100644 --- a/examples/nrf52840/src/bin/channel_sender_receiver.rs +++ b/examples/nrf52840/src/bin/channel_sender_receiver.rs | |||
| @@ -3,8 +3,8 @@ | |||
| 3 | 3 | ||
| 4 | use defmt::unwrap; | 4 | use defmt::unwrap; |
| 5 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| 6 | use embassy_nrf::gpio::{AnyPin, Level, Output, OutputDrive}; | ||
| 7 | use embassy_nrf::Peri; | 6 | use embassy_nrf::Peri; |
| 7 | use embassy_nrf::gpio::{AnyPin, Level, Output, OutputDrive}; | ||
| 8 | use embassy_sync::blocking_mutex::raw::NoopRawMutex; | 8 | use embassy_sync::blocking_mutex::raw::NoopRawMutex; |
| 9 | use embassy_sync::channel::{Channel, Receiver, Sender}; | 9 | use embassy_sync::channel::{Channel, Receiver, Sender}; |
| 10 | use embassy_time::Timer; | 10 | use embassy_time::Timer; |
diff --git a/examples/nrf52840/src/bin/ethernet_enc28j60.rs b/examples/nrf52840/src/bin/ethernet_enc28j60.rs index e59afd37f..5a988d89b 100644 --- a/examples/nrf52840/src/bin/ethernet_enc28j60.rs +++ b/examples/nrf52840/src/bin/ethernet_enc28j60.rs | |||
| @@ -3,8 +3,8 @@ | |||
| 3 | 3 | ||
| 4 | use defmt::*; | 4 | use defmt::*; |
| 5 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| 6 | use embassy_net::tcp::TcpSocket; | ||
| 7 | use embassy_net::StackResources; | 6 | use embassy_net::StackResources; |
| 7 | use embassy_net::tcp::TcpSocket; | ||
| 8 | use embassy_net_enc28j60::Enc28j60; | 8 | use embassy_net_enc28j60::Enc28j60; |
| 9 | use embassy_nrf::gpio::{Level, Output, OutputDrive}; | 9 | use embassy_nrf::gpio::{Level, Output, OutputDrive}; |
| 10 | use embassy_nrf::rng::Rng; | 10 | use embassy_nrf::rng::Rng; |
diff --git a/examples/nrf52840/src/bin/i2s_effect.rs b/examples/nrf52840/src/bin/i2s_effect.rs index 9eadeb4e4..c31b78614 100644 --- a/examples/nrf52840/src/bin/i2s_effect.rs +++ b/examples/nrf52840/src/bin/i2s_effect.rs | |||
| @@ -5,7 +5,7 @@ use core::f32::consts::PI; | |||
| 5 | 5 | ||
| 6 | use defmt::{error, info}; | 6 | use defmt::{error, info}; |
| 7 | use embassy_executor::Spawner; | 7 | use embassy_executor::Spawner; |
| 8 | use embassy_nrf::i2s::{self, Channels, Config, MasterClock, MultiBuffering, Sample as _, SampleWidth, I2S}; | 8 | use embassy_nrf::i2s::{self, Channels, Config, I2S, MasterClock, MultiBuffering, Sample as _, SampleWidth}; |
| 9 | use embassy_nrf::{bind_interrupts, peripherals}; | 9 | use embassy_nrf::{bind_interrupts, peripherals}; |
| 10 | use {defmt_rtt as _, panic_probe as _}; | 10 | use {defmt_rtt as _, panic_probe as _}; |
| 11 | 11 | ||
| @@ -102,11 +102,7 @@ impl SineOsc { | |||
| 102 | 102 | ||
| 103 | #[inline] | 103 | #[inline] |
| 104 | fn abs(value: f32) -> f32 { | 104 | fn abs(value: f32) -> f32 { |
| 105 | if value < 0.0 { | 105 | if value < 0.0 { -value } else { value } |
| 106 | -value | ||
| 107 | } else { | ||
| 108 | value | ||
| 109 | } | ||
| 110 | } | 106 | } |
| 111 | 107 | ||
| 112 | #[inline] | 108 | #[inline] |
diff --git a/examples/nrf52840/src/bin/i2s_monitor.rs b/examples/nrf52840/src/bin/i2s_monitor.rs index 799be351f..66b429b09 100644 --- a/examples/nrf52840/src/bin/i2s_monitor.rs +++ b/examples/nrf52840/src/bin/i2s_monitor.rs | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | 3 | ||
| 4 | use defmt::{debug, error, info}; | 4 | use defmt::{debug, error, info}; |
| 5 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| 6 | use embassy_nrf::i2s::{self, Channels, Config, DoubleBuffering, MasterClock, Sample as _, SampleWidth, I2S}; | 6 | use embassy_nrf::i2s::{self, Channels, Config, DoubleBuffering, I2S, MasterClock, Sample as _, SampleWidth}; |
| 7 | use embassy_nrf::pwm::{Prescaler, SimplePwm}; | 7 | use embassy_nrf::pwm::{Prescaler, SimplePwm}; |
| 8 | use embassy_nrf::{bind_interrupts, peripherals}; | 8 | use embassy_nrf::{bind_interrupts, peripherals}; |
| 9 | use {defmt_rtt as _, panic_probe as _}; | 9 | use {defmt_rtt as _, panic_probe as _}; |
diff --git a/examples/nrf52840/src/bin/i2s_waveform.rs b/examples/nrf52840/src/bin/i2s_waveform.rs index 137d82840..ce7a68d3a 100644 --- a/examples/nrf52840/src/bin/i2s_waveform.rs +++ b/examples/nrf52840/src/bin/i2s_waveform.rs | |||
| @@ -5,7 +5,7 @@ use core::f32::consts::PI; | |||
| 5 | 5 | ||
| 6 | use defmt::{error, info}; | 6 | use defmt::{error, info}; |
| 7 | use embassy_executor::Spawner; | 7 | use embassy_executor::Spawner; |
| 8 | use embassy_nrf::i2s::{self, Channels, Config, DoubleBuffering, MasterClock, Sample as _, SampleWidth, I2S}; | 8 | use embassy_nrf::i2s::{self, Channels, Config, DoubleBuffering, I2S, MasterClock, Sample as _, SampleWidth}; |
| 9 | use embassy_nrf::{bind_interrupts, peripherals}; | 9 | use embassy_nrf::{bind_interrupts, peripherals}; |
| 10 | use {defmt_rtt as _, panic_probe as _}; | 10 | use {defmt_rtt as _, panic_probe as _}; |
| 11 | 11 | ||
| @@ -140,11 +140,7 @@ impl SineOsc { | |||
| 140 | 140 | ||
| 141 | #[inline] | 141 | #[inline] |
| 142 | fn abs(value: f32) -> f32 { | 142 | fn abs(value: f32) -> f32 { |
| 143 | if value < 0.0 { | 143 | if value < 0.0 { -value } else { value } |
| 144 | -value | ||
| 145 | } else { | ||
| 146 | value | ||
| 147 | } | ||
| 148 | } | 144 | } |
| 149 | 145 | ||
| 150 | #[inline] | 146 | #[inline] |
diff --git a/examples/nrf52840/src/bin/raw_spawn.rs b/examples/nrf52840/src/bin/raw_spawn.rs index faa8517c8..783be763d 100644 --- a/examples/nrf52840/src/bin/raw_spawn.rs +++ b/examples/nrf52840/src/bin/raw_spawn.rs | |||
| @@ -5,8 +5,8 @@ use core::mem; | |||
| 5 | 5 | ||
| 6 | use cortex_m_rt::entry; | 6 | use cortex_m_rt::entry; |
| 7 | use defmt::{info, unwrap}; | 7 | use defmt::{info, unwrap}; |
| 8 | use embassy_executor::raw::TaskStorage; | ||
| 9 | use embassy_executor::Executor; | 8 | use embassy_executor::Executor; |
| 9 | use embassy_executor::raw::TaskStorage; | ||
| 10 | use embassy_time::Timer; | 10 | use embassy_time::Timer; |
| 11 | use static_cell::StaticCell; | 11 | use static_cell::StaticCell; |
| 12 | use {defmt_rtt as _, panic_probe as _}; | 12 | use {defmt_rtt as _, panic_probe as _}; |
diff --git a/examples/nrf52840/src/bin/rtc.rs b/examples/nrf52840/src/bin/rtc.rs index 9d475df7f..56a0c25f4 100644 --- a/examples/nrf52840/src/bin/rtc.rs +++ b/examples/nrf52840/src/bin/rtc.rs | |||
| @@ -7,8 +7,8 @@ use embassy_executor::Spawner; | |||
| 7 | use embassy_nrf::gpio::{Level, Output, OutputDrive}; | 7 | use embassy_nrf::gpio::{Level, Output, OutputDrive}; |
| 8 | use embassy_nrf::interrupt; | 8 | use embassy_nrf::interrupt; |
| 9 | use embassy_nrf::rtc::Rtc; | 9 | use embassy_nrf::rtc::Rtc; |
| 10 | use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex; | ||
| 11 | use embassy_sync::blocking_mutex::Mutex; | 10 | use embassy_sync::blocking_mutex::Mutex; |
| 11 | use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex; | ||
| 12 | use portable_atomic::AtomicU64; | 12 | use portable_atomic::AtomicU64; |
| 13 | use {defmt_rtt as _, panic_probe as _}; | 13 | use {defmt_rtt as _, panic_probe as _}; |
| 14 | 14 | ||
diff --git a/examples/nrf52840/src/bin/usb_ethernet.rs b/examples/nrf52840/src/bin/usb_ethernet.rs index a75b967b4..14a1004d7 100644 --- a/examples/nrf52840/src/bin/usb_ethernet.rs +++ b/examples/nrf52840/src/bin/usb_ethernet.rs | |||
| @@ -3,11 +3,11 @@ | |||
| 3 | 3 | ||
| 4 | use defmt::*; | 4 | use defmt::*; |
| 5 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| 6 | use embassy_net::tcp::TcpSocket; | ||
| 7 | use embassy_net::StackResources; | 6 | use embassy_net::StackResources; |
| 7 | use embassy_net::tcp::TcpSocket; | ||
| 8 | use embassy_nrf::rng::Rng; | 8 | use embassy_nrf::rng::Rng; |
| 9 | use embassy_nrf::usb::vbus_detect::HardwareVbusDetect; | ||
| 10 | use embassy_nrf::usb::Driver; | 9 | use embassy_nrf::usb::Driver; |
| 10 | use embassy_nrf::usb::vbus_detect::HardwareVbusDetect; | ||
| 11 | use embassy_nrf::{bind_interrupts, pac, peripherals, rng, usb}; | 11 | use embassy_nrf::{bind_interrupts, pac, peripherals, rng, usb}; |
| 12 | use embassy_usb::class::cdc_ncm::embassy_net::{Device, Runner, State as NetState}; | 12 | use embassy_usb::class::cdc_ncm::embassy_net::{Device, Runner, State as NetState}; |
| 13 | use embassy_usb::class::cdc_ncm::{CdcNcmClass, State}; | 13 | use embassy_usb::class::cdc_ncm::{CdcNcmClass, State}; |
diff --git a/examples/nrf52840/src/bin/usb_hid_keyboard.rs b/examples/nrf52840/src/bin/usb_hid_keyboard.rs index 5a9dc90a2..1cd730503 100644 --- a/examples/nrf52840/src/bin/usb_hid_keyboard.rs +++ b/examples/nrf52840/src/bin/usb_hid_keyboard.rs | |||
| @@ -6,10 +6,10 @@ use core::sync::atomic::{AtomicBool, Ordering}; | |||
| 6 | use defmt::*; | 6 | use defmt::*; |
| 7 | use embassy_executor::Spawner; | 7 | use embassy_executor::Spawner; |
| 8 | use embassy_futures::join::join; | 8 | use embassy_futures::join::join; |
| 9 | use embassy_futures::select::{select, Either}; | 9 | use embassy_futures::select::{Either, select}; |
| 10 | use embassy_nrf::gpio::{Input, Pull}; | 10 | use embassy_nrf::gpio::{Input, Pull}; |
| 11 | use embassy_nrf::usb::vbus_detect::HardwareVbusDetect; | ||
| 12 | use embassy_nrf::usb::Driver; | 11 | use embassy_nrf::usb::Driver; |
| 12 | use embassy_nrf::usb::vbus_detect::HardwareVbusDetect; | ||
| 13 | use embassy_nrf::{bind_interrupts, pac, peripherals, usb}; | 13 | use embassy_nrf::{bind_interrupts, pac, peripherals, usb}; |
| 14 | use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex; | 14 | use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex; |
| 15 | use embassy_sync::signal::Signal; | 15 | use embassy_sync::signal::Signal; |
| @@ -210,7 +210,9 @@ impl Handler for MyDeviceHandler { | |||
| 210 | 210 | ||
| 211 | fn suspended(&mut self, suspended: bool) { | 211 | fn suspended(&mut self, suspended: bool) { |
| 212 | if suspended { | 212 | if suspended { |
| 213 | info!("Device suspended, the Vbus current limit is 500µA (or 2.5mA for high-power devices with remote wakeup enabled)."); | 213 | info!( |
| 214 | "Device suspended, the Vbus current limit is 500µA (or 2.5mA for high-power devices with remote wakeup enabled)." | ||
| 215 | ); | ||
| 214 | SUSPENDED.store(true, Ordering::Release); | 216 | SUSPENDED.store(true, Ordering::Release); |
| 215 | } else { | 217 | } else { |
| 216 | SUSPENDED.store(false, Ordering::Release); | 218 | SUSPENDED.store(false, Ordering::Release); |
diff --git a/examples/nrf52840/src/bin/usb_hid_mouse.rs b/examples/nrf52840/src/bin/usb_hid_mouse.rs index 80cda70e3..3c0fc04e8 100644 --- a/examples/nrf52840/src/bin/usb_hid_mouse.rs +++ b/examples/nrf52840/src/bin/usb_hid_mouse.rs | |||
| @@ -4,8 +4,8 @@ | |||
| 4 | use defmt::*; | 4 | use defmt::*; |
| 5 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| 6 | use embassy_futures::join::join; | 6 | use embassy_futures::join::join; |
| 7 | use embassy_nrf::usb::vbus_detect::HardwareVbusDetect; | ||
| 8 | use embassy_nrf::usb::Driver; | 7 | use embassy_nrf::usb::Driver; |
| 8 | use embassy_nrf::usb::vbus_detect::HardwareVbusDetect; | ||
| 9 | use embassy_nrf::{bind_interrupts, pac, peripherals, usb}; | 9 | use embassy_nrf::{bind_interrupts, pac, peripherals, usb}; |
| 10 | use embassy_time::Timer; | 10 | use embassy_time::Timer; |
| 11 | use embassy_usb::class::hid::{HidWriter, ReportId, RequestHandler, State}; | 11 | use embassy_usb::class::hid::{HidWriter, ReportId, RequestHandler, State}; |
diff --git a/examples/nrf52840/src/bin/usb_serial.rs b/examples/nrf52840/src/bin/usb_serial.rs index e7c2d0854..469002bc7 100644 --- a/examples/nrf52840/src/bin/usb_serial.rs +++ b/examples/nrf52840/src/bin/usb_serial.rs | |||
| @@ -4,8 +4,8 @@ | |||
| 4 | use defmt::{info, panic}; | 4 | use defmt::{info, panic}; |
| 5 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| 6 | use embassy_futures::join::join; | 6 | use embassy_futures::join::join; |
| 7 | use embassy_nrf::usb::vbus_detect::{HardwareVbusDetect, VbusDetect}; | ||
| 8 | use embassy_nrf::usb::Driver; | 7 | use embassy_nrf::usb::Driver; |
| 8 | use embassy_nrf::usb::vbus_detect::{HardwareVbusDetect, VbusDetect}; | ||
| 9 | use embassy_nrf::{bind_interrupts, pac, peripherals, usb}; | 9 | use embassy_nrf::{bind_interrupts, pac, peripherals, usb}; |
| 10 | use embassy_usb::class::cdc_acm::{CdcAcmClass, State}; | 10 | use embassy_usb::class::cdc_acm::{CdcAcmClass, State}; |
| 11 | use embassy_usb::driver::EndpointError; | 11 | use embassy_usb::driver::EndpointError; |
diff --git a/examples/nrf52840/src/bin/usb_serial_multitask.rs b/examples/nrf52840/src/bin/usb_serial_multitask.rs index b6a983854..67b2bccbb 100644 --- a/examples/nrf52840/src/bin/usb_serial_multitask.rs +++ b/examples/nrf52840/src/bin/usb_serial_multitask.rs | |||
| @@ -3,8 +3,8 @@ | |||
| 3 | 3 | ||
| 4 | use defmt::{info, panic, unwrap}; | 4 | use defmt::{info, panic, unwrap}; |
| 5 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| 6 | use embassy_nrf::usb::vbus_detect::HardwareVbusDetect; | ||
| 7 | use embassy_nrf::usb::Driver; | 6 | use embassy_nrf::usb::Driver; |
| 7 | use embassy_nrf::usb::vbus_detect::HardwareVbusDetect; | ||
| 8 | use embassy_nrf::{bind_interrupts, pac, peripherals, usb}; | 8 | use embassy_nrf::{bind_interrupts, pac, peripherals, usb}; |
| 9 | use embassy_usb::class::cdc_acm::{CdcAcmClass, State}; | 9 | use embassy_usb::class::cdc_acm::{CdcAcmClass, State}; |
| 10 | use embassy_usb::driver::EndpointError; | 10 | use embassy_usb::driver::EndpointError; |
diff --git a/examples/nrf52840/src/bin/usb_serial_winusb.rs b/examples/nrf52840/src/bin/usb_serial_winusb.rs index e30e08a01..cd4d5bca1 100644 --- a/examples/nrf52840/src/bin/usb_serial_winusb.rs +++ b/examples/nrf52840/src/bin/usb_serial_winusb.rs | |||
| @@ -4,8 +4,8 @@ | |||
| 4 | use defmt::{info, panic}; | 4 | use defmt::{info, panic}; |
| 5 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| 6 | use embassy_futures::join::join; | 6 | use embassy_futures::join::join; |
| 7 | use embassy_nrf::usb::vbus_detect::{HardwareVbusDetect, VbusDetect}; | ||
| 8 | use embassy_nrf::usb::Driver; | 7 | use embassy_nrf::usb::Driver; |
| 8 | use embassy_nrf::usb::vbus_detect::{HardwareVbusDetect, VbusDetect}; | ||
| 9 | use embassy_nrf::{bind_interrupts, pac, peripherals, usb}; | 9 | use embassy_nrf::{bind_interrupts, pac, peripherals, usb}; |
| 10 | use embassy_usb::class::cdc_acm::{CdcAcmClass, State}; | 10 | use embassy_usb::class::cdc_acm::{CdcAcmClass, State}; |
| 11 | use embassy_usb::driver::EndpointError; | 11 | use embassy_usb::driver::EndpointError; |
diff --git a/examples/nrf52840/src/bin/wifi_esp_hosted.rs b/examples/nrf52840/src/bin/wifi_esp_hosted.rs index 1bc35746a..07752ffc4 100644 --- a/examples/nrf52840/src/bin/wifi_esp_hosted.rs +++ b/examples/nrf52840/src/bin/wifi_esp_hosted.rs | |||
| @@ -3,8 +3,8 @@ | |||
| 3 | 3 | ||
| 4 | use defmt::{info, unwrap, warn}; | 4 | use defmt::{info, unwrap, warn}; |
| 5 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| 6 | use embassy_net::tcp::TcpSocket; | ||
| 7 | use embassy_net::StackResources; | 6 | use embassy_net::StackResources; |
| 7 | use embassy_net::tcp::TcpSocket; | ||
| 8 | use embassy_nrf::gpio::{Input, Level, Output, OutputDrive, Pull}; | 8 | use embassy_nrf::gpio::{Input, Level, Output, OutputDrive, Pull}; |
| 9 | use embassy_nrf::rng::Rng; | 9 | use embassy_nrf::rng::Rng; |
| 10 | use embassy_nrf::spim::{self, Spim}; | 10 | use embassy_nrf::spim::{self, Spim}; |
diff --git a/examples/nrf9160/src/bin/modem_tcp_client.rs b/examples/nrf9160/src/bin/modem_tcp_client.rs index c9d879662..07fa57e63 100644 --- a/examples/nrf9160/src/bin/modem_tcp_client.rs +++ b/examples/nrf9160/src/bin/modem_tcp_client.rs | |||
| @@ -11,11 +11,11 @@ use defmt::{info, unwrap, warn}; | |||
| 11 | use embassy_executor::Spawner; | 11 | use embassy_executor::Spawner; |
| 12 | use embassy_net::{Ipv4Cidr, Stack, StackResources}; | 12 | use embassy_net::{Ipv4Cidr, Stack, StackResources}; |
| 13 | use embassy_net_nrf91::context::Status; | 13 | use embassy_net_nrf91::context::Status; |
| 14 | use embassy_net_nrf91::{context, Runner, State, TraceBuffer, TraceReader}; | 14 | use embassy_net_nrf91::{Runner, State, TraceBuffer, TraceReader, context}; |
| 15 | use embassy_nrf::buffered_uarte::{self, BufferedUarteTx}; | 15 | use embassy_nrf::buffered_uarte::{self, BufferedUarteTx}; |
| 16 | use embassy_nrf::gpio::{AnyPin, Level, Output, OutputDrive}; | 16 | use embassy_nrf::gpio::{AnyPin, Level, Output, OutputDrive}; |
| 17 | use embassy_nrf::uarte::Baudrate; | 17 | use embassy_nrf::uarte::Baudrate; |
| 18 | use embassy_nrf::{bind_interrupts, interrupt, peripherals, uarte, Peri}; | 18 | use embassy_nrf::{Peri, bind_interrupts, interrupt, peripherals, uarte}; |
| 19 | use embassy_time::{Duration, Timer}; | 19 | use embassy_time::{Duration, Timer}; |
| 20 | use embedded_io_async::Write; | 20 | use embedded_io_async::Write; |
| 21 | use heapless::Vec; | 21 | use heapless::Vec; |
diff --git a/examples/rp/src/bin/assign_resources.rs b/examples/rp/src/bin/assign_resources.rs index 4ee4278b5..aaa134768 100644 --- a/examples/rp/src/bin/assign_resources.rs +++ b/examples/rp/src/bin/assign_resources.rs | |||
| @@ -14,9 +14,9 @@ | |||
| 14 | use assign_resources::assign_resources; | 14 | use assign_resources::assign_resources; |
| 15 | use defmt::*; | 15 | use defmt::*; |
| 16 | use embassy_executor::Spawner; | 16 | use embassy_executor::Spawner; |
| 17 | use embassy_rp::Peri; | ||
| 17 | use embassy_rp::gpio::{Level, Output}; | 18 | use embassy_rp::gpio::{Level, Output}; |
| 18 | use embassy_rp::peripherals::{self, PIN_20, PIN_21}; | 19 | use embassy_rp::peripherals::{self, PIN_20, PIN_21}; |
| 19 | use embassy_rp::Peri; | ||
| 20 | use embassy_time::Timer; | 20 | use embassy_time::Timer; |
| 21 | use {defmt_rtt as _, panic_probe as _}; | 21 | use {defmt_rtt as _, panic_probe as _}; |
| 22 | 22 | ||
diff --git a/examples/rp/src/bin/debounce.rs b/examples/rp/src/bin/debounce.rs index 0077f19fc..6eeb01d0a 100644 --- a/examples/rp/src/bin/debounce.rs +++ b/examples/rp/src/bin/debounce.rs | |||
| @@ -7,7 +7,7 @@ | |||
| 7 | use defmt::info; | 7 | use defmt::info; |
| 8 | use embassy_executor::Spawner; | 8 | use embassy_executor::Spawner; |
| 9 | use embassy_rp::gpio::{Input, Level, Pull}; | 9 | use embassy_rp::gpio::{Input, Level, Pull}; |
| 10 | use embassy_time::{with_deadline, Duration, Instant, Timer}; | 10 | use embassy_time::{Duration, Instant, Timer, with_deadline}; |
| 11 | use {defmt_rtt as _, panic_probe as _}; | 11 | use {defmt_rtt as _, panic_probe as _}; |
| 12 | 12 | ||
| 13 | pub struct Debouncer<'a> { | 13 | pub struct Debouncer<'a> { |
diff --git a/examples/rp/src/bin/ethernet_w5500_icmp_ping.rs b/examples/rp/src/bin/ethernet_w5500_icmp_ping.rs index 49d28071a..cb667f24f 100644 --- a/examples/rp/src/bin/ethernet_w5500_icmp_ping.rs +++ b/examples/rp/src/bin/ethernet_w5500_icmp_ping.rs | |||
| @@ -12,8 +12,8 @@ use core::str::FromStr; | |||
| 12 | use defmt::*; | 12 | use defmt::*; |
| 13 | use embassy_executor::Spawner; | 13 | use embassy_executor::Spawner; |
| 14 | use embassy_futures::yield_now; | 14 | use embassy_futures::yield_now; |
| 15 | use embassy_net::icmp::ping::{PingManager, PingParams}; | ||
| 16 | use embassy_net::icmp::PacketMetadata; | 15 | use embassy_net::icmp::PacketMetadata; |
| 16 | use embassy_net::icmp::ping::{PingManager, PingParams}; | ||
| 17 | use embassy_net::{Ipv4Cidr, Stack, StackResources}; | 17 | use embassy_net::{Ipv4Cidr, Stack, StackResources}; |
| 18 | use embassy_net_wiznet::chip::W5500; | 18 | use embassy_net_wiznet::chip::W5500; |
| 19 | use embassy_net_wiznet::*; | 19 | use embassy_net_wiznet::*; |
| @@ -99,7 +99,7 @@ async fn main(spawner: Spawner) { | |||
| 99 | // Create the ping manager instance | 99 | // Create the ping manager instance |
| 100 | let mut ping_manager = PingManager::new(stack, &mut rx_meta, &mut rx_buffer, &mut tx_meta, &mut tx_buffer); | 100 | let mut ping_manager = PingManager::new(stack, &mut rx_meta, &mut rx_buffer, &mut tx_meta, &mut tx_buffer); |
| 101 | let addr = "192.168.8.1"; // Address to ping to | 101 | let addr = "192.168.8.1"; // Address to ping to |
| 102 | // Create the PingParams with the target address | 102 | // Create the PingParams with the target address |
| 103 | let mut ping_params = PingParams::new(Ipv4Addr::from_str(addr).unwrap()); | 103 | let mut ping_params = PingParams::new(Ipv4Addr::from_str(addr).unwrap()); |
| 104 | // (optional) Set custom properties of the ping | 104 | // (optional) Set custom properties of the ping |
| 105 | ping_params.set_payload(b"Hello, Ping!"); // custom payload | 105 | ping_params.set_payload(b"Hello, Ping!"); // custom payload |
diff --git a/examples/rp/src/bin/ethernet_w55rp20_tcp_server.rs b/examples/rp/src/bin/ethernet_w55rp20_tcp_server.rs index f51df2df9..b402029b5 100644 --- a/examples/rp/src/bin/ethernet_w55rp20_tcp_server.rs +++ b/examples/rp/src/bin/ethernet_w55rp20_tcp_server.rs | |||
| @@ -65,7 +65,7 @@ async fn main(spawner: Spawner) { | |||
| 65 | // Construct an SPI driver backed by a PIO state machine | 65 | // Construct an SPI driver backed by a PIO state machine |
| 66 | let mut spi_cfg = SpiConfig::default(); | 66 | let mut spi_cfg = SpiConfig::default(); |
| 67 | spi_cfg.frequency = 12_500_000; // The PIO SPI program is much less stable than the actual SPI | 67 | spi_cfg.frequency = 12_500_000; // The PIO SPI program is much less stable than the actual SPI |
| 68 | // peripheral, use higher speeds at your peril | 68 | // peripheral, use higher speeds at your peril |
| 69 | let spi = Spi::new(&mut common, sm0, clk, mosi, miso, p.DMA_CH0, p.DMA_CH1, spi_cfg); | 69 | let spi = Spi::new(&mut common, sm0, clk, mosi, miso, p.DMA_CH0, p.DMA_CH1, spi_cfg); |
| 70 | 70 | ||
| 71 | // Further control pins | 71 | // Further control pins |
diff --git a/examples/rp/src/bin/interrupt.rs b/examples/rp/src/bin/interrupt.rs index 2748f778a..2605622ab 100644 --- a/examples/rp/src/bin/interrupt.rs +++ b/examples/rp/src/bin/interrupt.rs | |||
| @@ -16,8 +16,8 @@ use embassy_rp::adc::{self, Adc, Blocking}; | |||
| 16 | use embassy_rp::gpio::Pull; | 16 | use embassy_rp::gpio::Pull; |
| 17 | use embassy_rp::interrupt; | 17 | use embassy_rp::interrupt; |
| 18 | use embassy_rp::pwm::{Config, Pwm}; | 18 | use embassy_rp::pwm::{Config, Pwm}; |
| 19 | use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex; | ||
| 20 | use embassy_sync::blocking_mutex::Mutex; | 19 | use embassy_sync::blocking_mutex::Mutex; |
| 20 | use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex; | ||
| 21 | use embassy_sync::channel::Channel; | 21 | use embassy_sync::channel::Channel; |
| 22 | use embassy_time::{Duration, Ticker}; | 22 | use embassy_time::{Duration, Ticker}; |
| 23 | use portable_atomic::{AtomicU32, Ordering}; | 23 | use portable_atomic::{AtomicU32, Ordering}; |
diff --git a/examples/rp/src/bin/multicore.rs b/examples/rp/src/bin/multicore.rs index 3a6367420..d289f8020 100644 --- a/examples/rp/src/bin/multicore.rs +++ b/examples/rp/src/bin/multicore.rs | |||
| @@ -8,7 +8,7 @@ | |||
| 8 | use defmt::*; | 8 | use defmt::*; |
| 9 | use embassy_executor::Executor; | 9 | use embassy_executor::Executor; |
| 10 | use embassy_rp::gpio::{Level, Output}; | 10 | use embassy_rp::gpio::{Level, Output}; |
| 11 | use embassy_rp::multicore::{spawn_core1, Stack}; | 11 | use embassy_rp::multicore::{Stack, spawn_core1}; |
| 12 | use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex; | 12 | use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex; |
| 13 | use embassy_sync::channel::Channel; | 13 | use embassy_sync::channel::Channel; |
| 14 | use embassy_time::Timer; | 14 | use embassy_time::Timer; |
diff --git a/examples/rp/src/bin/multiprio.rs b/examples/rp/src/bin/multiprio.rs index 0750d9bb7..310047505 100644 --- a/examples/rp/src/bin/multiprio.rs +++ b/examples/rp/src/bin/multiprio.rs | |||
| @@ -61,7 +61,7 @@ use defmt::{info, unwrap}; | |||
| 61 | use embassy_executor::{Executor, InterruptExecutor}; | 61 | use embassy_executor::{Executor, InterruptExecutor}; |
| 62 | use embassy_rp::interrupt; | 62 | use embassy_rp::interrupt; |
| 63 | use embassy_rp::interrupt::{InterruptExt, Priority}; | 63 | use embassy_rp::interrupt::{InterruptExt, Priority}; |
| 64 | use embassy_time::{Instant, Timer, TICK_HZ}; | 64 | use embassy_time::{Instant, TICK_HZ, Timer}; |
| 65 | use static_cell::StaticCell; | 65 | use static_cell::StaticCell; |
| 66 | use {defmt_rtt as _, panic_probe as _}; | 66 | use {defmt_rtt as _, panic_probe as _}; |
| 67 | 67 | ||
diff --git a/examples/rp/src/bin/orchestrate_tasks.rs b/examples/rp/src/bin/orchestrate_tasks.rs index 9f25e1087..cd26a5371 100644 --- a/examples/rp/src/bin/orchestrate_tasks.rs +++ b/examples/rp/src/bin/orchestrate_tasks.rs | |||
| @@ -20,11 +20,11 @@ | |||
| 20 | use assign_resources::assign_resources; | 20 | use assign_resources::assign_resources; |
| 21 | use defmt::*; | 21 | use defmt::*; |
| 22 | use embassy_executor::Spawner; | 22 | use embassy_executor::Spawner; |
| 23 | use embassy_futures::select::{select, Either}; | 23 | use embassy_futures::select::{Either, select}; |
| 24 | use embassy_rp::adc::{Adc, Channel, Config, InterruptHandler}; | 24 | use embassy_rp::adc::{Adc, Channel, Config, InterruptHandler}; |
| 25 | use embassy_rp::clocks::RoscRng; | 25 | use embassy_rp::clocks::RoscRng; |
| 26 | use embassy_rp::gpio::{Input, Pull}; | 26 | use embassy_rp::gpio::{Input, Pull}; |
| 27 | use embassy_rp::{bind_interrupts, peripherals, Peri}; | 27 | use embassy_rp::{Peri, bind_interrupts, peripherals}; |
| 28 | use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex; | 28 | use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex; |
| 29 | use embassy_sync::mutex::Mutex; | 29 | use embassy_sync::mutex::Mutex; |
| 30 | use embassy_sync::{channel, signal}; | 30 | use embassy_sync::{channel, signal}; |
diff --git a/examples/rp/src/bin/overclock.rs b/examples/rp/src/bin/overclock.rs index 83b17308b..a98185a8e 100644 --- a/examples/rp/src/bin/overclock.rs +++ b/examples/rp/src/bin/overclock.rs | |||
| @@ -7,7 +7,7 @@ | |||
| 7 | 7 | ||
| 8 | use defmt::*; | 8 | use defmt::*; |
| 9 | use embassy_executor::Spawner; | 9 | use embassy_executor::Spawner; |
| 10 | use embassy_rp::clocks::{clk_sys_freq, core_voltage, ClockConfig}; | 10 | use embassy_rp::clocks::{ClockConfig, clk_sys_freq, core_voltage}; |
| 11 | use embassy_rp::config::Config; | 11 | use embassy_rp::config::Config; |
| 12 | use embassy_rp::gpio::{Level, Output}; | 12 | use embassy_rp::gpio::{Level, Output}; |
| 13 | use embassy_time::{Duration, Instant, Timer}; | 13 | use embassy_time::{Duration, Instant, Timer}; |
diff --git a/examples/rp/src/bin/overclock_manual.rs b/examples/rp/src/bin/overclock_manual.rs index dea5cfb3c..18397f9a8 100644 --- a/examples/rp/src/bin/overclock_manual.rs +++ b/examples/rp/src/bin/overclock_manual.rs | |||
| @@ -7,7 +7,7 @@ | |||
| 7 | 7 | ||
| 8 | use defmt::*; | 8 | use defmt::*; |
| 9 | use embassy_executor::Spawner; | 9 | use embassy_executor::Spawner; |
| 10 | use embassy_rp::clocks::{clk_sys_freq, core_voltage, ClockConfig, CoreVoltage, PllConfig}; | 10 | use embassy_rp::clocks::{ClockConfig, CoreVoltage, PllConfig, clk_sys_freq, core_voltage}; |
| 11 | use embassy_rp::config::Config; | 11 | use embassy_rp::config::Config; |
| 12 | use embassy_rp::gpio::{Level, Output}; | 12 | use embassy_rp::gpio::{Level, Output}; |
| 13 | use embassy_time::{Duration, Instant, Timer}; | 13 | use embassy_time::{Duration, Instant, Timer}; |
diff --git a/examples/rp/src/bin/pio_async.rs b/examples/rp/src/bin/pio_async.rs index 1743a417e..55e983c36 100644 --- a/examples/rp/src/bin/pio_async.rs +++ b/examples/rp/src/bin/pio_async.rs | |||
| @@ -7,7 +7,7 @@ use embassy_executor::Spawner; | |||
| 7 | use embassy_rp::peripherals::PIO0; | 7 | use embassy_rp::peripherals::PIO0; |
| 8 | use embassy_rp::pio::program::pio_asm; | 8 | use embassy_rp::pio::program::pio_asm; |
| 9 | use embassy_rp::pio::{Common, Config, InterruptHandler, Irq, Pio, PioPin, ShiftDirection, StateMachine}; | 9 | use embassy_rp::pio::{Common, Config, InterruptHandler, Irq, Pio, PioPin, ShiftDirection, StateMachine}; |
| 10 | use embassy_rp::{bind_interrupts, Peri}; | 10 | use embassy_rp::{Peri, bind_interrupts}; |
| 11 | use fixed::traits::ToFixed; | 11 | use fixed::traits::ToFixed; |
| 12 | use fixed_macro::types::U56F8; | 12 | use fixed_macro::types::U56F8; |
| 13 | use {defmt_rtt as _, panic_probe as _}; | 13 | use {defmt_rtt as _, panic_probe as _}; |
diff --git a/examples/rp/src/bin/pio_stepper.rs b/examples/rp/src/bin/pio_stepper.rs index 3862c248b..e8f203990 100644 --- a/examples/rp/src/bin/pio_stepper.rs +++ b/examples/rp/src/bin/pio_stepper.rs | |||
| @@ -10,7 +10,7 @@ use embassy_rp::bind_interrupts; | |||
| 10 | use embassy_rp::peripherals::PIO0; | 10 | use embassy_rp::peripherals::PIO0; |
| 11 | use embassy_rp::pio::{InterruptHandler, Pio}; | 11 | use embassy_rp::pio::{InterruptHandler, Pio}; |
| 12 | use embassy_rp::pio_programs::stepper::{PioStepper, PioStepperProgram}; | 12 | use embassy_rp::pio_programs::stepper::{PioStepper, PioStepperProgram}; |
| 13 | use embassy_time::{with_timeout, Duration, Timer}; | 13 | use embassy_time::{Duration, Timer, with_timeout}; |
| 14 | use {defmt_rtt as _, panic_probe as _}; | 14 | use {defmt_rtt as _, panic_probe as _}; |
| 15 | 15 | ||
| 16 | bind_interrupts!(struct Irqs { | 16 | bind_interrupts!(struct Irqs { |
diff --git a/examples/rp/src/bin/pwm.rs b/examples/rp/src/bin/pwm.rs index 9dd07ab6e..f985bf7cf 100644 --- a/examples/rp/src/bin/pwm.rs +++ b/examples/rp/src/bin/pwm.rs | |||
| @@ -9,9 +9,9 @@ | |||
| 9 | 9 | ||
| 10 | use defmt::*; | 10 | use defmt::*; |
| 11 | use embassy_executor::Spawner; | 11 | use embassy_executor::Spawner; |
| 12 | use embassy_rp::peripherals::{PIN_25, PIN_4, PWM_SLICE2, PWM_SLICE4}; | ||
| 13 | use embassy_rp::pwm::{Config, Pwm, SetDutyCycle}; | ||
| 14 | use embassy_rp::Peri; | 12 | use embassy_rp::Peri; |
| 13 | use embassy_rp::peripherals::{PIN_4, PIN_25, PWM_SLICE2, PWM_SLICE4}; | ||
| 14 | use embassy_rp::pwm::{Config, Pwm, SetDutyCycle}; | ||
| 15 | use embassy_time::Timer; | 15 | use embassy_time::Timer; |
| 16 | use {defmt_rtt as _, panic_probe as _}; | 16 | use {defmt_rtt as _, panic_probe as _}; |
| 17 | 17 | ||
diff --git a/examples/rp/src/bin/rtc_alarm.rs b/examples/rp/src/bin/rtc_alarm.rs index 94b5fbd27..bde49ccd5 100644 --- a/examples/rp/src/bin/rtc_alarm.rs +++ b/examples/rp/src/bin/rtc_alarm.rs | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | 5 | ||
| 6 | use defmt::*; | 6 | use defmt::*; |
| 7 | use embassy_executor::Spawner; | 7 | use embassy_executor::Spawner; |
| 8 | use embassy_futures::select::{select, Either}; | 8 | use embassy_futures::select::{Either, select}; |
| 9 | use embassy_rp::bind_interrupts; | 9 | use embassy_rp::bind_interrupts; |
| 10 | use embassy_rp::rtc::{DateTime, DateTimeFilter, DayOfWeek, Rtc}; | 10 | use embassy_rp::rtc::{DateTime, DateTimeFilter, DayOfWeek, Rtc}; |
| 11 | use embassy_time::Timer; | 11 | use embassy_time::Timer; |
diff --git a/examples/rp/src/bin/spi_display.rs b/examples/rp/src/bin/spi_display.rs index dd114a4ae..4bf924e56 100644 --- a/examples/rp/src/bin/spi_display.rs +++ b/examples/rp/src/bin/spi_display.rs | |||
| @@ -15,19 +15,19 @@ use embassy_executor::Spawner; | |||
| 15 | use embassy_rp::gpio::{Level, Output}; | 15 | use embassy_rp::gpio::{Level, Output}; |
| 16 | use embassy_rp::spi; | 16 | use embassy_rp::spi; |
| 17 | use embassy_rp::spi::Spi; | 17 | use embassy_rp::spi::Spi; |
| 18 | use embassy_sync::blocking_mutex::raw::NoopRawMutex; | ||
| 19 | use embassy_sync::blocking_mutex::Mutex; | 18 | use embassy_sync::blocking_mutex::Mutex; |
| 19 | use embassy_sync::blocking_mutex::raw::NoopRawMutex; | ||
| 20 | use embassy_time::Delay; | 20 | use embassy_time::Delay; |
| 21 | use embedded_graphics::image::{Image, ImageRawLE}; | 21 | use embedded_graphics::image::{Image, ImageRawLE}; |
| 22 | use embedded_graphics::mono_font::ascii::FONT_10X20; | ||
| 23 | use embedded_graphics::mono_font::MonoTextStyle; | 22 | use embedded_graphics::mono_font::MonoTextStyle; |
| 23 | use embedded_graphics::mono_font::ascii::FONT_10X20; | ||
| 24 | use embedded_graphics::pixelcolor::Rgb565; | 24 | use embedded_graphics::pixelcolor::Rgb565; |
| 25 | use embedded_graphics::prelude::*; | 25 | use embedded_graphics::prelude::*; |
| 26 | use embedded_graphics::primitives::{PrimitiveStyleBuilder, Rectangle}; | 26 | use embedded_graphics::primitives::{PrimitiveStyleBuilder, Rectangle}; |
| 27 | use embedded_graphics::text::Text; | 27 | use embedded_graphics::text::Text; |
| 28 | use mipidsi::Builder; | ||
| 28 | use mipidsi::models::ST7789; | 29 | use mipidsi::models::ST7789; |
| 29 | use mipidsi::options::{Orientation, Rotation}; | 30 | use mipidsi::options::{Orientation, Rotation}; |
| 30 | use mipidsi::Builder; | ||
| 31 | use {defmt_rtt as _, panic_probe as _}; | 31 | use {defmt_rtt as _, panic_probe as _}; |
| 32 | 32 | ||
| 33 | use crate::touch::Touch; | 33 | use crate::touch::Touch; |
| @@ -167,11 +167,7 @@ mod touch { | |||
| 167 | 167 | ||
| 168 | let x = ((x - cal.x1) * cal.sx / (cal.x2 - cal.x1)).clamp(0, cal.sx); | 168 | let x = ((x - cal.x1) * cal.sx / (cal.x2 - cal.x1)).clamp(0, cal.sx); |
| 169 | let y = ((y - cal.y1) * cal.sy / (cal.y2 - cal.y1)).clamp(0, cal.sy); | 169 | let y = ((y - cal.y1) * cal.sy / (cal.y2 - cal.y1)).clamp(0, cal.sy); |
| 170 | if x == 0 && y == 0 { | 170 | if x == 0 && y == 0 { None } else { Some((x, y)) } |
| 171 | None | ||
| 172 | } else { | ||
| 173 | Some((x, y)) | ||
| 174 | } | ||
| 175 | } | 171 | } |
| 176 | } | 172 | } |
| 177 | } | 173 | } |
diff --git a/examples/rp/src/bin/spi_gc9a01.rs b/examples/rp/src/bin/spi_gc9a01.rs index fdef09d4b..fd007b9bd 100644 --- a/examples/rp/src/bin/spi_gc9a01.rs +++ b/examples/rp/src/bin/spi_gc9a01.rs | |||
| @@ -16,16 +16,16 @@ use embassy_rp::clocks::RoscRng; | |||
| 16 | use embassy_rp::gpio::{Level, Output}; | 16 | use embassy_rp::gpio::{Level, Output}; |
| 17 | use embassy_rp::spi; | 17 | use embassy_rp::spi; |
| 18 | use embassy_rp::spi::{Blocking, Spi}; | 18 | use embassy_rp::spi::{Blocking, Spi}; |
| 19 | use embassy_sync::blocking_mutex::raw::NoopRawMutex; | ||
| 20 | use embassy_sync::blocking_mutex::Mutex; | 19 | use embassy_sync::blocking_mutex::Mutex; |
| 20 | use embassy_sync::blocking_mutex::raw::NoopRawMutex; | ||
| 21 | use embassy_time::{Delay, Duration, Timer}; | 21 | use embassy_time::{Delay, Duration, Timer}; |
| 22 | use embedded_graphics::image::{Image, ImageRawLE}; | 22 | use embedded_graphics::image::{Image, ImageRawLE}; |
| 23 | use embedded_graphics::pixelcolor::Rgb565; | 23 | use embedded_graphics::pixelcolor::Rgb565; |
| 24 | use embedded_graphics::prelude::*; | 24 | use embedded_graphics::prelude::*; |
| 25 | use embedded_graphics::primitives::{PrimitiveStyleBuilder, Rectangle}; | 25 | use embedded_graphics::primitives::{PrimitiveStyleBuilder, Rectangle}; |
| 26 | use mipidsi::Builder; | ||
| 26 | use mipidsi::models::GC9A01; | 27 | use mipidsi::models::GC9A01; |
| 27 | use mipidsi::options::{ColorInversion, ColorOrder}; | 28 | use mipidsi::options::{ColorInversion, ColorOrder}; |
| 28 | use mipidsi::Builder; | ||
| 29 | use {defmt_rtt as _, panic_probe as _}; | 29 | use {defmt_rtt as _, panic_probe as _}; |
| 30 | 30 | ||
| 31 | const DISPLAY_FREQ: u32 = 64_000_000; | 31 | const DISPLAY_FREQ: u32 = 64_000_000; |
diff --git a/examples/rp/src/bin/uart_r503.rs b/examples/rp/src/bin/uart_r503.rs index 085be280b..a25d45b18 100644 --- a/examples/rp/src/bin/uart_r503.rs +++ b/examples/rp/src/bin/uart_r503.rs | |||
| @@ -6,7 +6,7 @@ use embassy_executor::Spawner; | |||
| 6 | use embassy_rp::bind_interrupts; | 6 | use embassy_rp::bind_interrupts; |
| 7 | use embassy_rp::peripherals::UART0; | 7 | use embassy_rp::peripherals::UART0; |
| 8 | use embassy_rp::uart::{Config, DataBits, InterruptHandler as UARTInterruptHandler, Parity, StopBits, Uart}; | 8 | use embassy_rp::uart::{Config, DataBits, InterruptHandler as UARTInterruptHandler, Parity, StopBits, Uart}; |
| 9 | use embassy_time::{with_timeout, Duration, Timer}; | 9 | use embassy_time::{Duration, Timer, with_timeout}; |
| 10 | use heapless::Vec; | 10 | use heapless::Vec; |
| 11 | use {defmt_rtt as _, panic_probe as _}; | 11 | use {defmt_rtt as _, panic_probe as _}; |
| 12 | 12 | ||
diff --git a/examples/rp/src/bin/usb_ethernet.rs b/examples/rp/src/bin/usb_ethernet.rs index 912e52e96..b62a602b1 100644 --- a/examples/rp/src/bin/usb_ethernet.rs +++ b/examples/rp/src/bin/usb_ethernet.rs | |||
| @@ -7,8 +7,8 @@ | |||
| 7 | 7 | ||
| 8 | use defmt::*; | 8 | use defmt::*; |
| 9 | use embassy_executor::Spawner; | 9 | use embassy_executor::Spawner; |
| 10 | use embassy_net::tcp::TcpSocket; | ||
| 11 | use embassy_net::StackResources; | 10 | use embassy_net::StackResources; |
| 11 | use embassy_net::tcp::TcpSocket; | ||
| 12 | use embassy_rp::clocks::RoscRng; | 12 | use embassy_rp::clocks::RoscRng; |
| 13 | use embassy_rp::peripherals::USB; | 13 | use embassy_rp::peripherals::USB; |
| 14 | use embassy_rp::usb::{Driver, InterruptHandler}; | 14 | use embassy_rp::usb::{Driver, InterruptHandler}; |
diff --git a/examples/rp/src/bin/usb_serial.rs b/examples/rp/src/bin/usb_serial.rs index b79012acb..23d0c9e8b 100644 --- a/examples/rp/src/bin/usb_serial.rs +++ b/examples/rp/src/bin/usb_serial.rs | |||
| @@ -10,9 +10,9 @@ use embassy_executor::Spawner; | |||
| 10 | use embassy_rp::bind_interrupts; | 10 | use embassy_rp::bind_interrupts; |
| 11 | use embassy_rp::peripherals::USB; | 11 | use embassy_rp::peripherals::USB; |
| 12 | use embassy_rp::usb::{Driver, Instance, InterruptHandler}; | 12 | use embassy_rp::usb::{Driver, Instance, InterruptHandler}; |
| 13 | use embassy_usb::UsbDevice; | ||
| 13 | use embassy_usb::class::cdc_acm::{CdcAcmClass, State}; | 14 | use embassy_usb::class::cdc_acm::{CdcAcmClass, State}; |
| 14 | use embassy_usb::driver::EndpointError; | 15 | use embassy_usb::driver::EndpointError; |
| 15 | use embassy_usb::UsbDevice; | ||
| 16 | use static_cell::StaticCell; | 16 | use static_cell::StaticCell; |
| 17 | use {defmt_rtt as _, panic_probe as _}; | 17 | use {defmt_rtt as _, panic_probe as _}; |
| 18 | 18 | ||
diff --git a/examples/rp/src/bin/wifi_ap_tcp_server.rs b/examples/rp/src/bin/wifi_ap_tcp_server.rs index 128599e0d..0828dbbb9 100644 --- a/examples/rp/src/bin/wifi_ap_tcp_server.rs +++ b/examples/rp/src/bin/wifi_ap_tcp_server.rs | |||
| @@ -7,7 +7,7 @@ | |||
| 7 | 7 | ||
| 8 | use core::str::from_utf8; | 8 | use core::str::from_utf8; |
| 9 | 9 | ||
| 10 | use cyw43_pio::{PioSpi, DEFAULT_CLOCK_DIVIDER}; | 10 | use cyw43_pio::{DEFAULT_CLOCK_DIVIDER, PioSpi}; |
| 11 | use defmt::*; | 11 | use defmt::*; |
| 12 | use embassy_executor::Spawner; | 12 | use embassy_executor::Spawner; |
| 13 | use embassy_net::tcp::TcpSocket; | 13 | use embassy_net::tcp::TcpSocket; |
diff --git a/examples/rp/src/bin/wifi_blinky.rs b/examples/rp/src/bin/wifi_blinky.rs index b2e08c517..aa6ee4df0 100644 --- a/examples/rp/src/bin/wifi_blinky.rs +++ b/examples/rp/src/bin/wifi_blinky.rs | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | #![no_std] | 5 | #![no_std] |
| 6 | #![no_main] | 6 | #![no_main] |
| 7 | 7 | ||
| 8 | use cyw43_pio::{PioSpi, DEFAULT_CLOCK_DIVIDER}; | 8 | use cyw43_pio::{DEFAULT_CLOCK_DIVIDER, PioSpi}; |
| 9 | use defmt::*; | 9 | use defmt::*; |
| 10 | use embassy_executor::Spawner; | 10 | use embassy_executor::Spawner; |
| 11 | use embassy_rp::bind_interrupts; | 11 | use embassy_rp::bind_interrupts; |
diff --git a/examples/rp/src/bin/wifi_scan.rs b/examples/rp/src/bin/wifi_scan.rs index c884aa2ba..7e3de1db9 100644 --- a/examples/rp/src/bin/wifi_scan.rs +++ b/examples/rp/src/bin/wifi_scan.rs | |||
| @@ -7,7 +7,7 @@ | |||
| 7 | 7 | ||
| 8 | use core::str; | 8 | use core::str; |
| 9 | 9 | ||
| 10 | use cyw43_pio::{PioSpi, DEFAULT_CLOCK_DIVIDER}; | 10 | use cyw43_pio::{DEFAULT_CLOCK_DIVIDER, PioSpi}; |
| 11 | use defmt::*; | 11 | use defmt::*; |
| 12 | use embassy_executor::Spawner; | 12 | use embassy_executor::Spawner; |
| 13 | use embassy_rp::bind_interrupts; | 13 | use embassy_rp::bind_interrupts; |
diff --git a/examples/rp/src/bin/wifi_tcp_server.rs b/examples/rp/src/bin/wifi_tcp_server.rs index 126475779..e39de4902 100644 --- a/examples/rp/src/bin/wifi_tcp_server.rs +++ b/examples/rp/src/bin/wifi_tcp_server.rs | |||
| @@ -8,7 +8,7 @@ | |||
| 8 | use core::str::from_utf8; | 8 | use core::str::from_utf8; |
| 9 | 9 | ||
| 10 | use cyw43::JoinOptions; | 10 | use cyw43::JoinOptions; |
| 11 | use cyw43_pio::{PioSpi, DEFAULT_CLOCK_DIVIDER}; | 11 | use cyw43_pio::{DEFAULT_CLOCK_DIVIDER, PioSpi}; |
| 12 | use defmt::*; | 12 | use defmt::*; |
| 13 | use embassy_executor::Spawner; | 13 | use embassy_executor::Spawner; |
| 14 | use embassy_net::tcp::TcpSocket; | 14 | use embassy_net::tcp::TcpSocket; |
diff --git a/examples/rp/src/bin/wifi_webrequest.rs b/examples/rp/src/bin/wifi_webrequest.rs index 079def370..b618d2b38 100644 --- a/examples/rp/src/bin/wifi_webrequest.rs +++ b/examples/rp/src/bin/wifi_webrequest.rs | |||
| @@ -8,7 +8,7 @@ | |||
| 8 | use core::str::from_utf8; | 8 | use core::str::from_utf8; |
| 9 | 9 | ||
| 10 | use cyw43::JoinOptions; | 10 | use cyw43::JoinOptions; |
| 11 | use cyw43_pio::{PioSpi, DEFAULT_CLOCK_DIVIDER}; | 11 | use cyw43_pio::{DEFAULT_CLOCK_DIVIDER, PioSpi}; |
| 12 | use defmt::*; | 12 | use defmt::*; |
| 13 | use embassy_executor::Spawner; | 13 | use embassy_executor::Spawner; |
| 14 | use embassy_net::dns::DnsSocket; | 14 | use embassy_net::dns::DnsSocket; |
diff --git a/examples/rp/src/bin/zerocopy.rs b/examples/rp/src/bin/zerocopy.rs index d603e1ed3..fc5f95e6e 100644 --- a/examples/rp/src/bin/zerocopy.rs +++ b/examples/rp/src/bin/zerocopy.rs | |||
| @@ -11,7 +11,7 @@ use embassy_executor::Spawner; | |||
| 11 | use embassy_rp::adc::{self, Adc, Async, Config, InterruptHandler}; | 11 | use embassy_rp::adc::{self, Adc, Async, Config, InterruptHandler}; |
| 12 | use embassy_rp::gpio::Pull; | 12 | use embassy_rp::gpio::Pull; |
| 13 | use embassy_rp::peripherals::DMA_CH0; | 13 | use embassy_rp::peripherals::DMA_CH0; |
| 14 | use embassy_rp::{bind_interrupts, Peri}; | 14 | use embassy_rp::{Peri, bind_interrupts}; |
| 15 | use embassy_sync::blocking_mutex::raw::NoopRawMutex; | 15 | use embassy_sync::blocking_mutex::raw::NoopRawMutex; |
| 16 | use embassy_sync::zerocopy_channel::{Channel, Receiver, Sender}; | 16 | use embassy_sync::zerocopy_channel::{Channel, Receiver, Sender}; |
| 17 | use embassy_time::{Duration, Ticker, Timer}; | 17 | use embassy_time::{Duration, Ticker, Timer}; |
diff --git a/examples/rp235x/src/bin/assign_resources.rs b/examples/rp235x/src/bin/assign_resources.rs index 4ee4278b5..aaa134768 100644 --- a/examples/rp235x/src/bin/assign_resources.rs +++ b/examples/rp235x/src/bin/assign_resources.rs | |||
| @@ -14,9 +14,9 @@ | |||
| 14 | use assign_resources::assign_resources; | 14 | use assign_resources::assign_resources; |
| 15 | use defmt::*; | 15 | use defmt::*; |
| 16 | use embassy_executor::Spawner; | 16 | use embassy_executor::Spawner; |
| 17 | use embassy_rp::Peri; | ||
| 17 | use embassy_rp::gpio::{Level, Output}; | 18 | use embassy_rp::gpio::{Level, Output}; |
| 18 | use embassy_rp::peripherals::{self, PIN_20, PIN_21}; | 19 | use embassy_rp::peripherals::{self, PIN_20, PIN_21}; |
| 19 | use embassy_rp::Peri; | ||
| 20 | use embassy_time::Timer; | 20 | use embassy_time::Timer; |
| 21 | use {defmt_rtt as _, panic_probe as _}; | 21 | use {defmt_rtt as _, panic_probe as _}; |
| 22 | 22 | ||
diff --git a/examples/rp235x/src/bin/debounce.rs b/examples/rp235x/src/bin/debounce.rs index 0077f19fc..6eeb01d0a 100644 --- a/examples/rp235x/src/bin/debounce.rs +++ b/examples/rp235x/src/bin/debounce.rs | |||
| @@ -7,7 +7,7 @@ | |||
| 7 | use defmt::info; | 7 | use defmt::info; |
| 8 | use embassy_executor::Spawner; | 8 | use embassy_executor::Spawner; |
| 9 | use embassy_rp::gpio::{Input, Level, Pull}; | 9 | use embassy_rp::gpio::{Input, Level, Pull}; |
| 10 | use embassy_time::{with_deadline, Duration, Instant, Timer}; | 10 | use embassy_time::{Duration, Instant, Timer, with_deadline}; |
| 11 | use {defmt_rtt as _, panic_probe as _}; | 11 | use {defmt_rtt as _, panic_probe as _}; |
| 12 | 12 | ||
| 13 | pub struct Debouncer<'a> { | 13 | pub struct Debouncer<'a> { |
diff --git a/examples/rp235x/src/bin/ethernet_w5500_icmp_ping.rs b/examples/rp235x/src/bin/ethernet_w5500_icmp_ping.rs index 309d3e4f7..227e68029 100644 --- a/examples/rp235x/src/bin/ethernet_w5500_icmp_ping.rs +++ b/examples/rp235x/src/bin/ethernet_w5500_icmp_ping.rs | |||
| @@ -12,8 +12,8 @@ use core::str::FromStr; | |||
| 12 | use defmt::*; | 12 | use defmt::*; |
| 13 | use embassy_executor::Spawner; | 13 | use embassy_executor::Spawner; |
| 14 | use embassy_futures::yield_now; | 14 | use embassy_futures::yield_now; |
| 15 | use embassy_net::icmp::ping::{PingManager, PingParams}; | ||
| 16 | use embassy_net::icmp::PacketMetadata; | 15 | use embassy_net::icmp::PacketMetadata; |
| 16 | use embassy_net::icmp::ping::{PingManager, PingParams}; | ||
| 17 | use embassy_net::{Ipv4Cidr, Stack, StackResources}; | 17 | use embassy_net::{Ipv4Cidr, Stack, StackResources}; |
| 18 | use embassy_net_wiznet::chip::W5500; | 18 | use embassy_net_wiznet::chip::W5500; |
| 19 | use embassy_net_wiznet::*; | 19 | use embassy_net_wiznet::*; |
| @@ -99,7 +99,7 @@ async fn main(spawner: Spawner) { | |||
| 99 | // Create the ping manager instance | 99 | // Create the ping manager instance |
| 100 | let mut ping_manager = PingManager::new(stack, &mut rx_meta, &mut rx_buffer, &mut tx_meta, &mut tx_buffer); | 100 | let mut ping_manager = PingManager::new(stack, &mut rx_meta, &mut rx_buffer, &mut tx_meta, &mut tx_buffer); |
| 101 | let addr = "192.168.8.1"; // Address to ping to | 101 | let addr = "192.168.8.1"; // Address to ping to |
| 102 | // Create the PingParams with the target address | 102 | // Create the PingParams with the target address |
| 103 | let mut ping_params = PingParams::new(Ipv4Addr::from_str(addr).unwrap()); | 103 | let mut ping_params = PingParams::new(Ipv4Addr::from_str(addr).unwrap()); |
| 104 | // (optional) Set custom properties of the ping | 104 | // (optional) Set custom properties of the ping |
| 105 | ping_params.set_payload(b"Hello, Ping!"); // custom payload | 105 | ping_params.set_payload(b"Hello, Ping!"); // custom payload |
diff --git a/examples/rp235x/src/bin/interrupt.rs b/examples/rp235x/src/bin/interrupt.rs index 88513180c..1b18f6931 100644 --- a/examples/rp235x/src/bin/interrupt.rs +++ b/examples/rp235x/src/bin/interrupt.rs | |||
| @@ -16,8 +16,8 @@ use embassy_rp::adc::{self, Adc, Blocking}; | |||
| 16 | use embassy_rp::gpio::Pull; | 16 | use embassy_rp::gpio::Pull; |
| 17 | use embassy_rp::interrupt; | 17 | use embassy_rp::interrupt; |
| 18 | use embassy_rp::pwm::{Config, Pwm}; | 18 | use embassy_rp::pwm::{Config, Pwm}; |
| 19 | use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex; | ||
| 20 | use embassy_sync::blocking_mutex::Mutex; | 19 | use embassy_sync::blocking_mutex::Mutex; |
| 20 | use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex; | ||
| 21 | use embassy_sync::channel::Channel; | 21 | use embassy_sync::channel::Channel; |
| 22 | use embassy_time::{Duration, Ticker}; | 22 | use embassy_time::{Duration, Ticker}; |
| 23 | use portable_atomic::{AtomicU32, Ordering}; | 23 | use portable_atomic::{AtomicU32, Ordering}; |
diff --git a/examples/rp235x/src/bin/multicore.rs b/examples/rp235x/src/bin/multicore.rs index 4f82801d6..9b61fdbca 100644 --- a/examples/rp235x/src/bin/multicore.rs +++ b/examples/rp235x/src/bin/multicore.rs | |||
| @@ -8,7 +8,7 @@ | |||
| 8 | use defmt::*; | 8 | use defmt::*; |
| 9 | use embassy_executor::Executor; | 9 | use embassy_executor::Executor; |
| 10 | use embassy_rp::gpio::{Level, Output}; | 10 | use embassy_rp::gpio::{Level, Output}; |
| 11 | use embassy_rp::multicore::{spawn_core1, Stack}; | 11 | use embassy_rp::multicore::{Stack, spawn_core1}; |
| 12 | use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex; | 12 | use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex; |
| 13 | use embassy_sync::channel::Channel; | 13 | use embassy_sync::channel::Channel; |
| 14 | use embassy_time::Timer; | 14 | use embassy_time::Timer; |
diff --git a/examples/rp235x/src/bin/multicore_stack_overflow.rs b/examples/rp235x/src/bin/multicore_stack_overflow.rs index dba44aa23..9efe89318 100644 --- a/examples/rp235x/src/bin/multicore_stack_overflow.rs +++ b/examples/rp235x/src/bin/multicore_stack_overflow.rs | |||
| @@ -6,7 +6,7 @@ | |||
| 6 | use defmt::*; | 6 | use defmt::*; |
| 7 | use embassy_executor::Executor; | 7 | use embassy_executor::Executor; |
| 8 | use embassy_rp::gpio::{Level, Output}; | 8 | use embassy_rp::gpio::{Level, Output}; |
| 9 | use embassy_rp::multicore::{spawn_core1, Stack}; | 9 | use embassy_rp::multicore::{Stack, spawn_core1}; |
| 10 | use embassy_time::Timer; | 10 | use embassy_time::Timer; |
| 11 | use static_cell::StaticCell; | 11 | use static_cell::StaticCell; |
| 12 | use {defmt_rtt as _, panic_probe as _}; | 12 | use {defmt_rtt as _, panic_probe as _}; |
diff --git a/examples/rp235x/src/bin/multiprio.rs b/examples/rp235x/src/bin/multiprio.rs index 0750d9bb7..310047505 100644 --- a/examples/rp235x/src/bin/multiprio.rs +++ b/examples/rp235x/src/bin/multiprio.rs | |||
| @@ -61,7 +61,7 @@ use defmt::{info, unwrap}; | |||
| 61 | use embassy_executor::{Executor, InterruptExecutor}; | 61 | use embassy_executor::{Executor, InterruptExecutor}; |
| 62 | use embassy_rp::interrupt; | 62 | use embassy_rp::interrupt; |
| 63 | use embassy_rp::interrupt::{InterruptExt, Priority}; | 63 | use embassy_rp::interrupt::{InterruptExt, Priority}; |
| 64 | use embassy_time::{Instant, Timer, TICK_HZ}; | 64 | use embassy_time::{Instant, TICK_HZ, Timer}; |
| 65 | use static_cell::StaticCell; | 65 | use static_cell::StaticCell; |
| 66 | use {defmt_rtt as _, panic_probe as _}; | 66 | use {defmt_rtt as _, panic_probe as _}; |
| 67 | 67 | ||
diff --git a/examples/rp235x/src/bin/overclock.rs b/examples/rp235x/src/bin/overclock.rs index 5fd97ef97..cba137f3a 100644 --- a/examples/rp235x/src/bin/overclock.rs +++ b/examples/rp235x/src/bin/overclock.rs | |||
| @@ -12,7 +12,7 @@ | |||
| 12 | 12 | ||
| 13 | use defmt::*; | 13 | use defmt::*; |
| 14 | use embassy_executor::Spawner; | 14 | use embassy_executor::Spawner; |
| 15 | use embassy_rp::clocks::{clk_sys_freq, core_voltage, ClockConfig, CoreVoltage}; | 15 | use embassy_rp::clocks::{ClockConfig, CoreVoltage, clk_sys_freq, core_voltage}; |
| 16 | use embassy_rp::config::Config; | 16 | use embassy_rp::config::Config; |
| 17 | use embassy_rp::gpio::{Level, Output}; | 17 | use embassy_rp::gpio::{Level, Output}; |
| 18 | use embassy_time::{Duration, Instant, Timer}; | 18 | use embassy_time::{Duration, Instant, Timer}; |
diff --git a/examples/rp235x/src/bin/pio_async.rs b/examples/rp235x/src/bin/pio_async.rs index d76930f5c..a392fe37e 100644 --- a/examples/rp235x/src/bin/pio_async.rs +++ b/examples/rp235x/src/bin/pio_async.rs | |||
| @@ -7,7 +7,7 @@ use embassy_executor::Spawner; | |||
| 7 | use embassy_rp::peripherals::PIO0; | 7 | use embassy_rp::peripherals::PIO0; |
| 8 | use embassy_rp::pio::program::pio_asm; | 8 | use embassy_rp::pio::program::pio_asm; |
| 9 | use embassy_rp::pio::{Common, Config, InterruptHandler, Irq, Pio, PioPin, ShiftDirection, StateMachine}; | 9 | use embassy_rp::pio::{Common, Config, InterruptHandler, Irq, Pio, PioPin, ShiftDirection, StateMachine}; |
| 10 | use embassy_rp::{bind_interrupts, Peri}; | 10 | use embassy_rp::{Peri, bind_interrupts}; |
| 11 | use fixed::traits::ToFixed; | 11 | use fixed::traits::ToFixed; |
| 12 | use fixed_macro::types::U56F8; | 12 | use fixed_macro::types::U56F8; |
| 13 | use {defmt_rtt as _, panic_probe as _}; | 13 | use {defmt_rtt as _, panic_probe as _}; |
diff --git a/examples/rp235x/src/bin/pio_i2s_rx.rs b/examples/rp235x/src/bin/pio_i2s_rx.rs index c3f505b13..6735c402f 100644 --- a/examples/rp235x/src/bin/pio_i2s_rx.rs +++ b/examples/rp235x/src/bin/pio_i2s_rx.rs | |||
| @@ -34,7 +34,7 @@ const SAMPLE_RATE: u32 = 48_000; | |||
| 34 | const BIT_DEPTH: u32 = 16; | 34 | const BIT_DEPTH: u32 = 16; |
| 35 | const CHANNELS: u32 = 2; | 35 | const CHANNELS: u32 = 2; |
| 36 | const USE_ONBOARD_PULLDOWN: bool = false; // whether or not to use the onboard pull-down resistor, | 36 | const USE_ONBOARD_PULLDOWN: bool = false; // whether or not to use the onboard pull-down resistor, |
| 37 | // which has documented issues on many RP235x boards | 37 | // which has documented issues on many RP235x boards |
| 38 | #[embassy_executor::main] | 38 | #[embassy_executor::main] |
| 39 | async fn main(_spawner: Spawner) { | 39 | async fn main(_spawner: Spawner) { |
| 40 | let p = embassy_rp::init(Default::default()); | 40 | let p = embassy_rp::init(Default::default()); |
diff --git a/examples/rp235x/src/bin/pio_rotary_encoder_rxf.rs b/examples/rp235x/src/bin/pio_rotary_encoder_rxf.rs index 61af94560..948699e40 100644 --- a/examples/rp235x/src/bin/pio_rotary_encoder_rxf.rs +++ b/examples/rp235x/src/bin/pio_rotary_encoder_rxf.rs | |||
| @@ -9,7 +9,7 @@ use embassy_executor::Spawner; | |||
| 9 | use embassy_rp::gpio::Pull; | 9 | use embassy_rp::gpio::Pull; |
| 10 | use embassy_rp::peripherals::PIO0; | 10 | use embassy_rp::peripherals::PIO0; |
| 11 | use embassy_rp::pio::program::pio_asm; | 11 | use embassy_rp::pio::program::pio_asm; |
| 12 | use embassy_rp::{bind_interrupts, pio, Peri}; | 12 | use embassy_rp::{Peri, bind_interrupts, pio}; |
| 13 | use embassy_time::Timer; | 13 | use embassy_time::Timer; |
| 14 | use fixed::traits::ToFixed; | 14 | use fixed::traits::ToFixed; |
| 15 | use pio::{Common, Config, FifoJoin, Instance, InterruptHandler, Pio, PioPin, ShiftDirection, StateMachine}; | 15 | use pio::{Common, Config, FifoJoin, Instance, InterruptHandler, Pio, PioPin, ShiftDirection, StateMachine}; |
diff --git a/examples/rp235x/src/bin/pio_stepper.rs b/examples/rp235x/src/bin/pio_stepper.rs index 931adbeda..9b33710ad 100644 --- a/examples/rp235x/src/bin/pio_stepper.rs +++ b/examples/rp235x/src/bin/pio_stepper.rs | |||
| @@ -10,7 +10,7 @@ use embassy_rp::bind_interrupts; | |||
| 10 | use embassy_rp::peripherals::PIO0; | 10 | use embassy_rp::peripherals::PIO0; |
| 11 | use embassy_rp::pio::{InterruptHandler, Pio}; | 11 | use embassy_rp::pio::{InterruptHandler, Pio}; |
| 12 | use embassy_rp::pio_programs::stepper::{PioStepper, PioStepperProgram}; | 12 | use embassy_rp::pio_programs::stepper::{PioStepper, PioStepperProgram}; |
| 13 | use embassy_time::{with_timeout, Duration, Timer}; | 13 | use embassy_time::{Duration, Timer, with_timeout}; |
| 14 | use {defmt_rtt as _, panic_probe as _}; | 14 | use {defmt_rtt as _, panic_probe as _}; |
| 15 | 15 | ||
| 16 | bind_interrupts!(struct Irqs { | 16 | bind_interrupts!(struct Irqs { |
diff --git a/examples/rp235x/src/bin/pwm.rs b/examples/rp235x/src/bin/pwm.rs index 289480c85..971e86aa7 100644 --- a/examples/rp235x/src/bin/pwm.rs +++ b/examples/rp235x/src/bin/pwm.rs | |||
| @@ -9,9 +9,9 @@ | |||
| 9 | 9 | ||
| 10 | use defmt::*; | 10 | use defmt::*; |
| 11 | use embassy_executor::Spawner; | 11 | use embassy_executor::Spawner; |
| 12 | use embassy_rp::peripherals::{PIN_25, PIN_4, PWM_SLICE2, PWM_SLICE4}; | ||
| 13 | use embassy_rp::pwm::{Config, Pwm, SetDutyCycle}; | ||
| 14 | use embassy_rp::Peri; | 12 | use embassy_rp::Peri; |
| 13 | use embassy_rp::peripherals::{PIN_4, PIN_25, PWM_SLICE2, PWM_SLICE4}; | ||
| 14 | use embassy_rp::pwm::{Config, Pwm, SetDutyCycle}; | ||
| 15 | use embassy_time::Timer; | 15 | use embassy_time::Timer; |
| 16 | use {defmt_rtt as _, panic_probe as _}; | 16 | use {defmt_rtt as _, panic_probe as _}; |
| 17 | 17 | ||
diff --git a/examples/rp235x/src/bin/pwm_tb6612fng_motor_driver.rs b/examples/rp235x/src/bin/pwm_tb6612fng_motor_driver.rs index 2cfb2038d..670f302a4 100644 --- a/examples/rp235x/src/bin/pwm_tb6612fng_motor_driver.rs +++ b/examples/rp235x/src/bin/pwm_tb6612fng_motor_driver.rs | |||
| @@ -10,7 +10,7 @@ use defmt::*; | |||
| 10 | use embassy_executor::Spawner; | 10 | use embassy_executor::Spawner; |
| 11 | use embassy_rp::config::Config; | 11 | use embassy_rp::config::Config; |
| 12 | use embassy_rp::gpio::Output; | 12 | use embassy_rp::gpio::Output; |
| 13 | use embassy_rp::{gpio, peripherals, pwm, Peri}; | 13 | use embassy_rp::{Peri, gpio, peripherals, pwm}; |
| 14 | use embassy_time::{Duration, Timer}; | 14 | use embassy_time::{Duration, Timer}; |
| 15 | use tb6612fng::{DriveCommand, Motor, Tb6612fng}; | 15 | use tb6612fng::{DriveCommand, Motor, Tb6612fng}; |
| 16 | use {defmt_rtt as _, panic_probe as _}; | 16 | use {defmt_rtt as _, panic_probe as _}; |
diff --git a/examples/rp235x/src/bin/spi_display.rs b/examples/rp235x/src/bin/spi_display.rs index 9967abefd..3cef93f62 100644 --- a/examples/rp235x/src/bin/spi_display.rs +++ b/examples/rp235x/src/bin/spi_display.rs | |||
| @@ -15,19 +15,19 @@ use embassy_executor::Spawner; | |||
| 15 | use embassy_rp::gpio::{Level, Output}; | 15 | use embassy_rp::gpio::{Level, Output}; |
| 16 | use embassy_rp::spi; | 16 | use embassy_rp::spi; |
| 17 | use embassy_rp::spi::{Blocking, Spi}; | 17 | use embassy_rp::spi::{Blocking, Spi}; |
| 18 | use embassy_sync::blocking_mutex::raw::NoopRawMutex; | ||
| 19 | use embassy_sync::blocking_mutex::Mutex; | 18 | use embassy_sync::blocking_mutex::Mutex; |
| 19 | use embassy_sync::blocking_mutex::raw::NoopRawMutex; | ||
| 20 | use embassy_time::Delay; | 20 | use embassy_time::Delay; |
| 21 | use embedded_graphics::image::{Image, ImageRawLE}; | 21 | use embedded_graphics::image::{Image, ImageRawLE}; |
| 22 | use embedded_graphics::mono_font::ascii::FONT_10X20; | ||
| 23 | use embedded_graphics::mono_font::MonoTextStyle; | 22 | use embedded_graphics::mono_font::MonoTextStyle; |
| 23 | use embedded_graphics::mono_font::ascii::FONT_10X20; | ||
| 24 | use embedded_graphics::pixelcolor::Rgb565; | 24 | use embedded_graphics::pixelcolor::Rgb565; |
| 25 | use embedded_graphics::prelude::*; | 25 | use embedded_graphics::prelude::*; |
| 26 | use embedded_graphics::primitives::{PrimitiveStyleBuilder, Rectangle}; | 26 | use embedded_graphics::primitives::{PrimitiveStyleBuilder, Rectangle}; |
| 27 | use embedded_graphics::text::Text; | 27 | use embedded_graphics::text::Text; |
| 28 | use mipidsi::Builder; | ||
| 28 | use mipidsi::models::ST7789; | 29 | use mipidsi::models::ST7789; |
| 29 | use mipidsi::options::{Orientation, Rotation}; | 30 | use mipidsi::options::{Orientation, Rotation}; |
| 30 | use mipidsi::Builder; | ||
| 31 | use {defmt_rtt as _, panic_probe as _}; | 31 | use {defmt_rtt as _, panic_probe as _}; |
| 32 | 32 | ||
| 33 | use crate::touch::Touch; | 33 | use crate::touch::Touch; |
| @@ -167,11 +167,7 @@ mod touch { | |||
| 167 | 167 | ||
| 168 | let x = ((x - cal.x1) * cal.sx / (cal.x2 - cal.x1)).clamp(0, cal.sx); | 168 | let x = ((x - cal.x1) * cal.sx / (cal.x2 - cal.x1)).clamp(0, cal.sx); |
| 169 | let y = ((y - cal.y1) * cal.sy / (cal.y2 - cal.y1)).clamp(0, cal.sy); | 169 | let y = ((y - cal.y1) * cal.sy / (cal.y2 - cal.y1)).clamp(0, cal.sy); |
| 170 | if x == 0 && y == 0 { | 170 | if x == 0 && y == 0 { None } else { Some((x, y)) } |
| 171 | None | ||
| 172 | } else { | ||
| 173 | Some((x, y)) | ||
| 174 | } | ||
| 175 | } | 171 | } |
| 176 | } | 172 | } |
| 177 | } | 173 | } |
diff --git a/examples/rp235x/src/bin/uart_r503.rs b/examples/rp235x/src/bin/uart_r503.rs index 085be280b..a25d45b18 100644 --- a/examples/rp235x/src/bin/uart_r503.rs +++ b/examples/rp235x/src/bin/uart_r503.rs | |||
| @@ -6,7 +6,7 @@ use embassy_executor::Spawner; | |||
| 6 | use embassy_rp::bind_interrupts; | 6 | use embassy_rp::bind_interrupts; |
| 7 | use embassy_rp::peripherals::UART0; | 7 | use embassy_rp::peripherals::UART0; |
| 8 | use embassy_rp::uart::{Config, DataBits, InterruptHandler as UARTInterruptHandler, Parity, StopBits, Uart}; | 8 | use embassy_rp::uart::{Config, DataBits, InterruptHandler as UARTInterruptHandler, Parity, StopBits, Uart}; |
| 9 | use embassy_time::{with_timeout, Duration, Timer}; | 9 | use embassy_time::{Duration, Timer, with_timeout}; |
| 10 | use heapless::Vec; | 10 | use heapless::Vec; |
| 11 | use {defmt_rtt as _, panic_probe as _}; | 11 | use {defmt_rtt as _, panic_probe as _}; |
| 12 | 12 | ||
diff --git a/examples/rp235x/src/bin/zerocopy.rs b/examples/rp235x/src/bin/zerocopy.rs index 62ba4cfb8..55deffd5f 100644 --- a/examples/rp235x/src/bin/zerocopy.rs +++ b/examples/rp235x/src/bin/zerocopy.rs | |||
| @@ -11,7 +11,7 @@ use embassy_executor::Spawner; | |||
| 11 | use embassy_rp::adc::{self, Adc, Async, Config, InterruptHandler}; | 11 | use embassy_rp::adc::{self, Adc, Async, Config, InterruptHandler}; |
| 12 | use embassy_rp::gpio::Pull; | 12 | use embassy_rp::gpio::Pull; |
| 13 | use embassy_rp::peripherals::DMA_CH0; | 13 | use embassy_rp::peripherals::DMA_CH0; |
| 14 | use embassy_rp::{bind_interrupts, Peri}; | 14 | use embassy_rp::{Peri, bind_interrupts}; |
| 15 | use embassy_sync::blocking_mutex::raw::NoopRawMutex; | 15 | use embassy_sync::blocking_mutex::raw::NoopRawMutex; |
| 16 | use embassy_sync::zerocopy_channel::{Channel, Receiver, Sender}; | 16 | use embassy_sync::zerocopy_channel::{Channel, Receiver, Sender}; |
| 17 | use embassy_time::{Duration, Ticker, Timer}; | 17 | use embassy_time::{Duration, Ticker, Timer}; |
diff --git a/examples/stm32c0/src/bin/rtc.rs b/examples/stm32c0/src/bin/rtc.rs index 82d8a37ba..feb27f6d9 100644 --- a/examples/stm32c0/src/bin/rtc.rs +++ b/examples/stm32c0/src/bin/rtc.rs | |||
| @@ -4,8 +4,8 @@ | |||
| 4 | use chrono::{NaiveDate, NaiveDateTime}; | 4 | use chrono::{NaiveDate, NaiveDateTime}; |
| 5 | use defmt::*; | 5 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 6 | use embassy_executor::Spawner; |
| 7 | use embassy_stm32::rtc::{Rtc, RtcConfig}; | ||
| 8 | use embassy_stm32::Config; | 7 | use embassy_stm32::Config; |
| 8 | use embassy_stm32::rtc::{Rtc, RtcConfig}; | ||
| 9 | use embassy_time::Timer; | 9 | use embassy_time::Timer; |
| 10 | use {defmt_rtt as _, panic_probe as _}; | 10 | use {defmt_rtt as _, panic_probe as _}; |
| 11 | 11 | ||
diff --git a/examples/stm32f0/src/bin/button_controlled_blink.rs b/examples/stm32f0/src/bin/button_controlled_blink.rs index f232e3290..0b678af01 100644 --- a/examples/stm32f0/src/bin/button_controlled_blink.rs +++ b/examples/stm32f0/src/bin/button_controlled_blink.rs | |||
| @@ -7,9 +7,9 @@ use core::sync::atomic::{AtomicU32, Ordering}; | |||
| 7 | 7 | ||
| 8 | use defmt::info; | 8 | use defmt::info; |
| 9 | use embassy_executor::Spawner; | 9 | use embassy_executor::Spawner; |
| 10 | use embassy_stm32::Peri; | ||
| 10 | use embassy_stm32::exti::ExtiInput; | 11 | use embassy_stm32::exti::ExtiInput; |
| 11 | use embassy_stm32::gpio::{AnyPin, Level, Output, Pull, Speed}; | 12 | use embassy_stm32::gpio::{AnyPin, Level, Output, Pull, Speed}; |
| 12 | use embassy_stm32::Peri; | ||
| 13 | use embassy_time::Timer; | 13 | use embassy_time::Timer; |
| 14 | use {defmt_rtt as _, panic_probe as _}; | 14 | use {defmt_rtt as _, panic_probe as _}; |
| 15 | 15 | ||
diff --git a/examples/stm32f1/src/bin/can.rs b/examples/stm32f1/src/bin/can.rs index ad0c8a5a5..cbe13b206 100644 --- a/examples/stm32f1/src/bin/can.rs +++ b/examples/stm32f1/src/bin/can.rs | |||
| @@ -5,11 +5,11 @@ use defmt::*; | |||
| 5 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| 6 | use embassy_stm32::can::frame::Envelope; | 6 | use embassy_stm32::can::frame::Envelope; |
| 7 | use embassy_stm32::can::{ | 7 | use embassy_stm32::can::{ |
| 8 | filter, Can, Fifo, Frame, Id, Rx0InterruptHandler, Rx1InterruptHandler, SceInterruptHandler, StandardId, | 8 | Can, Fifo, Frame, Id, Rx0InterruptHandler, Rx1InterruptHandler, SceInterruptHandler, StandardId, |
| 9 | TxInterruptHandler, | 9 | TxInterruptHandler, filter, |
| 10 | }; | 10 | }; |
| 11 | use embassy_stm32::peripherals::CAN; | 11 | use embassy_stm32::peripherals::CAN; |
| 12 | use embassy_stm32::{bind_interrupts, Config}; | 12 | use embassy_stm32::{Config, bind_interrupts}; |
| 13 | use static_cell::StaticCell; | 13 | use static_cell::StaticCell; |
| 14 | use {defmt_rtt as _, panic_probe as _}; | 14 | use {defmt_rtt as _, panic_probe as _}; |
| 15 | 15 | ||
diff --git a/examples/stm32f1/src/bin/input_capture.rs b/examples/stm32f1/src/bin/input_capture.rs index b5b26938d..6232d8c17 100644 --- a/examples/stm32f1/src/bin/input_capture.rs +++ b/examples/stm32f1/src/bin/input_capture.rs | |||
| @@ -7,7 +7,7 @@ use embassy_stm32::gpio::{AfioRemap, Level, Output, Pull, Speed}; | |||
| 7 | use embassy_stm32::time::khz; | 7 | use embassy_stm32::time::khz; |
| 8 | use embassy_stm32::timer::input_capture::{CapturePin, InputCapture}; | 8 | use embassy_stm32::timer::input_capture::{CapturePin, InputCapture}; |
| 9 | use embassy_stm32::timer::{self, Channel}; | 9 | use embassy_stm32::timer::{self, Channel}; |
| 10 | use embassy_stm32::{bind_interrupts, peripherals, Peri}; | 10 | use embassy_stm32::{Peri, bind_interrupts, peripherals}; |
| 11 | use embassy_time::Timer; | 11 | use embassy_time::Timer; |
| 12 | use {defmt_rtt as _, panic_probe as _}; | 12 | use {defmt_rtt as _, panic_probe as _}; |
| 13 | 13 | ||
diff --git a/examples/stm32f1/src/bin/pwm_input.rs b/examples/stm32f1/src/bin/pwm_input.rs index 9ae747018..136c5c555 100644 --- a/examples/stm32f1/src/bin/pwm_input.rs +++ b/examples/stm32f1/src/bin/pwm_input.rs | |||
| @@ -6,7 +6,7 @@ use embassy_executor::Spawner; | |||
| 6 | use embassy_stm32::gpio::{AfioRemap, Level, Output, Pull, Speed}; | 6 | use embassy_stm32::gpio::{AfioRemap, Level, Output, Pull, Speed}; |
| 7 | use embassy_stm32::time::khz; | 7 | use embassy_stm32::time::khz; |
| 8 | use embassy_stm32::timer::pwm_input::PwmInput; | 8 | use embassy_stm32::timer::pwm_input::PwmInput; |
| 9 | use embassy_stm32::{bind_interrupts, peripherals, timer, Peri}; | 9 | use embassy_stm32::{Peri, bind_interrupts, peripherals, timer}; |
| 10 | use embassy_time::Timer; | 10 | use embassy_time::Timer; |
| 11 | use {defmt_rtt as _, panic_probe as _}; | 11 | use {defmt_rtt as _, panic_probe as _}; |
| 12 | 12 | ||
diff --git a/examples/stm32f1/src/bin/usb_serial.rs b/examples/stm32f1/src/bin/usb_serial.rs index 77ec307b9..5ff54a521 100644 --- a/examples/stm32f1/src/bin/usb_serial.rs +++ b/examples/stm32f1/src/bin/usb_serial.rs | |||
| @@ -7,11 +7,11 @@ use embassy_futures::join::join; | |||
| 7 | use embassy_stm32::gpio::{Level, Output, Speed}; | 7 | use embassy_stm32::gpio::{Level, Output, Speed}; |
| 8 | use embassy_stm32::time::Hertz; | 8 | use embassy_stm32::time::Hertz; |
| 9 | use embassy_stm32::usb::{Driver, Instance}; | 9 | use embassy_stm32::usb::{Driver, Instance}; |
| 10 | use embassy_stm32::{bind_interrupts, peripherals, usb, Config}; | 10 | use embassy_stm32::{Config, bind_interrupts, peripherals, usb}; |
| 11 | use embassy_time::Timer; | 11 | use embassy_time::Timer; |
| 12 | use embassy_usb::Builder; | ||
| 12 | use embassy_usb::class::cdc_acm::{CdcAcmClass, State}; | 13 | use embassy_usb::class::cdc_acm::{CdcAcmClass, State}; |
| 13 | use embassy_usb::driver::EndpointError; | 14 | use embassy_usb::driver::EndpointError; |
| 14 | use embassy_usb::Builder; | ||
| 15 | use {defmt_rtt as _, panic_probe as _}; | 15 | use {defmt_rtt as _, panic_probe as _}; |
| 16 | 16 | ||
| 17 | bind_interrupts!(struct Irqs { | 17 | bind_interrupts!(struct Irqs { |
diff --git a/examples/stm32f2/src/bin/pll.rs b/examples/stm32f2/src/bin/pll.rs index e39e2daec..4418bf502 100644 --- a/examples/stm32f2/src/bin/pll.rs +++ b/examples/stm32f2/src/bin/pll.rs | |||
| @@ -3,8 +3,8 @@ | |||
| 3 | 3 | ||
| 4 | use defmt::*; | 4 | use defmt::*; |
| 5 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| 6 | use embassy_stm32::time::Hertz; | ||
| 7 | use embassy_stm32::Config; | 6 | use embassy_stm32::Config; |
| 7 | use embassy_stm32::time::Hertz; | ||
| 8 | use embassy_time::Timer; | 8 | use embassy_time::Timer; |
| 9 | use {defmt_rtt as _, panic_probe as _}; | 9 | use {defmt_rtt as _, panic_probe as _}; |
| 10 | 10 | ||
diff --git a/examples/stm32f3/src/bin/button_events.rs b/examples/stm32f3/src/bin/button_events.rs index a54d03212..99957a641 100644 --- a/examples/stm32f3/src/bin/button_events.rs +++ b/examples/stm32f3/src/bin/button_events.rs | |||
| @@ -15,7 +15,7 @@ use embassy_stm32::exti::ExtiInput; | |||
| 15 | use embassy_stm32::gpio::{Level, Output, Pull, Speed}; | 15 | use embassy_stm32::gpio::{Level, Output, Pull, Speed}; |
| 16 | use embassy_sync::blocking_mutex::raw::ThreadModeRawMutex; | 16 | use embassy_sync::blocking_mutex::raw::ThreadModeRawMutex; |
| 17 | use embassy_sync::channel::Channel; | 17 | use embassy_sync::channel::Channel; |
| 18 | use embassy_time::{with_timeout, Duration, Timer}; | 18 | use embassy_time::{Duration, Timer, with_timeout}; |
| 19 | use {defmt_rtt as _, panic_probe as _}; | 19 | use {defmt_rtt as _, panic_probe as _}; |
| 20 | 20 | ||
| 21 | struct Leds<'a> { | 21 | struct Leds<'a> { |
diff --git a/examples/stm32f3/src/bin/usb_serial.rs b/examples/stm32f3/src/bin/usb_serial.rs index 5760f2c1c..58b801c36 100644 --- a/examples/stm32f3/src/bin/usb_serial.rs +++ b/examples/stm32f3/src/bin/usb_serial.rs | |||
| @@ -7,11 +7,11 @@ use embassy_futures::join::join; | |||
| 7 | use embassy_stm32::gpio::{Level, Output, Speed}; | 7 | use embassy_stm32::gpio::{Level, Output, Speed}; |
| 8 | use embassy_stm32::time::mhz; | 8 | use embassy_stm32::time::mhz; |
| 9 | use embassy_stm32::usb::{Driver, Instance}; | 9 | use embassy_stm32::usb::{Driver, Instance}; |
| 10 | use embassy_stm32::{bind_interrupts, peripherals, usb, Config}; | 10 | use embassy_stm32::{Config, bind_interrupts, peripherals, usb}; |
| 11 | use embassy_time::Timer; | 11 | use embassy_time::Timer; |
| 12 | use embassy_usb::Builder; | ||
| 12 | use embassy_usb::class::cdc_acm::{CdcAcmClass, State}; | 13 | use embassy_usb::class::cdc_acm::{CdcAcmClass, State}; |
| 13 | use embassy_usb::driver::EndpointError; | 14 | use embassy_usb::driver::EndpointError; |
| 14 | use embassy_usb::Builder; | ||
| 15 | use {defmt_rtt as _, panic_probe as _}; | 15 | use {defmt_rtt as _, panic_probe as _}; |
| 16 | 16 | ||
| 17 | bind_interrupts!(struct Irqs { | 17 | bind_interrupts!(struct Irqs { |
diff --git a/examples/stm32f334/src/bin/adc.rs b/examples/stm32f334/src/bin/adc.rs index 0528a9637..a993b00ca 100644 --- a/examples/stm32f334/src/bin/adc.rs +++ b/examples/stm32f334/src/bin/adc.rs | |||
| @@ -6,7 +6,7 @@ use embassy_executor::Spawner; | |||
| 6 | use embassy_stm32::adc::{Adc, SampleTime}; | 6 | use embassy_stm32::adc::{Adc, SampleTime}; |
| 7 | use embassy_stm32::peripherals::ADC1; | 7 | use embassy_stm32::peripherals::ADC1; |
| 8 | use embassy_stm32::time::mhz; | 8 | use embassy_stm32::time::mhz; |
| 9 | use embassy_stm32::{adc, bind_interrupts, Config}; | 9 | use embassy_stm32::{Config, adc, bind_interrupts}; |
| 10 | use embassy_time::Timer; | 10 | use embassy_time::Timer; |
| 11 | use {defmt_rtt as _, panic_probe as _}; | 11 | use {defmt_rtt as _, panic_probe as _}; |
| 12 | 12 | ||
diff --git a/examples/stm32f334/src/bin/opamp.rs b/examples/stm32f334/src/bin/opamp.rs index c344935d7..3e621f2a1 100644 --- a/examples/stm32f334/src/bin/opamp.rs +++ b/examples/stm32f334/src/bin/opamp.rs | |||
| @@ -7,7 +7,7 @@ use embassy_stm32::adc::{Adc, SampleTime}; | |||
| 7 | use embassy_stm32::opamp::OpAmp; | 7 | use embassy_stm32::opamp::OpAmp; |
| 8 | use embassy_stm32::peripherals::ADC2; | 8 | use embassy_stm32::peripherals::ADC2; |
| 9 | use embassy_stm32::time::mhz; | 9 | use embassy_stm32::time::mhz; |
| 10 | use embassy_stm32::{adc, bind_interrupts, Config}; | 10 | use embassy_stm32::{Config, adc, bind_interrupts}; |
| 11 | use embassy_time::Timer; | 11 | use embassy_time::Timer; |
| 12 | use {defmt_rtt as _, panic_probe as _}; | 12 | use {defmt_rtt as _, panic_probe as _}; |
| 13 | 13 | ||
diff --git a/examples/stm32f334/src/bin/pwm.rs b/examples/stm32f334/src/bin/pwm.rs index 2b0686121..68a61ae22 100644 --- a/examples/stm32f334/src/bin/pwm.rs +++ b/examples/stm32f334/src/bin/pwm.rs | |||
| @@ -3,9 +3,9 @@ | |||
| 3 | 3 | ||
| 4 | use defmt::*; | 4 | use defmt::*; |
| 5 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| 6 | use embassy_stm32::Config; | ||
| 6 | use embassy_stm32::hrtim::*; | 7 | use embassy_stm32::hrtim::*; |
| 7 | use embassy_stm32::time::{khz, mhz}; | 8 | use embassy_stm32::time::{khz, mhz}; |
| 8 | use embassy_stm32::Config; | ||
| 9 | use embassy_time::Timer; | 9 | use embassy_time::Timer; |
| 10 | use {defmt_rtt as _, panic_probe as _}; | 10 | use {defmt_rtt as _, panic_probe as _}; |
| 11 | 11 | ||
diff --git a/examples/stm32f4/src/bin/adc_dma.rs b/examples/stm32f4/src/bin/adc_dma.rs index 2ec48640e..c24f01753 100644 --- a/examples/stm32f4/src/bin/adc_dma.rs +++ b/examples/stm32f4/src/bin/adc_dma.rs | |||
| @@ -3,8 +3,8 @@ | |||
| 3 | use cortex_m::singleton; | 3 | use cortex_m::singleton; |
| 4 | use defmt::*; | 4 | use defmt::*; |
| 5 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| 6 | use embassy_stm32::adc::{Adc, RingBufferedAdc, SampleTime, Sequence}; | ||
| 7 | use embassy_stm32::Peripherals; | 6 | use embassy_stm32::Peripherals; |
| 7 | use embassy_stm32::adc::{Adc, RingBufferedAdc, SampleTime, Sequence}; | ||
| 8 | use embassy_time::Instant; | 8 | use embassy_time::Instant; |
| 9 | use {defmt_rtt as _, panic_probe as _}; | 9 | use {defmt_rtt as _, panic_probe as _}; |
| 10 | 10 | ||
diff --git a/examples/stm32f4/src/bin/eth.rs b/examples/stm32f4/src/bin/eth.rs index f41a60529..2d72b6b0b 100644 --- a/examples/stm32f4/src/bin/eth.rs +++ b/examples/stm32f4/src/bin/eth.rs | |||
| @@ -9,7 +9,7 @@ use embassy_stm32::eth::{Ethernet, GenericPhy, PacketQueue}; | |||
| 9 | use embassy_stm32::peripherals::ETH; | 9 | use embassy_stm32::peripherals::ETH; |
| 10 | use embassy_stm32::rng::Rng; | 10 | use embassy_stm32::rng::Rng; |
| 11 | use embassy_stm32::time::Hertz; | 11 | use embassy_stm32::time::Hertz; |
| 12 | use embassy_stm32::{bind_interrupts, eth, peripherals, rng, Config}; | 12 | use embassy_stm32::{Config, bind_interrupts, eth, peripherals, rng}; |
| 13 | use embassy_time::Timer; | 13 | use embassy_time::Timer; |
| 14 | use embedded_io_async::Write; | 14 | use embedded_io_async::Write; |
| 15 | use static_cell::StaticCell; | 15 | use static_cell::StaticCell; |
diff --git a/examples/stm32f4/src/bin/eth_compliance_test.rs b/examples/stm32f4/src/bin/eth_compliance_test.rs index 52f9d57f6..734a14c2c 100644 --- a/examples/stm32f4/src/bin/eth_compliance_test.rs +++ b/examples/stm32f4/src/bin/eth_compliance_test.rs | |||
| @@ -5,7 +5,7 @@ use defmt::*; | |||
| 5 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| 6 | use embassy_stm32::eth::{Ethernet, GenericPhy, PacketQueue, StationManagement}; | 6 | use embassy_stm32::eth::{Ethernet, GenericPhy, PacketQueue, StationManagement}; |
| 7 | use embassy_stm32::time::Hertz; | 7 | use embassy_stm32::time::Hertz; |
| 8 | use embassy_stm32::{bind_interrupts, eth, peripherals, rng, Config}; | 8 | use embassy_stm32::{Config, bind_interrupts, eth, peripherals, rng}; |
| 9 | use embassy_time::Timer; | 9 | use embassy_time::Timer; |
| 10 | use static_cell::StaticCell; | 10 | use static_cell::StaticCell; |
| 11 | use {defmt_rtt as _, panic_probe as _}; | 11 | use {defmt_rtt as _, panic_probe as _}; |
diff --git a/examples/stm32f4/src/bin/eth_w5500.rs b/examples/stm32f4/src/bin/eth_w5500.rs index 7ce3bfe75..cccf20949 100644 --- a/examples/stm32f4/src/bin/eth_w5500.rs +++ b/examples/stm32f4/src/bin/eth_w5500.rs | |||
| @@ -13,7 +13,7 @@ use embassy_stm32::mode::Async; | |||
| 13 | use embassy_stm32::rng::Rng; | 13 | use embassy_stm32::rng::Rng; |
| 14 | use embassy_stm32::spi::Spi; | 14 | use embassy_stm32::spi::Spi; |
| 15 | use embassy_stm32::time::Hertz; | 15 | use embassy_stm32::time::Hertz; |
| 16 | use embassy_stm32::{bind_interrupts, peripherals, rng, spi, Config}; | 16 | use embassy_stm32::{Config, bind_interrupts, peripherals, rng, spi}; |
| 17 | use embassy_time::{Delay, Timer}; | 17 | use embassy_time::{Delay, Timer}; |
| 18 | use embedded_hal_bus::spi::ExclusiveDevice; | 18 | use embedded_hal_bus::spi::ExclusiveDevice; |
| 19 | use embedded_io_async::Write; | 19 | use embedded_io_async::Write; |
diff --git a/examples/stm32f4/src/bin/flash_async.rs b/examples/stm32f4/src/bin/flash_async.rs index 2feb9de09..14f029747 100644 --- a/examples/stm32f4/src/bin/flash_async.rs +++ b/examples/stm32f4/src/bin/flash_async.rs | |||
| @@ -5,7 +5,7 @@ use defmt::{info, unwrap}; | |||
| 5 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| 6 | use embassy_stm32::flash::{Flash, InterruptHandler}; | 6 | use embassy_stm32::flash::{Flash, InterruptHandler}; |
| 7 | use embassy_stm32::gpio::{AnyPin, Level, Output, Speed}; | 7 | use embassy_stm32::gpio::{AnyPin, Level, Output, Speed}; |
| 8 | use embassy_stm32::{bind_interrupts, Peri}; | 8 | use embassy_stm32::{Peri, bind_interrupts}; |
| 9 | use embassy_time::Timer; | 9 | use embassy_time::Timer; |
| 10 | use {defmt_rtt as _, panic_probe as _}; | 10 | use {defmt_rtt as _, panic_probe as _}; |
| 11 | 11 | ||
diff --git a/examples/stm32f4/src/bin/input_capture.rs b/examples/stm32f4/src/bin/input_capture.rs index 9998c4733..3ff96584d 100644 --- a/examples/stm32f4/src/bin/input_capture.rs +++ b/examples/stm32f4/src/bin/input_capture.rs | |||
| @@ -7,7 +7,7 @@ use embassy_stm32::gpio::{Level, Output, Pull, Speed}; | |||
| 7 | use embassy_stm32::time::khz; | 7 | use embassy_stm32::time::khz; |
| 8 | use embassy_stm32::timer::input_capture::{CapturePin, InputCapture}; | 8 | use embassy_stm32::timer::input_capture::{CapturePin, InputCapture}; |
| 9 | use embassy_stm32::timer::{self, Channel}; | 9 | use embassy_stm32::timer::{self, Channel}; |
| 10 | use embassy_stm32::{bind_interrupts, peripherals, Peri}; | 10 | use embassy_stm32::{Peri, bind_interrupts, peripherals}; |
| 11 | use embassy_time::Timer; | 11 | use embassy_time::Timer; |
| 12 | use {defmt_rtt as _, panic_probe as _}; | 12 | use {defmt_rtt as _, panic_probe as _}; |
| 13 | 13 | ||
diff --git a/examples/stm32f4/src/bin/pwm_complementary.rs b/examples/stm32f4/src/bin/pwm_complementary.rs index c981f1a76..50008a37b 100644 --- a/examples/stm32f4/src/bin/pwm_complementary.rs +++ b/examples/stm32f4/src/bin/pwm_complementary.rs | |||
| @@ -5,9 +5,9 @@ use defmt::*; | |||
| 5 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| 6 | use embassy_stm32::gpio::OutputType; | 6 | use embassy_stm32::gpio::OutputType; |
| 7 | use embassy_stm32::time::khz; | 7 | use embassy_stm32::time::khz; |
| 8 | use embassy_stm32::timer::Channel; | ||
| 8 | use embassy_stm32::timer::complementary_pwm::{ComplementaryPwm, ComplementaryPwmPin}; | 9 | use embassy_stm32::timer::complementary_pwm::{ComplementaryPwm, ComplementaryPwmPin}; |
| 9 | use embassy_stm32::timer::simple_pwm::PwmPin; | 10 | use embassy_stm32::timer::simple_pwm::PwmPin; |
| 10 | use embassy_stm32::timer::Channel; | ||
| 11 | use embassy_time::Timer; | 11 | use embassy_time::Timer; |
| 12 | use {defmt_rtt as _, panic_probe as _}; | 12 | use {defmt_rtt as _, panic_probe as _}; |
| 13 | 13 | ||
diff --git a/examples/stm32f4/src/bin/pwm_input.rs b/examples/stm32f4/src/bin/pwm_input.rs index e8bfa524f..d8ea56a34 100644 --- a/examples/stm32f4/src/bin/pwm_input.rs +++ b/examples/stm32f4/src/bin/pwm_input.rs | |||
| @@ -6,7 +6,7 @@ use embassy_executor::Spawner; | |||
| 6 | use embassy_stm32::gpio::{Level, Output, Pull, Speed}; | 6 | use embassy_stm32::gpio::{Level, Output, Pull, Speed}; |
| 7 | use embassy_stm32::time::khz; | 7 | use embassy_stm32::time::khz; |
| 8 | use embassy_stm32::timer::pwm_input::PwmInput; | 8 | use embassy_stm32::timer::pwm_input::PwmInput; |
| 9 | use embassy_stm32::{bind_interrupts, peripherals, timer, Peri}; | 9 | use embassy_stm32::{Peri, bind_interrupts, peripherals, timer}; |
| 10 | use embassy_time::Timer; | 10 | use embassy_time::Timer; |
| 11 | use {defmt_rtt as _, panic_probe as _}; | 11 | use {defmt_rtt as _, panic_probe as _}; |
| 12 | 12 | ||
diff --git a/examples/stm32f4/src/bin/rtc.rs b/examples/stm32f4/src/bin/rtc.rs index 82d8a37ba..feb27f6d9 100644 --- a/examples/stm32f4/src/bin/rtc.rs +++ b/examples/stm32f4/src/bin/rtc.rs | |||
| @@ -4,8 +4,8 @@ | |||
| 4 | use chrono::{NaiveDate, NaiveDateTime}; | 4 | use chrono::{NaiveDate, NaiveDateTime}; |
| 5 | use defmt::*; | 5 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 6 | use embassy_executor::Spawner; |
| 7 | use embassy_stm32::rtc::{Rtc, RtcConfig}; | ||
| 8 | use embassy_stm32::Config; | 7 | use embassy_stm32::Config; |
| 8 | use embassy_stm32::rtc::{Rtc, RtcConfig}; | ||
| 9 | use embassy_time::Timer; | 9 | use embassy_time::Timer; |
| 10 | use {defmt_rtt as _, panic_probe as _}; | 10 | use {defmt_rtt as _, panic_probe as _}; |
| 11 | 11 | ||
diff --git a/examples/stm32f4/src/bin/sdmmc.rs b/examples/stm32f4/src/bin/sdmmc.rs index e97b63925..fe0f887bf 100644 --- a/examples/stm32f4/src/bin/sdmmc.rs +++ b/examples/stm32f4/src/bin/sdmmc.rs | |||
| @@ -4,8 +4,8 @@ | |||
| 4 | use defmt::*; | 4 | use defmt::*; |
| 5 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| 6 | use embassy_stm32::sdmmc::{DataBlock, Sdmmc}; | 6 | use embassy_stm32::sdmmc::{DataBlock, Sdmmc}; |
| 7 | use embassy_stm32::time::{mhz, Hertz}; | 7 | use embassy_stm32::time::{Hertz, mhz}; |
| 8 | use embassy_stm32::{bind_interrupts, peripherals, sdmmc, Config}; | 8 | use embassy_stm32::{Config, bind_interrupts, peripherals, sdmmc}; |
| 9 | use {defmt_rtt as _, panic_probe as _}; | 9 | use {defmt_rtt as _, panic_probe as _}; |
| 10 | 10 | ||
| 11 | /// This is a safeguard to not overwrite any data on the SD card. | 11 | /// This is a safeguard to not overwrite any data on the SD card. |
diff --git a/examples/stm32f4/src/bin/usb_ethernet.rs b/examples/stm32f4/src/bin/usb_ethernet.rs index 7abbe8719..a5e625edd 100644 --- a/examples/stm32f4/src/bin/usb_ethernet.rs +++ b/examples/stm32f4/src/bin/usb_ethernet.rs | |||
| @@ -3,12 +3,12 @@ | |||
| 3 | 3 | ||
| 4 | use defmt::*; | 4 | use defmt::*; |
| 5 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| 6 | use embassy_net::tcp::TcpSocket; | ||
| 7 | use embassy_net::StackResources; | 6 | use embassy_net::StackResources; |
| 7 | use embassy_net::tcp::TcpSocket; | ||
| 8 | use embassy_stm32::rng::{self, Rng}; | 8 | use embassy_stm32::rng::{self, Rng}; |
| 9 | use embassy_stm32::time::Hertz; | 9 | use embassy_stm32::time::Hertz; |
| 10 | use embassy_stm32::usb::Driver; | 10 | use embassy_stm32::usb::Driver; |
| 11 | use embassy_stm32::{bind_interrupts, peripherals, usb, Config}; | 11 | use embassy_stm32::{Config, bind_interrupts, peripherals, usb}; |
| 12 | use embassy_usb::class::cdc_ncm::embassy_net::{Device, Runner, State as NetState}; | 12 | use embassy_usb::class::cdc_ncm::embassy_net::{Device, Runner, State as NetState}; |
| 13 | use embassy_usb::class::cdc_ncm::{CdcNcmClass, State}; | 13 | use embassy_usb::class::cdc_ncm::{CdcNcmClass, State}; |
| 14 | use embassy_usb::{Builder, UsbDevice}; | 14 | use embassy_usb::{Builder, UsbDevice}; |
diff --git a/examples/stm32f4/src/bin/usb_hid_keyboard.rs b/examples/stm32f4/src/bin/usb_hid_keyboard.rs index d6b4a9bc9..a3afb887c 100644 --- a/examples/stm32f4/src/bin/usb_hid_keyboard.rs +++ b/examples/stm32f4/src/bin/usb_hid_keyboard.rs | |||
| @@ -10,7 +10,7 @@ use embassy_stm32::exti::ExtiInput; | |||
| 10 | use embassy_stm32::gpio::Pull; | 10 | use embassy_stm32::gpio::Pull; |
| 11 | use embassy_stm32::time::Hertz; | 11 | use embassy_stm32::time::Hertz; |
| 12 | use embassy_stm32::usb::Driver; | 12 | use embassy_stm32::usb::Driver; |
| 13 | use embassy_stm32::{bind_interrupts, peripherals, usb, Config}; | 13 | use embassy_stm32::{Config, bind_interrupts, peripherals, usb}; |
| 14 | use embassy_usb::class::hid::{HidReaderWriter, ReportId, RequestHandler, State}; | 14 | use embassy_usb::class::hid::{HidReaderWriter, ReportId, RequestHandler, State}; |
| 15 | use embassy_usb::control::OutResponse; | 15 | use embassy_usb::control::OutResponse; |
| 16 | use embassy_usb::{Builder, Handler}; | 16 | use embassy_usb::{Builder, Handler}; |
diff --git a/examples/stm32f4/src/bin/usb_hid_mouse.rs b/examples/stm32f4/src/bin/usb_hid_mouse.rs index badb65e98..162a035f2 100644 --- a/examples/stm32f4/src/bin/usb_hid_mouse.rs +++ b/examples/stm32f4/src/bin/usb_hid_mouse.rs | |||
| @@ -6,11 +6,11 @@ use embassy_executor::Spawner; | |||
| 6 | use embassy_futures::join::join; | 6 | use embassy_futures::join::join; |
| 7 | use embassy_stm32::time::Hertz; | 7 | use embassy_stm32::time::Hertz; |
| 8 | use embassy_stm32::usb::Driver; | 8 | use embassy_stm32::usb::Driver; |
| 9 | use embassy_stm32::{bind_interrupts, peripherals, usb, Config}; | 9 | use embassy_stm32::{Config, bind_interrupts, peripherals, usb}; |
| 10 | use embassy_time::Timer; | 10 | use embassy_time::Timer; |
| 11 | use embassy_usb::Builder; | ||
| 11 | use embassy_usb::class::hid::{HidWriter, ReportId, RequestHandler, State}; | 12 | use embassy_usb::class::hid::{HidWriter, ReportId, RequestHandler, State}; |
| 12 | use embassy_usb::control::OutResponse; | 13 | use embassy_usb::control::OutResponse; |
| 13 | use embassy_usb::Builder; | ||
| 14 | use usbd_hid::descriptor::{MouseReport, SerializedDescriptor}; | 14 | use usbd_hid::descriptor::{MouseReport, SerializedDescriptor}; |
| 15 | use {defmt_rtt as _, panic_probe as _}; | 15 | use {defmt_rtt as _, panic_probe as _}; |
| 16 | 16 | ||
diff --git a/examples/stm32f4/src/bin/usb_raw.rs b/examples/stm32f4/src/bin/usb_raw.rs index bbbcc082b..511f0b281 100644 --- a/examples/stm32f4/src/bin/usb_raw.rs +++ b/examples/stm32f4/src/bin/usb_raw.rs | |||
| @@ -53,7 +53,7 @@ use defmt::*; | |||
| 53 | use embassy_executor::Spawner; | 53 | use embassy_executor::Spawner; |
| 54 | use embassy_stm32::time::Hertz; | 54 | use embassy_stm32::time::Hertz; |
| 55 | use embassy_stm32::usb::Driver; | 55 | use embassy_stm32::usb::Driver; |
| 56 | use embassy_stm32::{bind_interrupts, peripherals, usb, Config}; | 56 | use embassy_stm32::{Config, bind_interrupts, peripherals, usb}; |
| 57 | use embassy_usb::control::{InResponse, OutResponse, Recipient, Request, RequestType}; | 57 | use embassy_usb::control::{InResponse, OutResponse, Recipient, Request, RequestType}; |
| 58 | use embassy_usb::msos::{self, windows_version}; | 58 | use embassy_usb::msos::{self, windows_version}; |
| 59 | use embassy_usb::types::InterfaceNumber; | 59 | use embassy_usb::types::InterfaceNumber; |
diff --git a/examples/stm32f4/src/bin/usb_serial.rs b/examples/stm32f4/src/bin/usb_serial.rs index e62b2d8d6..2e81e0a59 100644 --- a/examples/stm32f4/src/bin/usb_serial.rs +++ b/examples/stm32f4/src/bin/usb_serial.rs | |||
| @@ -6,10 +6,10 @@ use embassy_executor::Spawner; | |||
| 6 | use embassy_futures::join::join; | 6 | use embassy_futures::join::join; |
| 7 | use embassy_stm32::time::Hertz; | 7 | use embassy_stm32::time::Hertz; |
| 8 | use embassy_stm32::usb::{Driver, Instance}; | 8 | use embassy_stm32::usb::{Driver, Instance}; |
| 9 | use embassy_stm32::{bind_interrupts, peripherals, usb, Config}; | 9 | use embassy_stm32::{Config, bind_interrupts, peripherals, usb}; |
| 10 | use embassy_usb::Builder; | ||
| 10 | use embassy_usb::class::cdc_acm::{CdcAcmClass, State}; | 11 | use embassy_usb::class::cdc_acm::{CdcAcmClass, State}; |
| 11 | use embassy_usb::driver::EndpointError; | 12 | use embassy_usb::driver::EndpointError; |
| 12 | use embassy_usb::Builder; | ||
| 13 | use {defmt_rtt as _, panic_probe as _}; | 13 | use {defmt_rtt as _, panic_probe as _}; |
| 14 | 14 | ||
| 15 | bind_interrupts!(struct Irqs { | 15 | bind_interrupts!(struct Irqs { |
diff --git a/examples/stm32f4/src/bin/usb_uac_speaker.rs b/examples/stm32f4/src/bin/usb_uac_speaker.rs index 79bd2d914..b92f4531e 100644 --- a/examples/stm32f4/src/bin/usb_uac_speaker.rs +++ b/examples/stm32f4/src/bin/usb_uac_speaker.rs | |||
| @@ -6,9 +6,9 @@ use core::cell::{Cell, RefCell}; | |||
| 6 | use defmt::{panic, *}; | 6 | use defmt::{panic, *}; |
| 7 | use embassy_executor::Spawner; | 7 | use embassy_executor::Spawner; |
| 8 | use embassy_stm32::time::Hertz; | 8 | use embassy_stm32::time::Hertz; |
| 9 | use embassy_stm32::{bind_interrupts, interrupt, peripherals, timer, usb, Config}; | 9 | use embassy_stm32::{Config, bind_interrupts, interrupt, peripherals, timer, usb}; |
| 10 | use embassy_sync::blocking_mutex::raw::{CriticalSectionRawMutex, NoopRawMutex}; | ||
| 11 | use embassy_sync::blocking_mutex::Mutex; | 10 | use embassy_sync::blocking_mutex::Mutex; |
| 11 | use embassy_sync::blocking_mutex::raw::{CriticalSectionRawMutex, NoopRawMutex}; | ||
| 12 | use embassy_sync::signal::Signal; | 12 | use embassy_sync::signal::Signal; |
| 13 | use embassy_sync::zerocopy_channel; | 13 | use embassy_sync::zerocopy_channel; |
| 14 | use embassy_usb::class::uac1; | 14 | use embassy_usb::class::uac1; |
diff --git a/examples/stm32f4/src/bin/ws2812_pwm.rs b/examples/stm32f4/src/bin/ws2812_pwm.rs index 5153e1cfd..ccfd0661e 100644 --- a/examples/stm32f4/src/bin/ws2812_pwm.rs +++ b/examples/stm32f4/src/bin/ws2812_pwm.rs | |||
| @@ -15,9 +15,9 @@ | |||
| 15 | use embassy_executor::Spawner; | 15 | use embassy_executor::Spawner; |
| 16 | use embassy_stm32::gpio::OutputType; | 16 | use embassy_stm32::gpio::OutputType; |
| 17 | use embassy_stm32::time::khz; | 17 | use embassy_stm32::time::khz; |
| 18 | use embassy_stm32::timer::Channel; | ||
| 18 | use embassy_stm32::timer::low_level::CountingMode; | 19 | use embassy_stm32::timer::low_level::CountingMode; |
| 19 | use embassy_stm32::timer::simple_pwm::{PwmPin, SimplePwm}; | 20 | use embassy_stm32::timer::simple_pwm::{PwmPin, SimplePwm}; |
| 20 | use embassy_stm32::timer::Channel; | ||
| 21 | use embassy_time::{Duration, Ticker, Timer}; | 21 | use embassy_time::{Duration, Ticker, Timer}; |
| 22 | use {defmt_rtt as _, panic_probe as _}; | 22 | use {defmt_rtt as _, panic_probe as _}; |
| 23 | 23 | ||
diff --git a/examples/stm32f469/src/bin/dsi_bsp.rs b/examples/stm32f469/src/bin/dsi_bsp.rs index 3a24d5dcf..d659291ff 100644 --- a/examples/stm32f469/src/bin/dsi_bsp.rs +++ b/examples/stm32f469/src/bin/dsi_bsp.rs | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | 3 | ||
| 4 | use defmt::*; | 4 | use defmt::*; |
| 5 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| 6 | use embassy_stm32::dsihost::{blocking_delay_ms, DsiHost, PacketType}; | 6 | use embassy_stm32::dsihost::{DsiHost, PacketType, blocking_delay_ms}; |
| 7 | use embassy_stm32::gpio::{Level, Output, Speed}; | 7 | use embassy_stm32::gpio::{Level, Output, Speed}; |
| 8 | use embassy_stm32::ltdc::Ltdc; | 8 | use embassy_stm32::ltdc::Ltdc; |
| 9 | use embassy_stm32::pac::dsihost::regs::{Ier0, Ier1}; | 9 | use embassy_stm32::pac::dsihost::regs::{Ier0, Ier1}; |
| @@ -211,7 +211,7 @@ async fn main(_spawner: Spawner) { | |||
| 211 | const HORIZONTAL_SYNC_ACTIVE: u16 = 4; // ((HSA as u32 * LANE_BYTE_CLK_K_HZ as u32 ) / LCD_CLOCK as u32 ) as u16; | 211 | const HORIZONTAL_SYNC_ACTIVE: u16 = 4; // ((HSA as u32 * LANE_BYTE_CLK_K_HZ as u32 ) / LCD_CLOCK as u32 ) as u16; |
| 212 | const HORIZONTAL_BACK_PORCH: u16 = 77; //((HBP as u32 * LANE_BYTE_CLK_K_HZ as u32 ) / LCD_CLOCK as u32) as u16; | 212 | const HORIZONTAL_BACK_PORCH: u16 = 77; //((HBP as u32 * LANE_BYTE_CLK_K_HZ as u32 ) / LCD_CLOCK as u32) as u16; |
| 213 | const HORIZONTAL_LINE: u16 = 1982; //(((HACT + HSA + HBP + HFP) as u32 * LANE_BYTE_CLK_K_HZ as u32 ) / LCD_CLOCK as u32 ) as u16; /* Value depending on display orientation choice portrait/landscape */ | 213 | const HORIZONTAL_LINE: u16 = 1982; //(((HACT + HSA + HBP + HFP) as u32 * LANE_BYTE_CLK_K_HZ as u32 ) / LCD_CLOCK as u32 ) as u16; /* Value depending on display orientation choice portrait/landscape */ |
| 214 | // FIXME: Make depend on orientation | 214 | // FIXME: Make depend on orientation |
| 215 | const VERTICAL_SYNC_ACTIVE: u16 = VSA; | 215 | const VERTICAL_SYNC_ACTIVE: u16 = VSA; |
| 216 | const VERTICAL_BACK_PORCH: u16 = VBP; | 216 | const VERTICAL_BACK_PORCH: u16 = VBP; |
| 217 | const VERTICAL_FRONT_PORCH: u16 = VFP; | 217 | const VERTICAL_FRONT_PORCH: u16 = VFP; |
| @@ -658,7 +658,7 @@ const NT35510_RASET_LANDSCAPE: &[u8] = &[NT35510_CMD_RASET, 0x00, 0x00, 0x01, 0x | |||
| 658 | 658 | ||
| 659 | const NT35510_WRITES_26: &[u8] = &[NT35510_CMD_TEEON, 0x00]; // Tear on | 659 | const NT35510_WRITES_26: &[u8] = &[NT35510_CMD_TEEON, 0x00]; // Tear on |
| 660 | const NT35510_WRITES_27: &[u8] = &[NT35510_CMD_SLPOUT, 0x00]; // Sleep out | 660 | const NT35510_WRITES_27: &[u8] = &[NT35510_CMD_SLPOUT, 0x00]; // Sleep out |
| 661 | // 28,29 missing | 661 | // 28,29 missing |
| 662 | const NT35510_WRITES_30: &[u8] = &[NT35510_CMD_DISPON, 0x00]; // Display on | 662 | const NT35510_WRITES_30: &[u8] = &[NT35510_CMD_DISPON, 0x00]; // Display on |
| 663 | 663 | ||
| 664 | const NT35510_WRITES_31: &[u8] = &[NT35510_CMD_WRDISBV, 0x7F]; | 664 | const NT35510_WRITES_31: &[u8] = &[NT35510_CMD_WRDISBV, 0x7F]; |
diff --git a/examples/stm32f7/src/bin/can.rs b/examples/stm32f7/src/bin/can.rs index 9a91ac814..2f3f6db84 100644 --- a/examples/stm32f7/src/bin/can.rs +++ b/examples/stm32f7/src/bin/can.rs | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | 3 | ||
| 4 | use core::num::{NonZeroU16, NonZeroU8}; | 4 | use core::num::{NonZeroU8, NonZeroU16}; |
| 5 | 5 | ||
| 6 | use defmt::*; | 6 | use defmt::*; |
| 7 | use embassy_executor::Spawner; | 7 | use embassy_executor::Spawner; |
diff --git a/examples/stm32f7/src/bin/cryp.rs b/examples/stm32f7/src/bin/cryp.rs index a31e9b4f2..9ccef0b82 100644 --- a/examples/stm32f7/src/bin/cryp.rs +++ b/examples/stm32f7/src/bin/cryp.rs | |||
| @@ -1,13 +1,13 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | 3 | ||
| 4 | use aes_gcm::Aes128Gcm; | ||
| 4 | use aes_gcm::aead::heapless::Vec; | 5 | use aes_gcm::aead::heapless::Vec; |
| 5 | use aes_gcm::aead::{AeadInPlace, KeyInit}; | 6 | use aes_gcm::aead::{AeadInPlace, KeyInit}; |
| 6 | use aes_gcm::Aes128Gcm; | ||
| 7 | use defmt::info; | 7 | use defmt::info; |
| 8 | use embassy_executor::Spawner; | 8 | use embassy_executor::Spawner; |
| 9 | use embassy_stm32::cryp::{self, *}; | 9 | use embassy_stm32::cryp::{self, *}; |
| 10 | use embassy_stm32::{bind_interrupts, peripherals, Config}; | 10 | use embassy_stm32::{Config, bind_interrupts, peripherals}; |
| 11 | use embassy_time::Instant; | 11 | use embassy_time::Instant; |
| 12 | use {defmt_rtt as _, panic_probe as _}; | 12 | use {defmt_rtt as _, panic_probe as _}; |
| 13 | 13 | ||
diff --git a/examples/stm32f7/src/bin/eth.rs b/examples/stm32f7/src/bin/eth.rs index b13b7bdda..f8a129239 100644 --- a/examples/stm32f7/src/bin/eth.rs +++ b/examples/stm32f7/src/bin/eth.rs | |||
| @@ -9,7 +9,7 @@ use embassy_stm32::eth::{Ethernet, GenericPhy, PacketQueue}; | |||
| 9 | use embassy_stm32::peripherals::ETH; | 9 | use embassy_stm32::peripherals::ETH; |
| 10 | use embassy_stm32::rng::Rng; | 10 | use embassy_stm32::rng::Rng; |
| 11 | use embassy_stm32::time::Hertz; | 11 | use embassy_stm32::time::Hertz; |
| 12 | use embassy_stm32::{bind_interrupts, eth, peripherals, rng, Config}; | 12 | use embassy_stm32::{Config, bind_interrupts, eth, peripherals, rng}; |
| 13 | use embassy_time::Timer; | 13 | use embassy_time::Timer; |
| 14 | use embedded_io_async::Write; | 14 | use embedded_io_async::Write; |
| 15 | use static_cell::StaticCell; | 15 | use static_cell::StaticCell; |
diff --git a/examples/stm32f7/src/bin/hash.rs b/examples/stm32f7/src/bin/hash.rs index c2d1a7158..4fd465df6 100644 --- a/examples/stm32f7/src/bin/hash.rs +++ b/examples/stm32f7/src/bin/hash.rs | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | use defmt::info; | 4 | use defmt::info; |
| 5 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| 6 | use embassy_stm32::hash::*; | 6 | use embassy_stm32::hash::*; |
| 7 | use embassy_stm32::{bind_interrupts, hash, peripherals, Config}; | 7 | use embassy_stm32::{Config, bind_interrupts, hash, peripherals}; |
| 8 | use embassy_time::Instant; | 8 | use embassy_time::Instant; |
| 9 | use hmac::{Hmac, Mac}; | 9 | use hmac::{Hmac, Mac}; |
| 10 | use sha2::{Digest, Sha256}; | 10 | use sha2::{Digest, Sha256}; |
diff --git a/examples/stm32f7/src/bin/qspi.rs b/examples/stm32f7/src/bin/qspi.rs index 80652b865..e8ef3ad81 100644 --- a/examples/stm32f7/src/bin/qspi.rs +++ b/examples/stm32f7/src/bin/qspi.rs | |||
| @@ -4,11 +4,11 @@ | |||
| 4 | 4 | ||
| 5 | use defmt::info; | 5 | use defmt::info; |
| 6 | use embassy_executor::Spawner; | 6 | use embassy_executor::Spawner; |
| 7 | use embassy_stm32::Config as StmCfg; | ||
| 7 | use embassy_stm32::mode::Async; | 8 | use embassy_stm32::mode::Async; |
| 8 | use embassy_stm32::qspi::enums::{AddressSize, ChipSelectHighTime, FIFOThresholdLevel, MemorySize, *}; | 9 | use embassy_stm32::qspi::enums::{AddressSize, ChipSelectHighTime, FIFOThresholdLevel, MemorySize, *}; |
| 9 | use embassy_stm32::qspi::{Config as QspiCfg, Instance, Qspi, TransferConfig}; | 10 | use embassy_stm32::qspi::{Config as QspiCfg, Instance, Qspi, TransferConfig}; |
| 10 | use embassy_stm32::time::mhz; | 11 | use embassy_stm32::time::mhz; |
| 11 | use embassy_stm32::Config as StmCfg; | ||
| 12 | use {defmt_rtt as _, panic_probe as _}; | 12 | use {defmt_rtt as _, panic_probe as _}; |
| 13 | 13 | ||
| 14 | const MEMORY_PAGE_SIZE: usize = 256; | 14 | const MEMORY_PAGE_SIZE: usize = 256; |
diff --git a/examples/stm32f7/src/bin/sdmmc.rs b/examples/stm32f7/src/bin/sdmmc.rs index 787bef25e..8809b5d0c 100644 --- a/examples/stm32f7/src/bin/sdmmc.rs +++ b/examples/stm32f7/src/bin/sdmmc.rs | |||
| @@ -4,8 +4,8 @@ | |||
| 4 | use defmt::*; | 4 | use defmt::*; |
| 5 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| 6 | use embassy_stm32::sdmmc::Sdmmc; | 6 | use embassy_stm32::sdmmc::Sdmmc; |
| 7 | use embassy_stm32::time::{mhz, Hertz}; | 7 | use embassy_stm32::time::{Hertz, mhz}; |
| 8 | use embassy_stm32::{bind_interrupts, peripherals, sdmmc, Config}; | 8 | use embassy_stm32::{Config, bind_interrupts, peripherals, sdmmc}; |
| 9 | use {defmt_rtt as _, panic_probe as _}; | 9 | use {defmt_rtt as _, panic_probe as _}; |
| 10 | 10 | ||
| 11 | bind_interrupts!(struct Irqs { | 11 | bind_interrupts!(struct Irqs { |
diff --git a/examples/stm32f7/src/bin/usb_serial.rs b/examples/stm32f7/src/bin/usb_serial.rs index 349012888..9a30b2c20 100644 --- a/examples/stm32f7/src/bin/usb_serial.rs +++ b/examples/stm32f7/src/bin/usb_serial.rs | |||
| @@ -6,10 +6,10 @@ use embassy_executor::Spawner; | |||
| 6 | use embassy_futures::join::join; | 6 | use embassy_futures::join::join; |
| 7 | use embassy_stm32::time::Hertz; | 7 | use embassy_stm32::time::Hertz; |
| 8 | use embassy_stm32::usb::{Driver, Instance}; | 8 | use embassy_stm32::usb::{Driver, Instance}; |
| 9 | use embassy_stm32::{bind_interrupts, peripherals, usb, Config}; | 9 | use embassy_stm32::{Config, bind_interrupts, peripherals, usb}; |
| 10 | use embassy_usb::Builder; | ||
| 10 | use embassy_usb::class::cdc_acm::{CdcAcmClass, State}; | 11 | use embassy_usb::class::cdc_acm::{CdcAcmClass, State}; |
| 11 | use embassy_usb::driver::EndpointError; | 12 | use embassy_usb::driver::EndpointError; |
| 12 | use embassy_usb::Builder; | ||
| 13 | use {defmt_rtt as _, panic_probe as _}; | 13 | use {defmt_rtt as _, panic_probe as _}; |
| 14 | 14 | ||
| 15 | bind_interrupts!(struct Irqs { | 15 | bind_interrupts!(struct Irqs { |
diff --git a/examples/stm32g0/src/bin/hf_timer.rs b/examples/stm32g0/src/bin/hf_timer.rs index 705905f01..88ee7ea86 100644 --- a/examples/stm32g0/src/bin/hf_timer.rs +++ b/examples/stm32g0/src/bin/hf_timer.rs | |||
| @@ -3,12 +3,12 @@ | |||
| 3 | 3 | ||
| 4 | use defmt::info; | 4 | use defmt::info; |
| 5 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| 6 | use embassy_stm32::Config as PeripheralConfig; | ||
| 6 | use embassy_stm32::gpio::OutputType; | 7 | use embassy_stm32::gpio::OutputType; |
| 7 | use embassy_stm32::time::khz; | 8 | use embassy_stm32::time::khz; |
| 9 | use embassy_stm32::timer::Channel; | ||
| 8 | use embassy_stm32::timer::complementary_pwm::{ComplementaryPwm, ComplementaryPwmPin}; | 10 | use embassy_stm32::timer::complementary_pwm::{ComplementaryPwm, ComplementaryPwmPin}; |
| 9 | use embassy_stm32::timer::simple_pwm::PwmPin; | 11 | use embassy_stm32::timer::simple_pwm::PwmPin; |
| 10 | use embassy_stm32::timer::Channel; | ||
| 11 | use embassy_stm32::Config as PeripheralConfig; | ||
| 12 | use {defmt_rtt as _, panic_probe as _}; | 12 | use {defmt_rtt as _, panic_probe as _}; |
| 13 | 13 | ||
| 14 | #[embassy_executor::main] | 14 | #[embassy_executor::main] |
diff --git a/examples/stm32g0/src/bin/input_capture.rs b/examples/stm32g0/src/bin/input_capture.rs index 5501a6941..ca3e8eb41 100644 --- a/examples/stm32g0/src/bin/input_capture.rs +++ b/examples/stm32g0/src/bin/input_capture.rs | |||
| @@ -13,10 +13,10 @@ use defmt::*; | |||
| 13 | use embassy_executor::Spawner; | 13 | use embassy_executor::Spawner; |
| 14 | use embassy_stm32::gpio::{Level, Output, OutputType, Pull, Speed}; | 14 | use embassy_stm32::gpio::{Level, Output, OutputType, Pull, Speed}; |
| 15 | use embassy_stm32::time::khz; | 15 | use embassy_stm32::time::khz; |
| 16 | use embassy_stm32::timer::Channel; | ||
| 16 | use embassy_stm32::timer::input_capture::{CapturePin, InputCapture}; | 17 | use embassy_stm32::timer::input_capture::{CapturePin, InputCapture}; |
| 17 | use embassy_stm32::timer::simple_pwm::{PwmPin, SimplePwm}; | 18 | use embassy_stm32::timer::simple_pwm::{PwmPin, SimplePwm}; |
| 18 | use embassy_stm32::timer::Channel; | 19 | use embassy_stm32::{Peri, bind_interrupts, peripherals, timer}; |
| 19 | use embassy_stm32::{bind_interrupts, peripherals, timer, Peri}; | ||
| 20 | use embassy_time::Timer; | 20 | use embassy_time::Timer; |
| 21 | use {defmt_rtt as _, panic_probe as _}; | 21 | use {defmt_rtt as _, panic_probe as _}; |
| 22 | 22 | ||
diff --git a/examples/stm32g0/src/bin/pwm_complementary.rs b/examples/stm32g0/src/bin/pwm_complementary.rs index dbd9194c9..9856dd953 100644 --- a/examples/stm32g0/src/bin/pwm_complementary.rs +++ b/examples/stm32g0/src/bin/pwm_complementary.rs | |||
| @@ -17,9 +17,9 @@ use defmt::info; | |||
| 17 | use embassy_executor::Spawner; | 17 | use embassy_executor::Spawner; |
| 18 | use embassy_stm32::gpio::OutputType; | 18 | use embassy_stm32::gpio::OutputType; |
| 19 | use embassy_stm32::time::khz; | 19 | use embassy_stm32::time::khz; |
| 20 | use embassy_stm32::timer::Channel; | ||
| 20 | use embassy_stm32::timer::complementary_pwm::{ComplementaryPwm, ComplementaryPwmPin}; | 21 | use embassy_stm32::timer::complementary_pwm::{ComplementaryPwm, ComplementaryPwmPin}; |
| 21 | use embassy_stm32::timer::simple_pwm::PwmPin; | 22 | use embassy_stm32::timer::simple_pwm::PwmPin; |
| 22 | use embassy_stm32::timer::Channel; | ||
| 23 | use {defmt_rtt as _, panic_probe as _}; | 23 | use {defmt_rtt as _, panic_probe as _}; |
| 24 | 24 | ||
| 25 | #[embassy_executor::main] | 25 | #[embassy_executor::main] |
diff --git a/examples/stm32g0/src/bin/pwm_input.rs b/examples/stm32g0/src/bin/pwm_input.rs index 72aa07c03..5da19e077 100644 --- a/examples/stm32g0/src/bin/pwm_input.rs +++ b/examples/stm32g0/src/bin/pwm_input.rs | |||
| @@ -14,7 +14,7 @@ use embassy_stm32::gpio::{Level, Output, OutputType, Pull, Speed}; | |||
| 14 | use embassy_stm32::time::khz; | 14 | use embassy_stm32::time::khz; |
| 15 | use embassy_stm32::timer::pwm_input::PwmInput; | 15 | use embassy_stm32::timer::pwm_input::PwmInput; |
| 16 | use embassy_stm32::timer::simple_pwm::{PwmPin, SimplePwm}; | 16 | use embassy_stm32::timer::simple_pwm::{PwmPin, SimplePwm}; |
| 17 | use embassy_stm32::{bind_interrupts, peripherals, timer, Peri}; | 17 | use embassy_stm32::{Peri, bind_interrupts, peripherals, timer}; |
| 18 | use embassy_time::Timer; | 18 | use embassy_time::Timer; |
| 19 | use {defmt_rtt as _, panic_probe as _}; | 19 | use {defmt_rtt as _, panic_probe as _}; |
| 20 | 20 | ||
diff --git a/examples/stm32g0/src/bin/rtc.rs b/examples/stm32g0/src/bin/rtc.rs index 50fb6398e..21da204cc 100644 --- a/examples/stm32g0/src/bin/rtc.rs +++ b/examples/stm32g0/src/bin/rtc.rs | |||
| @@ -3,8 +3,8 @@ | |||
| 3 | 3 | ||
| 4 | use defmt::*; | 4 | use defmt::*; |
| 5 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| 6 | use embassy_stm32::rtc::{DateTime, DayOfWeek, Rtc, RtcConfig}; | ||
| 7 | use embassy_stm32::Config; | 6 | use embassy_stm32::Config; |
| 7 | use embassy_stm32::rtc::{DateTime, DayOfWeek, Rtc, RtcConfig}; | ||
| 8 | use embassy_time::Timer; | 8 | use embassy_time::Timer; |
| 9 | use {defmt_rtt as _, panic_probe as _}; | 9 | use {defmt_rtt as _, panic_probe as _}; |
| 10 | 10 | ||
diff --git a/examples/stm32g0/src/bin/usb_serial.rs b/examples/stm32g0/src/bin/usb_serial.rs index 162dfd86b..7dab393ac 100644 --- a/examples/stm32g0/src/bin/usb_serial.rs +++ b/examples/stm32g0/src/bin/usb_serial.rs | |||
| @@ -5,10 +5,10 @@ use defmt::{panic, *}; | |||
| 5 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| 6 | use embassy_futures::join::join; | 6 | use embassy_futures::join::join; |
| 7 | use embassy_stm32::usb::{Driver, Instance}; | 7 | use embassy_stm32::usb::{Driver, Instance}; |
| 8 | use embassy_stm32::{bind_interrupts, peripherals, usb, Config}; | 8 | use embassy_stm32::{Config, bind_interrupts, peripherals, usb}; |
| 9 | use embassy_usb::Builder; | ||
| 9 | use embassy_usb::class::cdc_acm::{CdcAcmClass, State}; | 10 | use embassy_usb::class::cdc_acm::{CdcAcmClass, State}; |
| 10 | use embassy_usb::driver::EndpointError; | 11 | use embassy_usb::driver::EndpointError; |
| 11 | use embassy_usb::Builder; | ||
| 12 | use {defmt_rtt as _, panic_probe as _}; | 12 | use {defmt_rtt as _, panic_probe as _}; |
| 13 | 13 | ||
| 14 | bind_interrupts!(struct Irqs { | 14 | bind_interrupts!(struct Irqs { |
diff --git a/examples/stm32g4/src/bin/adc.rs b/examples/stm32g4/src/bin/adc.rs index adca846d8..920142a18 100644 --- a/examples/stm32g4/src/bin/adc.rs +++ b/examples/stm32g4/src/bin/adc.rs | |||
| @@ -3,8 +3,8 @@ | |||
| 3 | 3 | ||
| 4 | use defmt::*; | 4 | use defmt::*; |
| 5 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| 6 | use embassy_stm32::adc::{Adc, SampleTime}; | ||
| 7 | use embassy_stm32::Config; | 6 | use embassy_stm32::Config; |
| 7 | use embassy_stm32::adc::{Adc, SampleTime}; | ||
| 8 | use embassy_time::Timer; | 8 | use embassy_time::Timer; |
| 9 | use {defmt_rtt as _, panic_probe as _}; | 9 | use {defmt_rtt as _, panic_probe as _}; |
| 10 | 10 | ||
diff --git a/examples/stm32g4/src/bin/adc_differential.rs b/examples/stm32g4/src/bin/adc_differential.rs index 78d071d45..301f0da84 100644 --- a/examples/stm32g4/src/bin/adc_differential.rs +++ b/examples/stm32g4/src/bin/adc_differential.rs | |||
| @@ -8,8 +8,8 @@ | |||
| 8 | 8 | ||
| 9 | use defmt::*; | 9 | use defmt::*; |
| 10 | use embassy_executor::Spawner; | 10 | use embassy_executor::Spawner; |
| 11 | use embassy_stm32::adc::{Adc, SampleTime}; | ||
| 12 | use embassy_stm32::Config; | 11 | use embassy_stm32::Config; |
| 12 | use embassy_stm32::adc::{Adc, SampleTime}; | ||
| 13 | use embassy_time::Timer; | 13 | use embassy_time::Timer; |
| 14 | use {defmt_rtt as _, panic_probe as _}; | 14 | use {defmt_rtt as _, panic_probe as _}; |
| 15 | 15 | ||
diff --git a/examples/stm32g4/src/bin/adc_dma.rs b/examples/stm32g4/src/bin/adc_dma.rs index 202704085..a82067049 100644 --- a/examples/stm32g4/src/bin/adc_dma.rs +++ b/examples/stm32g4/src/bin/adc_dma.rs | |||
| @@ -3,8 +3,8 @@ | |||
| 3 | 3 | ||
| 4 | use defmt::*; | 4 | use defmt::*; |
| 5 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| 6 | use embassy_stm32::adc::{Adc, AdcChannel as _, SampleTime}; | ||
| 7 | use embassy_stm32::Config; | 6 | use embassy_stm32::Config; |
| 7 | use embassy_stm32::adc::{Adc, AdcChannel as _, SampleTime}; | ||
| 8 | use embassy_time::Timer; | 8 | use embassy_time::Timer; |
| 9 | use {defmt_rtt as _, panic_probe as _}; | 9 | use {defmt_rtt as _, panic_probe as _}; |
| 10 | 10 | ||
diff --git a/examples/stm32g4/src/bin/adc_oversampling.rs b/examples/stm32g4/src/bin/adc_oversampling.rs index d31eb20f8..1e464183a 100644 --- a/examples/stm32g4/src/bin/adc_oversampling.rs +++ b/examples/stm32g4/src/bin/adc_oversampling.rs | |||
| @@ -7,9 +7,9 @@ | |||
| 7 | 7 | ||
| 8 | use defmt::*; | 8 | use defmt::*; |
| 9 | use embassy_executor::Spawner; | 9 | use embassy_executor::Spawner; |
| 10 | use embassy_stm32::Config; | ||
| 10 | use embassy_stm32::adc::vals::{Rovsm, Trovs}; | 11 | use embassy_stm32::adc::vals::{Rovsm, Trovs}; |
| 11 | use embassy_stm32::adc::{Adc, SampleTime}; | 12 | use embassy_stm32::adc::{Adc, SampleTime}; |
| 12 | use embassy_stm32::Config; | ||
| 13 | use embassy_time::Timer; | 13 | use embassy_time::Timer; |
| 14 | use {defmt_rtt as _, panic_probe as _}; | 14 | use {defmt_rtt as _, panic_probe as _}; |
| 15 | 15 | ||
diff --git a/examples/stm32g4/src/bin/can.rs b/examples/stm32g4/src/bin/can.rs index 90004f874..7ff7bd7b4 100644 --- a/examples/stm32g4/src/bin/can.rs +++ b/examples/stm32g4/src/bin/can.rs | |||
| @@ -4,7 +4,7 @@ use defmt::*; | |||
| 4 | use embassy_executor::Spawner; | 4 | use embassy_executor::Spawner; |
| 5 | use embassy_stm32::peripherals::*; | 5 | use embassy_stm32::peripherals::*; |
| 6 | use embassy_stm32::time::Hertz; | 6 | use embassy_stm32::time::Hertz; |
| 7 | use embassy_stm32::{bind_interrupts, can, Config}; | 7 | use embassy_stm32::{Config, bind_interrupts, can}; |
| 8 | use embassy_time::Timer; | 8 | use embassy_time::Timer; |
| 9 | use static_cell::StaticCell; | 9 | use static_cell::StaticCell; |
| 10 | use {defmt_rtt as _, panic_probe as _}; | 10 | use {defmt_rtt as _, panic_probe as _}; |
diff --git a/examples/stm32g4/src/bin/usb_c_pd.rs b/examples/stm32g4/src/bin/usb_c_pd.rs index 2e87d3931..b23984b3a 100644 --- a/examples/stm32g4/src/bin/usb_c_pd.rs +++ b/examples/stm32g4/src/bin/usb_c_pd.rs | |||
| @@ -1,11 +1,11 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | 3 | ||
| 4 | use defmt::{error, info, Format}; | 4 | use defmt::{Format, error, info}; |
| 5 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| 6 | use embassy_stm32::ucpd::{self, CcPhy, CcPull, CcSel, CcVState, Ucpd}; | 6 | use embassy_stm32::ucpd::{self, CcPhy, CcPull, CcSel, CcVState, Ucpd}; |
| 7 | use embassy_stm32::{bind_interrupts, peripherals, Config}; | 7 | use embassy_stm32::{Config, bind_interrupts, peripherals}; |
| 8 | use embassy_time::{with_timeout, Duration}; | 8 | use embassy_time::{Duration, with_timeout}; |
| 9 | use {defmt_rtt as _, panic_probe as _}; | 9 | use {defmt_rtt as _, panic_probe as _}; |
| 10 | 10 | ||
| 11 | bind_interrupts!(struct Irqs { | 11 | bind_interrupts!(struct Irqs { |
diff --git a/examples/stm32g4/src/bin/usb_serial.rs b/examples/stm32g4/src/bin/usb_serial.rs index 9f66f0c53..a62da6d97 100644 --- a/examples/stm32g4/src/bin/usb_serial.rs +++ b/examples/stm32g4/src/bin/usb_serial.rs | |||
| @@ -6,10 +6,10 @@ use embassy_executor::Spawner; | |||
| 6 | use embassy_futures::join::join; | 6 | use embassy_futures::join::join; |
| 7 | use embassy_stm32::time::Hertz; | 7 | use embassy_stm32::time::Hertz; |
| 8 | use embassy_stm32::usb::{self, Driver, Instance}; | 8 | use embassy_stm32::usb::{self, Driver, Instance}; |
| 9 | use embassy_stm32::{bind_interrupts, peripherals, Config}; | 9 | use embassy_stm32::{Config, bind_interrupts, peripherals}; |
| 10 | use embassy_usb::Builder; | ||
| 10 | use embassy_usb::class::cdc_acm::{CdcAcmClass, State}; | 11 | use embassy_usb::class::cdc_acm::{CdcAcmClass, State}; |
| 11 | use embassy_usb::driver::EndpointError; | 12 | use embassy_usb::driver::EndpointError; |
| 12 | use embassy_usb::Builder; | ||
| 13 | use {defmt_rtt as _, panic_probe as _}; | 13 | use {defmt_rtt as _, panic_probe as _}; |
| 14 | 14 | ||
| 15 | bind_interrupts!(struct Irqs { | 15 | bind_interrupts!(struct Irqs { |
diff --git a/examples/stm32h5/src/bin/adc.rs b/examples/stm32h5/src/bin/adc.rs index c5d508ece..0566320d4 100644 --- a/examples/stm32h5/src/bin/adc.rs +++ b/examples/stm32h5/src/bin/adc.rs | |||
| @@ -3,8 +3,8 @@ | |||
| 3 | 3 | ||
| 4 | use defmt::*; | 4 | use defmt::*; |
| 5 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| 6 | use embassy_stm32::adc::{Adc, SampleTime}; | ||
| 7 | use embassy_stm32::Config; | 6 | use embassy_stm32::Config; |
| 7 | use embassy_stm32::adc::{Adc, SampleTime}; | ||
| 8 | use embassy_time::Timer; | 8 | use embassy_time::Timer; |
| 9 | use {defmt_rtt as _, panic_probe as _}; | 9 | use {defmt_rtt as _, panic_probe as _}; |
| 10 | 10 | ||
diff --git a/examples/stm32h5/src/bin/can.rs b/examples/stm32h5/src/bin/can.rs index 194239d47..b1923547e 100644 --- a/examples/stm32h5/src/bin/can.rs +++ b/examples/stm32h5/src/bin/can.rs | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | use defmt::*; | 4 | use defmt::*; |
| 5 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| 6 | use embassy_stm32::peripherals::*; | 6 | use embassy_stm32::peripherals::*; |
| 7 | use embassy_stm32::{bind_interrupts, can, rcc, Config}; | 7 | use embassy_stm32::{Config, bind_interrupts, can, rcc}; |
| 8 | use embassy_time::Timer; | 8 | use embassy_time::Timer; |
| 9 | use {defmt_rtt as _, panic_probe as _}; | 9 | use {defmt_rtt as _, panic_probe as _}; |
| 10 | 10 | ||
diff --git a/examples/stm32h5/src/bin/dts.rs b/examples/stm32h5/src/bin/dts.rs index 8c18fafea..7c856b5b3 100644 --- a/examples/stm32h5/src/bin/dts.rs +++ b/examples/stm32h5/src/bin/dts.rs | |||
| @@ -6,7 +6,7 @@ use embassy_executor::Spawner; | |||
| 6 | use embassy_stm32::dts::{Dts, InterruptHandler, SampleTime}; | 6 | use embassy_stm32::dts::{Dts, InterruptHandler, SampleTime}; |
| 7 | use embassy_stm32::peripherals::DTS; | 7 | use embassy_stm32::peripherals::DTS; |
| 8 | use embassy_stm32::rcc::frequency; | 8 | use embassy_stm32::rcc::frequency; |
| 9 | use embassy_stm32::{bind_interrupts, dts, Config}; | 9 | use embassy_stm32::{Config, bind_interrupts, dts}; |
| 10 | use embassy_time::Timer; | 10 | use embassy_time::Timer; |
| 11 | use {defmt_rtt as _, panic_probe as _}; | 11 | use {defmt_rtt as _, panic_probe as _}; |
| 12 | 12 | ||
diff --git a/examples/stm32h5/src/bin/eth.rs b/examples/stm32h5/src/bin/eth.rs index a84fe358b..a5c6cee26 100644 --- a/examples/stm32h5/src/bin/eth.rs +++ b/examples/stm32h5/src/bin/eth.rs | |||
| @@ -12,7 +12,7 @@ use embassy_stm32::rcc::{ | |||
| 12 | }; | 12 | }; |
| 13 | use embassy_stm32::rng::Rng; | 13 | use embassy_stm32::rng::Rng; |
| 14 | use embassy_stm32::time::Hertz; | 14 | use embassy_stm32::time::Hertz; |
| 15 | use embassy_stm32::{bind_interrupts, eth, peripherals, rng, Config}; | 15 | use embassy_stm32::{Config, bind_interrupts, eth, peripherals, rng}; |
| 16 | use embassy_time::Timer; | 16 | use embassy_time::Timer; |
| 17 | use embedded_io_async::Write; | 17 | use embedded_io_async::Write; |
| 18 | use static_cell::StaticCell; | 18 | use static_cell::StaticCell; |
diff --git a/examples/stm32h5/src/bin/sai.rs b/examples/stm32h5/src/bin/sai.rs index 0e182f9cf..6632a7f98 100644 --- a/examples/stm32h5/src/bin/sai.rs +++ b/examples/stm32h5/src/bin/sai.rs | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | 3 | ||
| 4 | use defmt::info; | 4 | use defmt::info; |
| 5 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| 6 | use embassy_stm32::{sai, Config}; | 6 | use embassy_stm32::{Config, sai}; |
| 7 | use {defmt_rtt as _, panic_probe as _}; | 7 | use {defmt_rtt as _, panic_probe as _}; |
| 8 | 8 | ||
| 9 | #[embassy_executor::main] | 9 | #[embassy_executor::main] |
diff --git a/examples/stm32h5/src/bin/usb_c_pd.rs b/examples/stm32h5/src/bin/usb_c_pd.rs index acb03e498..ab6efff32 100644 --- a/examples/stm32h5/src/bin/usb_c_pd.rs +++ b/examples/stm32h5/src/bin/usb_c_pd.rs | |||
| @@ -3,12 +3,12 @@ | |||
| 3 | #![no_std] | 3 | #![no_std] |
| 4 | #![no_main] | 4 | #![no_main] |
| 5 | 5 | ||
| 6 | use defmt::{error, info, Format}; | 6 | use defmt::{Format, error, info}; |
| 7 | use embassy_executor::Spawner; | 7 | use embassy_executor::Spawner; |
| 8 | use embassy_stm32::gpio::Output; | 8 | use embassy_stm32::gpio::Output; |
| 9 | use embassy_stm32::ucpd::{self, CcPhy, CcPull, CcSel, CcVState, Ucpd}; | 9 | use embassy_stm32::ucpd::{self, CcPhy, CcPull, CcSel, CcVState, Ucpd}; |
| 10 | use embassy_stm32::{bind_interrupts, peripherals, Config}; | 10 | use embassy_stm32::{Config, bind_interrupts, peripherals}; |
| 11 | use embassy_time::{with_timeout, Duration}; | 11 | use embassy_time::{Duration, with_timeout}; |
| 12 | use {defmt_rtt as _, panic_probe as _}; | 12 | use {defmt_rtt as _, panic_probe as _}; |
| 13 | 13 | ||
| 14 | bind_interrupts!(struct Irqs { | 14 | bind_interrupts!(struct Irqs { |
diff --git a/examples/stm32h5/src/bin/usb_serial.rs b/examples/stm32h5/src/bin/usb_serial.rs index e8f536133..f72851ed7 100644 --- a/examples/stm32h5/src/bin/usb_serial.rs +++ b/examples/stm32h5/src/bin/usb_serial.rs | |||
| @@ -6,10 +6,10 @@ use embassy_executor::Spawner; | |||
| 6 | use embassy_futures::join::join; | 6 | use embassy_futures::join::join; |
| 7 | use embassy_stm32::time::Hertz; | 7 | use embassy_stm32::time::Hertz; |
| 8 | use embassy_stm32::usb::{Driver, Instance}; | 8 | use embassy_stm32::usb::{Driver, Instance}; |
| 9 | use embassy_stm32::{bind_interrupts, peripherals, usb, Config}; | 9 | use embassy_stm32::{Config, bind_interrupts, peripherals, usb}; |
| 10 | use embassy_usb::Builder; | ||
| 10 | use embassy_usb::class::cdc_acm::{CdcAcmClass, State}; | 11 | use embassy_usb::class::cdc_acm::{CdcAcmClass, State}; |
| 11 | use embassy_usb::driver::EndpointError; | 12 | use embassy_usb::driver::EndpointError; |
| 12 | use embassy_usb::Builder; | ||
| 13 | use {defmt_rtt as _, panic_probe as _}; | 13 | use {defmt_rtt as _, panic_probe as _}; |
| 14 | 14 | ||
| 15 | bind_interrupts!(struct Irqs { | 15 | bind_interrupts!(struct Irqs { |
diff --git a/examples/stm32h5/src/bin/usb_uac_speaker.rs b/examples/stm32h5/src/bin/usb_uac_speaker.rs index 86873cabd..f75b1fd8a 100644 --- a/examples/stm32h5/src/bin/usb_uac_speaker.rs +++ b/examples/stm32h5/src/bin/usb_uac_speaker.rs | |||
| @@ -6,9 +6,9 @@ use core::cell::{Cell, RefCell}; | |||
| 6 | use defmt::{panic, *}; | 6 | use defmt::{panic, *}; |
| 7 | use embassy_executor::Spawner; | 7 | use embassy_executor::Spawner; |
| 8 | use embassy_stm32::time::Hertz; | 8 | use embassy_stm32::time::Hertz; |
| 9 | use embassy_stm32::{bind_interrupts, interrupt, peripherals, timer, usb, Config}; | 9 | use embassy_stm32::{Config, bind_interrupts, interrupt, peripherals, timer, usb}; |
| 10 | use embassy_sync::blocking_mutex::raw::{CriticalSectionRawMutex, NoopRawMutex}; | ||
| 11 | use embassy_sync::blocking_mutex::Mutex; | 10 | use embassy_sync::blocking_mutex::Mutex; |
| 11 | use embassy_sync::blocking_mutex::raw::{CriticalSectionRawMutex, NoopRawMutex}; | ||
| 12 | use embassy_sync::signal::Signal; | 12 | use embassy_sync::signal::Signal; |
| 13 | use embassy_sync::zerocopy_channel; | 13 | use embassy_sync::zerocopy_channel; |
| 14 | use embassy_usb::class::uac1; | 14 | use embassy_usb::class::uac1; |
diff --git a/examples/stm32h7/src/bin/adc.rs b/examples/stm32h7/src/bin/adc.rs index 98504ddf6..a53c9d8d5 100644 --- a/examples/stm32h7/src/bin/adc.rs +++ b/examples/stm32h7/src/bin/adc.rs | |||
| @@ -3,8 +3,8 @@ | |||
| 3 | 3 | ||
| 4 | use defmt::*; | 4 | use defmt::*; |
| 5 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| 6 | use embassy_stm32::adc::{Adc, SampleTime}; | ||
| 7 | use embassy_stm32::Config; | 6 | use embassy_stm32::Config; |
| 7 | use embassy_stm32::adc::{Adc, SampleTime}; | ||
| 8 | use embassy_time::Timer; | 8 | use embassy_time::Timer; |
| 9 | use {defmt_rtt as _, panic_probe as _}; | 9 | use {defmt_rtt as _, panic_probe as _}; |
| 10 | 10 | ||
diff --git a/examples/stm32h7/src/bin/adc_dma.rs b/examples/stm32h7/src/bin/adc_dma.rs index f06b5d06e..cedb32e47 100644 --- a/examples/stm32h7/src/bin/adc_dma.rs +++ b/examples/stm32h7/src/bin/adc_dma.rs | |||
| @@ -3,8 +3,8 @@ | |||
| 3 | 3 | ||
| 4 | use defmt::*; | 4 | use defmt::*; |
| 5 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| 6 | use embassy_stm32::adc::{Adc, AdcChannel as _, SampleTime}; | ||
| 7 | use embassy_stm32::Config; | 6 | use embassy_stm32::Config; |
| 7 | use embassy_stm32::adc::{Adc, AdcChannel as _, SampleTime}; | ||
| 8 | use embassy_time::Timer; | 8 | use embassy_time::Timer; |
| 9 | use {defmt_rtt as _, panic_probe as _}; | 9 | use {defmt_rtt as _, panic_probe as _}; |
| 10 | 10 | ||
diff --git a/examples/stm32h7/src/bin/camera.rs b/examples/stm32h7/src/bin/camera.rs index 039008d17..c593d5e0b 100644 --- a/examples/stm32h7/src/bin/camera.rs +++ b/examples/stm32h7/src/bin/camera.rs | |||
| @@ -6,7 +6,7 @@ use embassy_stm32::dcmi::{self, *}; | |||
| 6 | use embassy_stm32::gpio::{Level, Output, Speed}; | 6 | use embassy_stm32::gpio::{Level, Output, Speed}; |
| 7 | use embassy_stm32::i2c::I2c; | 7 | use embassy_stm32::i2c::I2c; |
| 8 | use embassy_stm32::rcc::{Mco, Mco1Source, McoConfig, McoPrescaler}; | 8 | use embassy_stm32::rcc::{Mco, Mco1Source, McoConfig, McoPrescaler}; |
| 9 | use embassy_stm32::{bind_interrupts, i2c, peripherals, Config}; | 9 | use embassy_stm32::{Config, bind_interrupts, i2c, peripherals}; |
| 10 | use embassy_time::Timer; | 10 | use embassy_time::Timer; |
| 11 | use ov7725::*; | 11 | use ov7725::*; |
| 12 | use {defmt_rtt as _, panic_probe as _}; | 12 | use {defmt_rtt as _, panic_probe as _}; |
diff --git a/examples/stm32h7/src/bin/can.rs b/examples/stm32h7/src/bin/can.rs index 0af11ef3e..49830f9b7 100644 --- a/examples/stm32h7/src/bin/can.rs +++ b/examples/stm32h7/src/bin/can.rs | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | use defmt::*; | 4 | use defmt::*; |
| 5 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| 6 | use embassy_stm32::peripherals::*; | 6 | use embassy_stm32::peripherals::*; |
| 7 | use embassy_stm32::{bind_interrupts, can, rcc, Config}; | 7 | use embassy_stm32::{Config, bind_interrupts, can, rcc}; |
| 8 | use embassy_time::Timer; | 8 | use embassy_time::Timer; |
| 9 | use {defmt_rtt as _, panic_probe as _}; | 9 | use {defmt_rtt as _, panic_probe as _}; |
| 10 | 10 | ||
diff --git a/examples/stm32h7/src/bin/dac.rs b/examples/stm32h7/src/bin/dac.rs index 27df80336..fa22837c5 100644 --- a/examples/stm32h7/src/bin/dac.rs +++ b/examples/stm32h7/src/bin/dac.rs | |||
| @@ -3,8 +3,8 @@ | |||
| 3 | 3 | ||
| 4 | use cortex_m_rt::entry; | 4 | use cortex_m_rt::entry; |
| 5 | use defmt::*; | 5 | use defmt::*; |
| 6 | use embassy_stm32::dac::{DacCh1, Value}; | ||
| 7 | use embassy_stm32::Config; | 6 | use embassy_stm32::Config; |
| 7 | use embassy_stm32::dac::{DacCh1, Value}; | ||
| 8 | use {defmt_rtt as _, panic_probe as _}; | 8 | use {defmt_rtt as _, panic_probe as _}; |
| 9 | 9 | ||
| 10 | #[entry] | 10 | #[entry] |
diff --git a/examples/stm32h7/src/bin/dac_dma.rs b/examples/stm32h7/src/bin/dac_dma.rs index df37e9d78..9ccefa761 100644 --- a/examples/stm32h7/src/bin/dac_dma.rs +++ b/examples/stm32h7/src/bin/dac_dma.rs | |||
| @@ -3,6 +3,7 @@ | |||
| 3 | 3 | ||
| 4 | use defmt::*; | 4 | use defmt::*; |
| 5 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| 6 | use embassy_stm32::Peri; | ||
| 6 | use embassy_stm32::dac::{DacCh1, DacCh2, ValueArray}; | 7 | use embassy_stm32::dac::{DacCh1, DacCh2, ValueArray}; |
| 7 | use embassy_stm32::mode::Async; | 8 | use embassy_stm32::mode::Async; |
| 8 | use embassy_stm32::pac::timer::vals::Mms; | 9 | use embassy_stm32::pac::timer::vals::Mms; |
| @@ -10,7 +11,6 @@ use embassy_stm32::peripherals::{DAC1, TIM6, TIM7}; | |||
| 10 | use embassy_stm32::rcc::frequency; | 11 | use embassy_stm32::rcc::frequency; |
| 11 | use embassy_stm32::time::Hertz; | 12 | use embassy_stm32::time::Hertz; |
| 12 | use embassy_stm32::timer::low_level::Timer; | 13 | use embassy_stm32::timer::low_level::Timer; |
| 13 | use embassy_stm32::Peri; | ||
| 14 | use micromath::F32Ext; | 14 | use micromath::F32Ext; |
| 15 | use {defmt_rtt as _, panic_probe as _}; | 15 | use {defmt_rtt as _, panic_probe as _}; |
| 16 | 16 | ||
diff --git a/examples/stm32h7/src/bin/eth.rs b/examples/stm32h7/src/bin/eth.rs index 6c215362d..589f4426e 100644 --- a/examples/stm32h7/src/bin/eth.rs +++ b/examples/stm32h7/src/bin/eth.rs | |||
| @@ -8,7 +8,7 @@ use embassy_net::{Ipv4Address, StackResources}; | |||
| 8 | use embassy_stm32::eth::{Ethernet, GenericPhy, PacketQueue}; | 8 | use embassy_stm32::eth::{Ethernet, GenericPhy, PacketQueue}; |
| 9 | use embassy_stm32::peripherals::ETH; | 9 | use embassy_stm32::peripherals::ETH; |
| 10 | use embassy_stm32::rng::Rng; | 10 | use embassy_stm32::rng::Rng; |
| 11 | use embassy_stm32::{bind_interrupts, eth, peripherals, rng, Config}; | 11 | use embassy_stm32::{Config, bind_interrupts, eth, peripherals, rng}; |
| 12 | use embassy_time::Timer; | 12 | use embassy_time::Timer; |
| 13 | use embedded_io_async::Write; | 13 | use embedded_io_async::Write; |
| 14 | use static_cell::StaticCell; | 14 | use static_cell::StaticCell; |
diff --git a/examples/stm32h7/src/bin/eth_client.rs b/examples/stm32h7/src/bin/eth_client.rs index 10ac57fc9..fed8f1a9c 100644 --- a/examples/stm32h7/src/bin/eth_client.rs +++ b/examples/stm32h7/src/bin/eth_client.rs | |||
| @@ -5,12 +5,12 @@ use core::net::{Ipv4Addr, SocketAddr, SocketAddrV4}; | |||
| 5 | 5 | ||
| 6 | use defmt::*; | 6 | use defmt::*; |
| 7 | use embassy_executor::Spawner; | 7 | use embassy_executor::Spawner; |
| 8 | use embassy_net::tcp::client::{TcpClient, TcpClientState}; | ||
| 9 | use embassy_net::StackResources; | 8 | use embassy_net::StackResources; |
| 9 | use embassy_net::tcp::client::{TcpClient, TcpClientState}; | ||
| 10 | use embassy_stm32::eth::{Ethernet, GenericPhy, PacketQueue}; | 10 | use embassy_stm32::eth::{Ethernet, GenericPhy, PacketQueue}; |
| 11 | use embassy_stm32::peripherals::ETH; | 11 | use embassy_stm32::peripherals::ETH; |
| 12 | use embassy_stm32::rng::Rng; | 12 | use embassy_stm32::rng::Rng; |
| 13 | use embassy_stm32::{bind_interrupts, eth, peripherals, rng, Config}; | 13 | use embassy_stm32::{Config, bind_interrupts, eth, peripherals, rng}; |
| 14 | use embassy_time::Timer; | 14 | use embassy_time::Timer; |
| 15 | use embedded_io_async::Write; | 15 | use embedded_io_async::Write; |
| 16 | use embedded_nal_async::TcpConnect; | 16 | use embedded_nal_async::TcpConnect; |
diff --git a/examples/stm32h7/src/bin/eth_client_mii.rs b/examples/stm32h7/src/bin/eth_client_mii.rs index c6a108471..c3c631f0f 100644 --- a/examples/stm32h7/src/bin/eth_client_mii.rs +++ b/examples/stm32h7/src/bin/eth_client_mii.rs | |||
| @@ -5,12 +5,12 @@ use core::net::{Ipv4Addr, SocketAddr, SocketAddrV4}; | |||
| 5 | 5 | ||
| 6 | use defmt::*; | 6 | use defmt::*; |
| 7 | use embassy_executor::Spawner; | 7 | use embassy_executor::Spawner; |
| 8 | use embassy_net::tcp::client::{TcpClient, TcpClientState}; | ||
| 9 | use embassy_net::StackResources; | 8 | use embassy_net::StackResources; |
| 9 | use embassy_net::tcp::client::{TcpClient, TcpClientState}; | ||
| 10 | use embassy_stm32::eth::{Ethernet, GenericPhy, PacketQueue}; | 10 | use embassy_stm32::eth::{Ethernet, GenericPhy, PacketQueue}; |
| 11 | use embassy_stm32::peripherals::ETH; | 11 | use embassy_stm32::peripherals::ETH; |
| 12 | use embassy_stm32::rng::Rng; | 12 | use embassy_stm32::rng::Rng; |
| 13 | use embassy_stm32::{bind_interrupts, eth, peripherals, rng, Config}; | 13 | use embassy_stm32::{Config, bind_interrupts, eth, peripherals, rng}; |
| 14 | use embassy_time::Timer; | 14 | use embassy_time::Timer; |
| 15 | use embedded_io_async::Write; | 15 | use embedded_io_async::Write; |
| 16 | use embedded_nal_async::TcpConnect; | 16 | use embedded_nal_async::TcpConnect; |
diff --git a/examples/stm32h7/src/bin/fmc.rs b/examples/stm32h7/src/bin/fmc.rs index 5e5e6ccc8..b65d50443 100644 --- a/examples/stm32h7/src/bin/fmc.rs +++ b/examples/stm32h7/src/bin/fmc.rs | |||
| @@ -3,8 +3,8 @@ | |||
| 3 | 3 | ||
| 4 | use defmt::*; | 4 | use defmt::*; |
| 5 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| 6 | use embassy_stm32::fmc::Fmc; | ||
| 7 | use embassy_stm32::Config; | 6 | use embassy_stm32::Config; |
| 7 | use embassy_stm32::fmc::Fmc; | ||
| 8 | use embassy_time::{Delay, Timer}; | 8 | use embassy_time::{Delay, Timer}; |
| 9 | use {defmt_rtt as _, panic_probe as _}; | 9 | use {defmt_rtt as _, panic_probe as _}; |
| 10 | 10 | ||
diff --git a/examples/stm32h7/src/bin/i2c_shared.rs b/examples/stm32h7/src/bin/i2c_shared.rs index 9e45d845f..08ff812f2 100644 --- a/examples/stm32h7/src/bin/i2c_shared.rs +++ b/examples/stm32h7/src/bin/i2c_shared.rs | |||
| @@ -9,8 +9,8 @@ use embassy_executor::Spawner; | |||
| 9 | use embassy_stm32::i2c::{self, I2c}; | 9 | use embassy_stm32::i2c::{self, I2c}; |
| 10 | use embassy_stm32::mode::Async; | 10 | use embassy_stm32::mode::Async; |
| 11 | use embassy_stm32::{bind_interrupts, peripherals}; | 11 | use embassy_stm32::{bind_interrupts, peripherals}; |
| 12 | use embassy_sync::blocking_mutex::raw::NoopRawMutex; | ||
| 13 | use embassy_sync::blocking_mutex::NoopMutex; | 12 | use embassy_sync::blocking_mutex::NoopMutex; |
| 13 | use embassy_sync::blocking_mutex::raw::NoopRawMutex; | ||
| 14 | use embassy_time::{Duration, Timer}; | 14 | use embassy_time::{Duration, Timer}; |
| 15 | use embedded_hal_1::i2c::I2c as _; | 15 | use embedded_hal_1::i2c::I2c as _; |
| 16 | use static_cell::StaticCell; | 16 | use static_cell::StaticCell; |
diff --git a/examples/stm32h7/src/bin/low_level_timer_api.rs b/examples/stm32h7/src/bin/low_level_timer_api.rs index 12abb8693..f17fb2aaa 100644 --- a/examples/stm32h7/src/bin/low_level_timer_api.rs +++ b/examples/stm32h7/src/bin/low_level_timer_api.rs | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | use defmt::*; | 4 | use defmt::*; |
| 5 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| 6 | use embassy_stm32::gpio::{AfType, Flex, OutputType, Speed}; | 6 | use embassy_stm32::gpio::{AfType, Flex, OutputType, Speed}; |
| 7 | use embassy_stm32::time::{khz, Hertz}; | 7 | use embassy_stm32::time::{Hertz, khz}; |
| 8 | use embassy_stm32::timer::low_level::{OutputCompareMode, Timer as LLTimer}; | 8 | use embassy_stm32::timer::low_level::{OutputCompareMode, Timer as LLTimer}; |
| 9 | use embassy_stm32::timer::{Ch1, Ch2, Ch3, Ch4, Channel, GeneralInstance32bit4Channel, TimerPin}; | 9 | use embassy_stm32::timer::{Ch1, Ch2, Ch3, Ch4, Channel, GeneralInstance32bit4Channel, TimerPin}; |
| 10 | use embassy_stm32::{Config, Peri}; | 10 | use embassy_stm32::{Config, Peri}; |
diff --git a/examples/stm32h7/src/bin/pwm.rs b/examples/stm32h7/src/bin/pwm.rs index 73b43be69..ffd117580 100644 --- a/examples/stm32h7/src/bin/pwm.rs +++ b/examples/stm32h7/src/bin/pwm.rs | |||
| @@ -3,10 +3,10 @@ | |||
| 3 | 3 | ||
| 4 | use defmt::*; | 4 | use defmt::*; |
| 5 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| 6 | use embassy_stm32::Config; | ||
| 6 | use embassy_stm32::gpio::OutputType; | 7 | use embassy_stm32::gpio::OutputType; |
| 7 | use embassy_stm32::time::khz; | 8 | use embassy_stm32::time::khz; |
| 8 | use embassy_stm32::timer::simple_pwm::{PwmPin, SimplePwm}; | 9 | use embassy_stm32::timer::simple_pwm::{PwmPin, SimplePwm}; |
| 9 | use embassy_stm32::Config; | ||
| 10 | use embassy_time::Timer; | 10 | use embassy_time::Timer; |
| 11 | use {defmt_rtt as _, panic_probe as _}; | 11 | use {defmt_rtt as _, panic_probe as _}; |
| 12 | 12 | ||
diff --git a/examples/stm32h7/src/bin/rng.rs b/examples/stm32h7/src/bin/rng.rs index a9ef7200d..489747678 100644 --- a/examples/stm32h7/src/bin/rng.rs +++ b/examples/stm32h7/src/bin/rng.rs | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | use defmt::*; | 4 | use defmt::*; |
| 5 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| 6 | use embassy_stm32::rng::Rng; | 6 | use embassy_stm32::rng::Rng; |
| 7 | use embassy_stm32::{bind_interrupts, peripherals, rng, Config}; | 7 | use embassy_stm32::{Config, bind_interrupts, peripherals, rng}; |
| 8 | use {defmt_rtt as _, panic_probe as _}; | 8 | use {defmt_rtt as _, panic_probe as _}; |
| 9 | 9 | ||
| 10 | bind_interrupts!(struct Irqs { | 10 | bind_interrupts!(struct Irqs { |
diff --git a/examples/stm32h7/src/bin/rtc.rs b/examples/stm32h7/src/bin/rtc.rs index 0adb48877..1bd71637b 100644 --- a/examples/stm32h7/src/bin/rtc.rs +++ b/examples/stm32h7/src/bin/rtc.rs | |||
| @@ -4,9 +4,9 @@ | |||
| 4 | use chrono::{NaiveDate, NaiveDateTime}; | 4 | use chrono::{NaiveDate, NaiveDateTime}; |
| 5 | use defmt::*; | 5 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 6 | use embassy_executor::Spawner; |
| 7 | use embassy_stm32::Config; | ||
| 7 | use embassy_stm32::rcc::LsConfig; | 8 | use embassy_stm32::rcc::LsConfig; |
| 8 | use embassy_stm32::rtc::{Rtc, RtcConfig}; | 9 | use embassy_stm32::rtc::{Rtc, RtcConfig}; |
| 9 | use embassy_stm32::Config; | ||
| 10 | use embassy_time::Timer; | 10 | use embassy_time::Timer; |
| 11 | use {defmt_rtt as _, panic_probe as _}; | 11 | use {defmt_rtt as _, panic_probe as _}; |
| 12 | 12 | ||
diff --git a/examples/stm32h7/src/bin/sdmmc.rs b/examples/stm32h7/src/bin/sdmmc.rs index 96840d8ff..4977fec79 100644 --- a/examples/stm32h7/src/bin/sdmmc.rs +++ b/examples/stm32h7/src/bin/sdmmc.rs | |||
| @@ -5,7 +5,7 @@ use defmt::*; | |||
| 5 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| 6 | use embassy_stm32::sdmmc::Sdmmc; | 6 | use embassy_stm32::sdmmc::Sdmmc; |
| 7 | use embassy_stm32::time::mhz; | 7 | use embassy_stm32::time::mhz; |
| 8 | use embassy_stm32::{bind_interrupts, peripherals, sdmmc, Config}; | 8 | use embassy_stm32::{Config, bind_interrupts, peripherals, sdmmc}; |
| 9 | use {defmt_rtt as _, panic_probe as _}; | 9 | use {defmt_rtt as _, panic_probe as _}; |
| 10 | 10 | ||
| 11 | bind_interrupts!(struct Irqs { | 11 | bind_interrupts!(struct Irqs { |
diff --git a/examples/stm32h7/src/bin/spi.rs b/examples/stm32h7/src/bin/spi.rs index dce30a4a7..61f31be24 100644 --- a/examples/stm32h7/src/bin/spi.rs +++ b/examples/stm32h7/src/bin/spi.rs | |||
| @@ -9,7 +9,7 @@ use defmt::*; | |||
| 9 | use embassy_executor::Executor; | 9 | use embassy_executor::Executor; |
| 10 | use embassy_stm32::mode::Blocking; | 10 | use embassy_stm32::mode::Blocking; |
| 11 | use embassy_stm32::time::mhz; | 11 | use embassy_stm32::time::mhz; |
| 12 | use embassy_stm32::{spi, Config}; | 12 | use embassy_stm32::{Config, spi}; |
| 13 | use heapless::String; | 13 | use heapless::String; |
| 14 | use static_cell::StaticCell; | 14 | use static_cell::StaticCell; |
| 15 | use {defmt_rtt as _, panic_probe as _}; | 15 | use {defmt_rtt as _, panic_probe as _}; |
diff --git a/examples/stm32h7/src/bin/spi_bdma.rs b/examples/stm32h7/src/bin/spi_bdma.rs index 828f687b8..be6a26d82 100644 --- a/examples/stm32h7/src/bin/spi_bdma.rs +++ b/examples/stm32h7/src/bin/spi_bdma.rs | |||
| @@ -9,7 +9,7 @@ use defmt::*; | |||
| 9 | use embassy_executor::Executor; | 9 | use embassy_executor::Executor; |
| 10 | use embassy_stm32::mode::Async; | 10 | use embassy_stm32::mode::Async; |
| 11 | use embassy_stm32::time::mhz; | 11 | use embassy_stm32::time::mhz; |
| 12 | use embassy_stm32::{spi, Config}; | 12 | use embassy_stm32::{Config, spi}; |
| 13 | use grounded::uninit::GroundedArrayCell; | 13 | use grounded::uninit::GroundedArrayCell; |
| 14 | use heapless::String; | 14 | use heapless::String; |
| 15 | use static_cell::StaticCell; | 15 | use static_cell::StaticCell; |
diff --git a/examples/stm32h7/src/bin/spi_dma.rs b/examples/stm32h7/src/bin/spi_dma.rs index 2197fabce..20cb67ba0 100644 --- a/examples/stm32h7/src/bin/spi_dma.rs +++ b/examples/stm32h7/src/bin/spi_dma.rs | |||
| @@ -9,7 +9,7 @@ use defmt::*; | |||
| 9 | use embassy_executor::Executor; | 9 | use embassy_executor::Executor; |
| 10 | use embassy_stm32::mode::Async; | 10 | use embassy_stm32::mode::Async; |
| 11 | use embassy_stm32::time::mhz; | 11 | use embassy_stm32::time::mhz; |
| 12 | use embassy_stm32::{spi, Config}; | 12 | use embassy_stm32::{Config, spi}; |
| 13 | use heapless::String; | 13 | use heapless::String; |
| 14 | use static_cell::StaticCell; | 14 | use static_cell::StaticCell; |
| 15 | use {defmt_rtt as _, panic_probe as _}; | 15 | use {defmt_rtt as _, panic_probe as _}; |
diff --git a/examples/stm32h7/src/bin/usb_serial.rs b/examples/stm32h7/src/bin/usb_serial.rs index 50bb964da..d0470101b 100644 --- a/examples/stm32h7/src/bin/usb_serial.rs +++ b/examples/stm32h7/src/bin/usb_serial.rs | |||
| @@ -5,10 +5,10 @@ use defmt::{panic, *}; | |||
| 5 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| 6 | use embassy_futures::join::join; | 6 | use embassy_futures::join::join; |
| 7 | use embassy_stm32::usb::{Driver, Instance}; | 7 | use embassy_stm32::usb::{Driver, Instance}; |
| 8 | use embassy_stm32::{bind_interrupts, peripherals, usb, Config}; | 8 | use embassy_stm32::{Config, bind_interrupts, peripherals, usb}; |
| 9 | use embassy_usb::Builder; | ||
| 9 | use embassy_usb::class::cdc_acm::{CdcAcmClass, State}; | 10 | use embassy_usb::class::cdc_acm::{CdcAcmClass, State}; |
| 10 | use embassy_usb::driver::EndpointError; | 11 | use embassy_usb::driver::EndpointError; |
| 11 | use embassy_usb::Builder; | ||
| 12 | use {defmt_rtt as _, panic_probe as _}; | 12 | use {defmt_rtt as _, panic_probe as _}; |
| 13 | 13 | ||
| 14 | bind_interrupts!(struct Irqs { | 14 | bind_interrupts!(struct Irqs { |
diff --git a/examples/stm32h723/src/bin/spdifrx.rs b/examples/stm32h723/src/bin/spdifrx.rs index b75a03ae8..cdbd69b89 100644 --- a/examples/stm32h723/src/bin/spdifrx.rs +++ b/examples/stm32h723/src/bin/spdifrx.rs | |||
| @@ -7,9 +7,9 @@ | |||
| 7 | 7 | ||
| 8 | use defmt::{info, trace}; | 8 | use defmt::{info, trace}; |
| 9 | use embassy_executor::Spawner; | 9 | use embassy_executor::Spawner; |
| 10 | use embassy_futures::select::{select, Either}; | 10 | use embassy_futures::select::{Either, select}; |
| 11 | use embassy_stm32::spdifrx::{self, Spdifrx}; | 11 | use embassy_stm32::spdifrx::{self, Spdifrx}; |
| 12 | use embassy_stm32::{bind_interrupts, peripherals, sai, Peri}; | 12 | use embassy_stm32::{Peri, bind_interrupts, peripherals, sai}; |
| 13 | use grounded::uninit::GroundedArrayCell; | 13 | use grounded::uninit::GroundedArrayCell; |
| 14 | use hal::sai::*; | 14 | use hal::sai::*; |
| 15 | use {defmt_rtt as _, embassy_stm32 as hal, panic_probe as _}; | 15 | use {defmt_rtt as _, embassy_stm32 as hal, panic_probe as _}; |
diff --git a/examples/stm32h735/src/bin/ltdc.rs b/examples/stm32h735/src/bin/ltdc.rs index 8a99f745d..f042e04c2 100644 --- a/examples/stm32h735/src/bin/ltdc.rs +++ b/examples/stm32h735/src/bin/ltdc.rs | |||
| @@ -15,14 +15,14 @@ use embassy_stm32::gpio::{Level, Output, Speed}; | |||
| 15 | use embassy_stm32::ltdc::{self, Ltdc, LtdcConfiguration, LtdcLayer, LtdcLayerConfig, PolarityActive, PolarityEdge}; | 15 | use embassy_stm32::ltdc::{self, Ltdc, LtdcConfiguration, LtdcLayer, LtdcLayerConfig, PolarityActive, PolarityEdge}; |
| 16 | use embassy_stm32::{bind_interrupts, peripherals}; | 16 | use embassy_stm32::{bind_interrupts, peripherals}; |
| 17 | use embassy_time::{Duration, Timer}; | 17 | use embassy_time::{Duration, Timer}; |
| 18 | use embedded_graphics::Pixel; | ||
| 18 | use embedded_graphics::draw_target::DrawTarget; | 19 | use embedded_graphics::draw_target::DrawTarget; |
| 19 | use embedded_graphics::geometry::{OriginDimensions, Point, Size}; | 20 | use embedded_graphics::geometry::{OriginDimensions, Point, Size}; |
| 20 | use embedded_graphics::image::Image; | 21 | use embedded_graphics::image::Image; |
| 21 | use embedded_graphics::pixelcolor::raw::RawU24; | ||
| 22 | use embedded_graphics::pixelcolor::Rgb888; | 22 | use embedded_graphics::pixelcolor::Rgb888; |
| 23 | use embedded_graphics::pixelcolor::raw::RawU24; | ||
| 23 | use embedded_graphics::prelude::*; | 24 | use embedded_graphics::prelude::*; |
| 24 | use embedded_graphics::primitives::Rectangle; | 25 | use embedded_graphics::primitives::Rectangle; |
| 25 | use embedded_graphics::Pixel; | ||
| 26 | use heapless::{Entry, FnvIndexMap}; | 26 | use heapless::{Entry, FnvIndexMap}; |
| 27 | use tinybmp::Bmp; | 27 | use tinybmp::Bmp; |
| 28 | use {defmt_rtt as _, panic_probe as _}; | 28 | use {defmt_rtt as _, panic_probe as _}; |
diff --git a/examples/stm32h742/src/bin/qspi.rs b/examples/stm32h742/src/bin/qspi.rs index 9e79d7089..a88c8f249 100644 --- a/examples/stm32h742/src/bin/qspi.rs +++ b/examples/stm32h742/src/bin/qspi.rs | |||
| @@ -4,10 +4,10 @@ | |||
| 4 | 4 | ||
| 5 | use defmt::info; | 5 | use defmt::info; |
| 6 | use embassy_executor::Spawner; | 6 | use embassy_executor::Spawner; |
| 7 | use embassy_stm32::Config as StmCfg; | ||
| 7 | use embassy_stm32::mode::Blocking; | 8 | use embassy_stm32::mode::Blocking; |
| 8 | use embassy_stm32::qspi::enums::{AddressSize, ChipSelectHighTime, FIFOThresholdLevel, MemorySize, *}; | 9 | use embassy_stm32::qspi::enums::{AddressSize, ChipSelectHighTime, FIFOThresholdLevel, MemorySize, *}; |
| 9 | use embassy_stm32::qspi::{Config as QspiCfg, Instance, Qspi, TransferConfig}; | 10 | use embassy_stm32::qspi::{Config as QspiCfg, Instance, Qspi, TransferConfig}; |
| 10 | use embassy_stm32::Config as StmCfg; | ||
| 11 | use {defmt_rtt as _, panic_probe as _}; | 11 | use {defmt_rtt as _, panic_probe as _}; |
| 12 | 12 | ||
| 13 | const MEMORY_PAGE_SIZE: usize = 256; | 13 | const MEMORY_PAGE_SIZE: usize = 256; |
diff --git a/examples/stm32h755cm4/src/bin/blinky.rs b/examples/stm32h755cm4/src/bin/blinky.rs index 39112c1f5..0ee3c68dc 100644 --- a/examples/stm32h755cm4/src/bin/blinky.rs +++ b/examples/stm32h755cm4/src/bin/blinky.rs | |||
| @@ -5,8 +5,8 @@ use core::mem::MaybeUninit; | |||
| 5 | 5 | ||
| 6 | use defmt::*; | 6 | use defmt::*; |
| 7 | use embassy_executor::Spawner; | 7 | use embassy_executor::Spawner; |
| 8 | use embassy_stm32::gpio::{Level, Output, Speed}; | ||
| 9 | use embassy_stm32::SharedData; | 8 | use embassy_stm32::SharedData; |
| 9 | use embassy_stm32::gpio::{Level, Output, Speed}; | ||
| 10 | use embassy_time::Timer; | 10 | use embassy_time::Timer; |
| 11 | use {defmt_rtt as _, panic_probe as _}; | 11 | use {defmt_rtt as _, panic_probe as _}; |
| 12 | 12 | ||
diff --git a/examples/stm32h755cm4/src/bin/intercore.rs b/examples/stm32h755cm4/src/bin/intercore.rs index d93d31786..c0db8cdd3 100644 --- a/examples/stm32h755cm4/src/bin/intercore.rs +++ b/examples/stm32h755cm4/src/bin/intercore.rs | |||
| @@ -93,8 +93,8 @@ use core::mem::MaybeUninit; | |||
| 93 | 93 | ||
| 94 | use defmt::*; | 94 | use defmt::*; |
| 95 | use embassy_executor::Spawner; | 95 | use embassy_executor::Spawner; |
| 96 | use embassy_stm32::gpio::{Level, Output, Speed}; | ||
| 97 | use embassy_stm32::SharedData; | 96 | use embassy_stm32::SharedData; |
| 97 | use embassy_stm32::gpio::{Level, Output, Speed}; | ||
| 98 | use embassy_time::Timer; | 98 | use embassy_time::Timer; |
| 99 | use shared::SHARED_LED_STATE; | 99 | use shared::SHARED_LED_STATE; |
| 100 | use {defmt_rtt as _, panic_probe as _}; | 100 | use {defmt_rtt as _, panic_probe as _}; |
diff --git a/examples/stm32h755cm7/src/bin/blinky.rs b/examples/stm32h755cm7/src/bin/blinky.rs index b30bf4de8..e8f5a1c43 100644 --- a/examples/stm32h755cm7/src/bin/blinky.rs +++ b/examples/stm32h755cm7/src/bin/blinky.rs | |||
| @@ -5,8 +5,8 @@ use core::mem::MaybeUninit; | |||
| 5 | 5 | ||
| 6 | use defmt::*; | 6 | use defmt::*; |
| 7 | use embassy_executor::Spawner; | 7 | use embassy_executor::Spawner; |
| 8 | use embassy_stm32::gpio::{Level, Output, Speed}; | ||
| 9 | use embassy_stm32::SharedData; | 8 | use embassy_stm32::SharedData; |
| 9 | use embassy_stm32::gpio::{Level, Output, Speed}; | ||
| 10 | use embassy_time::Timer; | 10 | use embassy_time::Timer; |
| 11 | use {defmt_rtt as _, panic_probe as _}; | 11 | use {defmt_rtt as _, panic_probe as _}; |
| 12 | 12 | ||
diff --git a/examples/stm32h7b0/src/bin/ospi_memory_mapped.rs b/examples/stm32h7b0/src/bin/ospi_memory_mapped.rs index dffb740a9..865062f4b 100644 --- a/examples/stm32h7b0/src/bin/ospi_memory_mapped.rs +++ b/examples/stm32h7b0/src/bin/ospi_memory_mapped.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | 5 | ||
| 6 | use defmt::info; | 6 | use defmt::info; |
| 7 | use embassy_executor::Spawner; | 7 | use embassy_executor::Spawner; |
| 8 | use embassy_stm32::Config; | ||
| 8 | use embassy_stm32::gpio::{Level, Output, Speed}; | 9 | use embassy_stm32::gpio::{Level, Output, Speed}; |
| 9 | use embassy_stm32::mode::Blocking; | 10 | use embassy_stm32::mode::Blocking; |
| 10 | use embassy_stm32::ospi::{ | 11 | use embassy_stm32::ospi::{ |
| @@ -12,7 +13,6 @@ use embassy_stm32::ospi::{ | |||
| 12 | OspiWidth, TransferConfig, WrapSize, | 13 | OspiWidth, TransferConfig, WrapSize, |
| 13 | }; | 14 | }; |
| 14 | use embassy_stm32::time::Hertz; | 15 | use embassy_stm32::time::Hertz; |
| 15 | use embassy_stm32::Config; | ||
| 16 | use embassy_time::Timer; | 16 | use embassy_time::Timer; |
| 17 | use {defmt_rtt as _, panic_probe as _}; | 17 | use {defmt_rtt as _, panic_probe as _}; |
| 18 | 18 | ||
diff --git a/examples/stm32h7rs/src/bin/blinky.rs b/examples/stm32h7rs/src/bin/blinky.rs index 5fd50fb15..4c0864ff6 100644 --- a/examples/stm32h7rs/src/bin/blinky.rs +++ b/examples/stm32h7rs/src/bin/blinky.rs | |||
| @@ -3,9 +3,9 @@ | |||
| 3 | 3 | ||
| 4 | use defmt::*; | 4 | use defmt::*; |
| 5 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| 6 | use embassy_stm32::Config; | ||
| 6 | use embassy_stm32::gpio::{Level, Output, Speed}; | 7 | use embassy_stm32::gpio::{Level, Output, Speed}; |
| 7 | use embassy_stm32::time::Hertz; | 8 | use embassy_stm32::time::Hertz; |
| 8 | use embassy_stm32::Config; | ||
| 9 | use embassy_time::Timer; | 9 | use embassy_time::Timer; |
| 10 | use {defmt_rtt as _, panic_probe as _}; | 10 | use {defmt_rtt as _, panic_probe as _}; |
| 11 | 11 | ||
diff --git a/examples/stm32h7rs/src/bin/can.rs b/examples/stm32h7rs/src/bin/can.rs index 0af11ef3e..49830f9b7 100644 --- a/examples/stm32h7rs/src/bin/can.rs +++ b/examples/stm32h7rs/src/bin/can.rs | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | use defmt::*; | 4 | use defmt::*; |
| 5 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| 6 | use embassy_stm32::peripherals::*; | 6 | use embassy_stm32::peripherals::*; |
| 7 | use embassy_stm32::{bind_interrupts, can, rcc, Config}; | 7 | use embassy_stm32::{Config, bind_interrupts, can, rcc}; |
| 8 | use embassy_time::Timer; | 8 | use embassy_time::Timer; |
| 9 | use {defmt_rtt as _, panic_probe as _}; | 9 | use {defmt_rtt as _, panic_probe as _}; |
| 10 | 10 | ||
diff --git a/examples/stm32h7rs/src/bin/eth.rs b/examples/stm32h7rs/src/bin/eth.rs index 67f541564..5ce1d4765 100644 --- a/examples/stm32h7rs/src/bin/eth.rs +++ b/examples/stm32h7rs/src/bin/eth.rs | |||
| @@ -8,7 +8,7 @@ use embassy_net::{Ipv4Address, Ipv4Cidr, StackResources}; | |||
| 8 | use embassy_stm32::eth::{Ethernet, GenericPhy, PacketQueue}; | 8 | use embassy_stm32::eth::{Ethernet, GenericPhy, PacketQueue}; |
| 9 | use embassy_stm32::peripherals::ETH; | 9 | use embassy_stm32::peripherals::ETH; |
| 10 | use embassy_stm32::rng::Rng; | 10 | use embassy_stm32::rng::Rng; |
| 11 | use embassy_stm32::{bind_interrupts, eth, peripherals, rng, Config}; | 11 | use embassy_stm32::{Config, bind_interrupts, eth, peripherals, rng}; |
| 12 | use embassy_time::Timer; | 12 | use embassy_time::Timer; |
| 13 | use heapless::Vec; | 13 | use heapless::Vec; |
| 14 | use static_cell::StaticCell; | 14 | use static_cell::StaticCell; |
diff --git a/examples/stm32h7rs/src/bin/rng.rs b/examples/stm32h7rs/src/bin/rng.rs index a9ef7200d..489747678 100644 --- a/examples/stm32h7rs/src/bin/rng.rs +++ b/examples/stm32h7rs/src/bin/rng.rs | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | use defmt::*; | 4 | use defmt::*; |
| 5 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| 6 | use embassy_stm32::rng::Rng; | 6 | use embassy_stm32::rng::Rng; |
| 7 | use embassy_stm32::{bind_interrupts, peripherals, rng, Config}; | 7 | use embassy_stm32::{Config, bind_interrupts, peripherals, rng}; |
| 8 | use {defmt_rtt as _, panic_probe as _}; | 8 | use {defmt_rtt as _, panic_probe as _}; |
| 9 | 9 | ||
| 10 | bind_interrupts!(struct Irqs { | 10 | bind_interrupts!(struct Irqs { |
diff --git a/examples/stm32h7rs/src/bin/rtc.rs b/examples/stm32h7rs/src/bin/rtc.rs index 0adb48877..1bd71637b 100644 --- a/examples/stm32h7rs/src/bin/rtc.rs +++ b/examples/stm32h7rs/src/bin/rtc.rs | |||
| @@ -4,9 +4,9 @@ | |||
| 4 | use chrono::{NaiveDate, NaiveDateTime}; | 4 | use chrono::{NaiveDate, NaiveDateTime}; |
| 5 | use defmt::*; | 5 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 6 | use embassy_executor::Spawner; |
| 7 | use embassy_stm32::Config; | ||
| 7 | use embassy_stm32::rcc::LsConfig; | 8 | use embassy_stm32::rcc::LsConfig; |
| 8 | use embassy_stm32::rtc::{Rtc, RtcConfig}; | 9 | use embassy_stm32::rtc::{Rtc, RtcConfig}; |
| 9 | use embassy_stm32::Config; | ||
| 10 | use embassy_time::Timer; | 10 | use embassy_time::Timer; |
| 11 | use {defmt_rtt as _, panic_probe as _}; | 11 | use {defmt_rtt as _, panic_probe as _}; |
| 12 | 12 | ||
diff --git a/examples/stm32h7rs/src/bin/usb_serial.rs b/examples/stm32h7rs/src/bin/usb_serial.rs index 23abc3e2f..3e295dd51 100644 --- a/examples/stm32h7rs/src/bin/usb_serial.rs +++ b/examples/stm32h7rs/src/bin/usb_serial.rs | |||
| @@ -6,10 +6,10 @@ use embassy_executor::Spawner; | |||
| 6 | use embassy_futures::join::join; | 6 | use embassy_futures::join::join; |
| 7 | use embassy_stm32::time::Hertz; | 7 | use embassy_stm32::time::Hertz; |
| 8 | use embassy_stm32::usb::{Driver, Instance}; | 8 | use embassy_stm32::usb::{Driver, Instance}; |
| 9 | use embassy_stm32::{bind_interrupts, peripherals, usb, Config}; | 9 | use embassy_stm32::{Config, bind_interrupts, peripherals, usb}; |
| 10 | use embassy_usb::Builder; | ||
| 10 | use embassy_usb::class::cdc_acm::{CdcAcmClass, State}; | 11 | use embassy_usb::class::cdc_acm::{CdcAcmClass, State}; |
| 11 | use embassy_usb::driver::EndpointError; | 12 | use embassy_usb::driver::EndpointError; |
| 12 | use embassy_usb::Builder; | ||
| 13 | use {defmt_rtt as _, panic_probe as _}; | 13 | use {defmt_rtt as _, panic_probe as _}; |
| 14 | 14 | ||
| 15 | bind_interrupts!(struct Irqs { | 15 | bind_interrupts!(struct Irqs { |
diff --git a/examples/stm32h7rs/src/bin/xspi_memory_mapped.rs b/examples/stm32h7rs/src/bin/xspi_memory_mapped.rs index 4c1b450b4..d91ae9de0 100644 --- a/examples/stm32h7rs/src/bin/xspi_memory_mapped.rs +++ b/examples/stm32h7rs/src/bin/xspi_memory_mapped.rs | |||
| @@ -8,6 +8,7 @@ use core::cmp::min; | |||
| 8 | 8 | ||
| 9 | use defmt::info; | 9 | use defmt::info; |
| 10 | use embassy_executor::Spawner; | 10 | use embassy_executor::Spawner; |
| 11 | use embassy_stm32::Config; | ||
| 11 | use embassy_stm32::gpio::{Level, Output, Speed}; | 12 | use embassy_stm32::gpio::{Level, Output, Speed}; |
| 12 | use embassy_stm32::mode::Blocking; | 13 | use embassy_stm32::mode::Blocking; |
| 13 | use embassy_stm32::time::Hertz; | 14 | use embassy_stm32::time::Hertz; |
| @@ -15,7 +16,6 @@ use embassy_stm32::xspi::{ | |||
| 15 | AddressSize, ChipSelectHighTime, DummyCycles, FIFOThresholdLevel, Instance, MemorySize, MemoryType, TransferConfig, | 16 | AddressSize, ChipSelectHighTime, DummyCycles, FIFOThresholdLevel, Instance, MemorySize, MemoryType, TransferConfig, |
| 16 | WrapSize, Xspi, XspiWidth, | 17 | WrapSize, Xspi, XspiWidth, |
| 17 | }; | 18 | }; |
| 18 | use embassy_stm32::Config; | ||
| 19 | use embassy_time::Timer; | 19 | use embassy_time::Timer; |
| 20 | use {defmt_rtt as _, panic_probe as _}; | 20 | use {defmt_rtt as _, panic_probe as _}; |
| 21 | 21 | ||
diff --git a/examples/stm32l0/src/bin/button_exti.rs b/examples/stm32l0/src/bin/button_exti.rs index 4945da7ce..7ff4a7d52 100644 --- a/examples/stm32l0/src/bin/button_exti.rs +++ b/examples/stm32l0/src/bin/button_exti.rs | |||
| @@ -3,9 +3,9 @@ | |||
| 3 | 3 | ||
| 4 | use defmt::*; | 4 | use defmt::*; |
| 5 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| 6 | use embassy_stm32::Config; | ||
| 6 | use embassy_stm32::exti::ExtiInput; | 7 | use embassy_stm32::exti::ExtiInput; |
| 7 | use embassy_stm32::gpio::Pull; | 8 | use embassy_stm32::gpio::Pull; |
| 8 | use embassy_stm32::Config; | ||
| 9 | use {defmt_rtt as _, panic_probe as _}; | 9 | use {defmt_rtt as _, panic_probe as _}; |
| 10 | 10 | ||
| 11 | #[embassy_executor::main] | 11 | #[embassy_executor::main] |
diff --git a/examples/stm32l0/src/bin/dds.rs b/examples/stm32l0/src/bin/dds.rs index eaa7a61a8..d8f9020d4 100644 --- a/examples/stm32l0/src/bin/dds.rs +++ b/examples/stm32l0/src/bin/dds.rs | |||
| @@ -12,7 +12,7 @@ use embassy_stm32::time::hz; | |||
| 12 | use embassy_stm32::timer::low_level::{Timer as LLTimer, *}; | 12 | use embassy_stm32::timer::low_level::{Timer as LLTimer, *}; |
| 13 | use embassy_stm32::timer::simple_pwm::PwmPin; | 13 | use embassy_stm32::timer::simple_pwm::PwmPin; |
| 14 | use embassy_stm32::timer::{Ch3, Channel}; | 14 | use embassy_stm32::timer::{Ch3, Channel}; |
| 15 | use embassy_stm32::{interrupt, pac, Config}; | 15 | use embassy_stm32::{Config, interrupt, pac}; |
| 16 | use panic_probe as _; | 16 | use panic_probe as _; |
| 17 | 17 | ||
| 18 | const DDS_SINE_DATA: [u8; 256] = [ | 18 | const DDS_SINE_DATA: [u8; 256] = [ |
diff --git a/examples/stm32l0/src/bin/eeprom.rs b/examples/stm32l0/src/bin/eeprom.rs index 370246644..a33088f36 100644 --- a/examples/stm32l0/src/bin/eeprom.rs +++ b/examples/stm32l0/src/bin/eeprom.rs | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | 3 | ||
| 4 | use defmt::{info, unwrap}; | 4 | use defmt::{info, unwrap}; |
| 5 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| 6 | use embassy_stm32::flash::{Flash, EEPROM_BASE, EEPROM_SIZE}; | 6 | use embassy_stm32::flash::{EEPROM_BASE, EEPROM_SIZE, Flash}; |
| 7 | use {defmt_rtt as _, panic_probe as _}; | 7 | use {defmt_rtt as _, panic_probe as _}; |
| 8 | 8 | ||
| 9 | #[embassy_executor::main] | 9 | #[embassy_executor::main] |
diff --git a/examples/stm32l0/src/bin/raw_spawn.rs b/examples/stm32l0/src/bin/raw_spawn.rs index 7eea910ca..8e8fe0240 100644 --- a/examples/stm32l0/src/bin/raw_spawn.rs +++ b/examples/stm32l0/src/bin/raw_spawn.rs | |||
| @@ -5,8 +5,8 @@ use core::mem; | |||
| 5 | 5 | ||
| 6 | use cortex_m_rt::entry; | 6 | use cortex_m_rt::entry; |
| 7 | use defmt::*; | 7 | use defmt::*; |
| 8 | use embassy_executor::raw::TaskStorage; | ||
| 9 | use embassy_executor::Executor; | 8 | use embassy_executor::Executor; |
| 9 | use embassy_executor::raw::TaskStorage; | ||
| 10 | use embassy_time::Timer; | 10 | use embassy_time::Timer; |
| 11 | use static_cell::StaticCell; | 11 | use static_cell::StaticCell; |
| 12 | use {defmt_rtt as _, panic_probe as _}; | 12 | use {defmt_rtt as _, panic_probe as _}; |
diff --git a/examples/stm32l0/src/bin/usb_serial.rs b/examples/stm32l0/src/bin/usb_serial.rs index fdb1aeb59..612082f29 100644 --- a/examples/stm32l0/src/bin/usb_serial.rs +++ b/examples/stm32l0/src/bin/usb_serial.rs | |||
| @@ -6,9 +6,9 @@ use embassy_executor::Spawner; | |||
| 6 | use embassy_futures::join::join; | 6 | use embassy_futures::join::join; |
| 7 | use embassy_stm32::usb::{self, Driver, Instance}; | 7 | use embassy_stm32::usb::{self, Driver, Instance}; |
| 8 | use embassy_stm32::{bind_interrupts, peripherals}; | 8 | use embassy_stm32::{bind_interrupts, peripherals}; |
| 9 | use embassy_usb::Builder; | ||
| 9 | use embassy_usb::class::cdc_acm::{CdcAcmClass, State}; | 10 | use embassy_usb::class::cdc_acm::{CdcAcmClass, State}; |
| 10 | use embassy_usb::driver::EndpointError; | 11 | use embassy_usb::driver::EndpointError; |
| 11 | use embassy_usb::Builder; | ||
| 12 | use {defmt_rtt as _, panic_probe as _}; | 12 | use {defmt_rtt as _, panic_probe as _}; |
| 13 | 13 | ||
| 14 | bind_interrupts!(struct Irqs { | 14 | bind_interrupts!(struct Irqs { |
diff --git a/examples/stm32l1/src/bin/eeprom.rs b/examples/stm32l1/src/bin/eeprom.rs index 370246644..a33088f36 100644 --- a/examples/stm32l1/src/bin/eeprom.rs +++ b/examples/stm32l1/src/bin/eeprom.rs | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | 3 | ||
| 4 | use defmt::{info, unwrap}; | 4 | use defmt::{info, unwrap}; |
| 5 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| 6 | use embassy_stm32::flash::{Flash, EEPROM_BASE, EEPROM_SIZE}; | 6 | use embassy_stm32::flash::{EEPROM_BASE, EEPROM_SIZE, Flash}; |
| 7 | use {defmt_rtt as _, panic_probe as _}; | 7 | use {defmt_rtt as _, panic_probe as _}; |
| 8 | 8 | ||
| 9 | #[embassy_executor::main] | 9 | #[embassy_executor::main] |
diff --git a/examples/stm32l1/src/bin/usb_serial.rs b/examples/stm32l1/src/bin/usb_serial.rs index a35f1d7a7..c54d37f9d 100644 --- a/examples/stm32l1/src/bin/usb_serial.rs +++ b/examples/stm32l1/src/bin/usb_serial.rs | |||
| @@ -6,9 +6,9 @@ use embassy_executor::Spawner; | |||
| 6 | use embassy_futures::join::join; | 6 | use embassy_futures::join::join; |
| 7 | use embassy_stm32::usb::{self, Driver, Instance}; | 7 | use embassy_stm32::usb::{self, Driver, Instance}; |
| 8 | use embassy_stm32::{bind_interrupts, peripherals}; | 8 | use embassy_stm32::{bind_interrupts, peripherals}; |
| 9 | use embassy_usb::Builder; | ||
| 9 | use embassy_usb::class::cdc_acm::{CdcAcmClass, State}; | 10 | use embassy_usb::class::cdc_acm::{CdcAcmClass, State}; |
| 10 | use embassy_usb::driver::EndpointError; | 11 | use embassy_usb::driver::EndpointError; |
| 11 | use embassy_usb::Builder; | ||
| 12 | use {defmt_rtt as _, panic_probe as _}; | 12 | use {defmt_rtt as _, panic_probe as _}; |
| 13 | 13 | ||
| 14 | bind_interrupts!(struct Irqs { | 14 | bind_interrupts!(struct Irqs { |
diff --git a/examples/stm32l4/src/bin/adc.rs b/examples/stm32l4/src/bin/adc.rs index c557ac6d7..40e907940 100644 --- a/examples/stm32l4/src/bin/adc.rs +++ b/examples/stm32l4/src/bin/adc.rs | |||
| @@ -2,8 +2,8 @@ | |||
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | 3 | ||
| 4 | use defmt::*; | 4 | use defmt::*; |
| 5 | use embassy_stm32::adc::{Adc, Resolution}; | ||
| 6 | use embassy_stm32::Config; | 5 | use embassy_stm32::Config; |
| 6 | use embassy_stm32::adc::{Adc, Resolution}; | ||
| 7 | use {defmt_rtt as _, panic_probe as _}; | 7 | use {defmt_rtt as _, panic_probe as _}; |
| 8 | 8 | ||
| 9 | #[cortex_m_rt::entry] | 9 | #[cortex_m_rt::entry] |
diff --git a/examples/stm32l4/src/bin/can.rs b/examples/stm32l4/src/bin/can.rs index 3c4cdac24..bd361417e 100644 --- a/examples/stm32l4/src/bin/can.rs +++ b/examples/stm32l4/src/bin/can.rs | |||
| @@ -8,7 +8,7 @@ use embassy_stm32::can::{ | |||
| 8 | Can, Fifo, Frame, Rx0InterruptHandler, Rx1InterruptHandler, SceInterruptHandler, TxInterruptHandler, | 8 | Can, Fifo, Frame, Rx0InterruptHandler, Rx1InterruptHandler, SceInterruptHandler, TxInterruptHandler, |
| 9 | }; | 9 | }; |
| 10 | use embassy_stm32::peripherals::CAN1; | 10 | use embassy_stm32::peripherals::CAN1; |
| 11 | use embassy_stm32::{bind_interrupts, Config}; | 11 | use embassy_stm32::{Config, bind_interrupts}; |
| 12 | use embassy_time::Timer; | 12 | use embassy_time::Timer; |
| 13 | use {defmt_rtt as _, panic_probe as _}; | 13 | use {defmt_rtt as _, panic_probe as _}; |
| 14 | 14 | ||
diff --git a/examples/stm32l4/src/bin/dac_dma.rs b/examples/stm32l4/src/bin/dac_dma.rs index 44edec728..bfdf858c5 100644 --- a/examples/stm32l4/src/bin/dac_dma.rs +++ b/examples/stm32l4/src/bin/dac_dma.rs | |||
| @@ -3,6 +3,7 @@ | |||
| 3 | 3 | ||
| 4 | use defmt::*; | 4 | use defmt::*; |
| 5 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| 6 | use embassy_stm32::Peri; | ||
| 6 | use embassy_stm32::dac::{DacCh1, DacCh2, ValueArray}; | 7 | use embassy_stm32::dac::{DacCh1, DacCh2, ValueArray}; |
| 7 | use embassy_stm32::mode::Async; | 8 | use embassy_stm32::mode::Async; |
| 8 | use embassy_stm32::pac::timer::vals::Mms; | 9 | use embassy_stm32::pac::timer::vals::Mms; |
| @@ -10,7 +11,6 @@ use embassy_stm32::peripherals::{DAC1, TIM6, TIM7}; | |||
| 10 | use embassy_stm32::rcc::frequency; | 11 | use embassy_stm32::rcc::frequency; |
| 11 | use embassy_stm32::time::Hertz; | 12 | use embassy_stm32::time::Hertz; |
| 12 | use embassy_stm32::timer::low_level::Timer; | 13 | use embassy_stm32::timer::low_level::Timer; |
| 13 | use embassy_stm32::Peri; | ||
| 14 | use micromath::F32Ext; | 14 | use micromath::F32Ext; |
| 15 | use {defmt_rtt as _, panic_probe as _}; | 15 | use {defmt_rtt as _, panic_probe as _}; |
| 16 | 16 | ||
diff --git a/examples/stm32l4/src/bin/rng.rs b/examples/stm32l4/src/bin/rng.rs index 14d0e3c1e..4d9f83ad8 100644 --- a/examples/stm32l4/src/bin/rng.rs +++ b/examples/stm32l4/src/bin/rng.rs | |||
| @@ -5,7 +5,7 @@ use defmt::*; | |||
| 5 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| 6 | use embassy_stm32::rcc::{Pll, PllMul, PllPreDiv, PllQDiv, PllRDiv, PllSource, Sysclk}; | 6 | use embassy_stm32::rcc::{Pll, PllMul, PllPreDiv, PllQDiv, PllRDiv, PllSource, Sysclk}; |
| 7 | use embassy_stm32::rng::Rng; | 7 | use embassy_stm32::rng::Rng; |
| 8 | use embassy_stm32::{bind_interrupts, peripherals, rng, Config}; | 8 | use embassy_stm32::{Config, bind_interrupts, peripherals, rng}; |
| 9 | use {defmt_rtt as _, panic_probe as _}; | 9 | use {defmt_rtt as _, panic_probe as _}; |
| 10 | 10 | ||
| 11 | bind_interrupts!(struct Irqs { | 11 | bind_interrupts!(struct Irqs { |
diff --git a/examples/stm32l4/src/bin/rtc.rs b/examples/stm32l4/src/bin/rtc.rs index f554f0f78..1d26cd008 100644 --- a/examples/stm32l4/src/bin/rtc.rs +++ b/examples/stm32l4/src/bin/rtc.rs | |||
| @@ -4,9 +4,9 @@ | |||
| 4 | use chrono::{NaiveDate, NaiveDateTime}; | 4 | use chrono::{NaiveDate, NaiveDateTime}; |
| 5 | use defmt::*; | 5 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 6 | use embassy_executor::Spawner; |
| 7 | use embassy_stm32::Config; | ||
| 7 | use embassy_stm32::rtc::{Rtc, RtcConfig}; | 8 | use embassy_stm32::rtc::{Rtc, RtcConfig}; |
| 8 | use embassy_stm32::time::Hertz; | 9 | use embassy_stm32::time::Hertz; |
| 9 | use embassy_stm32::Config; | ||
| 10 | use embassy_time::Timer; | 10 | use embassy_time::Timer; |
| 11 | use {defmt_rtt as _, panic_probe as _}; | 11 | use {defmt_rtt as _, panic_probe as _}; |
| 12 | 12 | ||
diff --git a/examples/stm32l4/src/bin/spe_adin1110_http_server.rs b/examples/stm32l4/src/bin/spe_adin1110_http_server.rs index 24efe526f..8e54938d1 100644 --- a/examples/stm32l4/src/bin/spe_adin1110_http_server.rs +++ b/examples/stm32l4/src/bin/spe_adin1110_http_server.rs | |||
| @@ -16,14 +16,14 @@ | |||
| 16 | use core::marker::PhantomData; | 16 | use core::marker::PhantomData; |
| 17 | use core::sync::atomic::{AtomicI32, Ordering}; | 17 | use core::sync::atomic::{AtomicI32, Ordering}; |
| 18 | 18 | ||
| 19 | use defmt::{error, info, println, unwrap, Format}; | 19 | use defmt::{Format, error, info, println, unwrap}; |
| 20 | use defmt_rtt as _; // global logger | 20 | use defmt_rtt as _; // global logger |
| 21 | use embassy_executor::Spawner; | 21 | use embassy_executor::Spawner; |
| 22 | use embassy_futures::select::{select, Either}; | 22 | use embassy_futures::select::{Either, select}; |
| 23 | use embassy_futures::yield_now; | 23 | use embassy_futures::yield_now; |
| 24 | use embassy_net::tcp::TcpSocket; | 24 | use embassy_net::tcp::TcpSocket; |
| 25 | use embassy_net::{Ipv4Address, Ipv4Cidr, Stack, StackResources, StaticConfigV4}; | 25 | use embassy_net::{Ipv4Address, Ipv4Cidr, Stack, StackResources, StaticConfigV4}; |
| 26 | use embassy_net_adin1110::{Device, Runner, ADIN1110}; | 26 | use embassy_net_adin1110::{ADIN1110, Device, Runner}; |
| 27 | use embassy_stm32::gpio::{Input, Level, Output, Pull, Speed}; | 27 | use embassy_stm32::gpio::{Input, Level, Output, Pull, Speed}; |
| 28 | use embassy_stm32::i2c::{self, Config as I2C_Config, I2c}; | 28 | use embassy_stm32::i2c::{self, Config as I2C_Config, I2c}; |
| 29 | use embassy_stm32::mode::Async; | 29 | use embassy_stm32::mode::Async; |
| @@ -159,7 +159,9 @@ async fn main(spawner: Spawner) { | |||
| 159 | 159 | ||
| 160 | // Check the SPI mode selected with the "HW CFG" dip-switch | 160 | // Check the SPI mode selected with the "HW CFG" dip-switch |
| 161 | if !cfg1_spi_mode { | 161 | if !cfg1_spi_mode { |
| 162 | error!("Driver doesn´t support SPI Protolcol \"OPEN Alliance\".\nplease use the \"Generic SPI\"! Turn On \"HW CFG\": \"SPI_CFG1\""); | 162 | error!( |
| 163 | "Driver doesn´t support SPI Protolcol \"OPEN Alliance\".\nplease use the \"Generic SPI\"! Turn On \"HW CFG\": \"SPI_CFG1\"" | ||
| 164 | ); | ||
| 163 | loop { | 165 | loop { |
| 164 | led_uc2_red.toggle(); | 166 | led_uc2_red.toggle(); |
| 165 | Timer::after(Duration::from_hz(10)).await; | 167 | Timer::after(Duration::from_hz(10)).await; |
diff --git a/examples/stm32l4/src/bin/usb_serial.rs b/examples/stm32l4/src/bin/usb_serial.rs index af90e297e..17cd107f6 100644 --- a/examples/stm32l4/src/bin/usb_serial.rs +++ b/examples/stm32l4/src/bin/usb_serial.rs | |||
| @@ -6,10 +6,10 @@ use defmt_rtt as _; // global logger | |||
| 6 | use embassy_executor::Spawner; | 6 | use embassy_executor::Spawner; |
| 7 | use embassy_futures::join::join; | 7 | use embassy_futures::join::join; |
| 8 | use embassy_stm32::usb::{Driver, Instance}; | 8 | use embassy_stm32::usb::{Driver, Instance}; |
| 9 | use embassy_stm32::{bind_interrupts, peripherals, usb, Config}; | 9 | use embassy_stm32::{Config, bind_interrupts, peripherals, usb}; |
| 10 | use embassy_usb::Builder; | ||
| 10 | use embassy_usb::class::cdc_acm::{CdcAcmClass, State}; | 11 | use embassy_usb::class::cdc_acm::{CdcAcmClass, State}; |
| 11 | use embassy_usb::driver::EndpointError; | 12 | use embassy_usb::driver::EndpointError; |
| 12 | use embassy_usb::Builder; | ||
| 13 | use panic_probe as _; | 13 | use panic_probe as _; |
| 14 | 14 | ||
| 15 | bind_interrupts!(struct Irqs { | 15 | bind_interrupts!(struct Irqs { |
diff --git a/examples/stm32l5/src/bin/rng.rs b/examples/stm32l5/src/bin/rng.rs index 0a644e73d..d6302e106 100644 --- a/examples/stm32l5/src/bin/rng.rs +++ b/examples/stm32l5/src/bin/rng.rs | |||
| @@ -5,7 +5,7 @@ use defmt::*; | |||
| 5 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| 6 | use embassy_stm32::rcc::{Pll, PllMul, PllPreDiv, PllRDiv, PllSource, Sysclk}; | 6 | use embassy_stm32::rcc::{Pll, PllMul, PllPreDiv, PllRDiv, PllSource, Sysclk}; |
| 7 | use embassy_stm32::rng::Rng; | 7 | use embassy_stm32::rng::Rng; |
| 8 | use embassy_stm32::{bind_interrupts, peripherals, rng, Config}; | 8 | use embassy_stm32::{Config, bind_interrupts, peripherals, rng}; |
| 9 | use {defmt_rtt as _, panic_probe as _}; | 9 | use {defmt_rtt as _, panic_probe as _}; |
| 10 | 10 | ||
| 11 | bind_interrupts!(struct Irqs { | 11 | bind_interrupts!(struct Irqs { |
diff --git a/examples/stm32l5/src/bin/usb_ethernet.rs b/examples/stm32l5/src/bin/usb_ethernet.rs index 25aa9ef69..d2cbeb550 100644 --- a/examples/stm32l5/src/bin/usb_ethernet.rs +++ b/examples/stm32l5/src/bin/usb_ethernet.rs | |||
| @@ -3,11 +3,11 @@ | |||
| 3 | 3 | ||
| 4 | use defmt::*; | 4 | use defmt::*; |
| 5 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| 6 | use embassy_net::tcp::TcpSocket; | ||
| 7 | use embassy_net::StackResources; | 6 | use embassy_net::StackResources; |
| 7 | use embassy_net::tcp::TcpSocket; | ||
| 8 | use embassy_stm32::rng::Rng; | 8 | use embassy_stm32::rng::Rng; |
| 9 | use embassy_stm32::usb::Driver; | 9 | use embassy_stm32::usb::Driver; |
| 10 | use embassy_stm32::{bind_interrupts, peripherals, rng, usb, Config}; | 10 | use embassy_stm32::{Config, bind_interrupts, peripherals, rng, usb}; |
| 11 | use embassy_usb::class::cdc_ncm::embassy_net::{Device, Runner, State as NetState}; | 11 | use embassy_usb::class::cdc_ncm::embassy_net::{Device, Runner, State as NetState}; |
| 12 | use embassy_usb::class::cdc_ncm::{CdcNcmClass, State}; | 12 | use embassy_usb::class::cdc_ncm::{CdcNcmClass, State}; |
| 13 | use embassy_usb::{Builder, UsbDevice}; | 13 | use embassy_usb::{Builder, UsbDevice}; |
diff --git a/examples/stm32l5/src/bin/usb_hid_mouse.rs b/examples/stm32l5/src/bin/usb_hid_mouse.rs index 3f8c52b82..b721f5b2e 100644 --- a/examples/stm32l5/src/bin/usb_hid_mouse.rs +++ b/examples/stm32l5/src/bin/usb_hid_mouse.rs | |||
| @@ -5,11 +5,11 @@ use defmt::*; | |||
| 5 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| 6 | use embassy_futures::join::join; | 6 | use embassy_futures::join::join; |
| 7 | use embassy_stm32::usb::Driver; | 7 | use embassy_stm32::usb::Driver; |
| 8 | use embassy_stm32::{bind_interrupts, peripherals, usb, Config}; | 8 | use embassy_stm32::{Config, bind_interrupts, peripherals, usb}; |
| 9 | use embassy_time::Timer; | 9 | use embassy_time::Timer; |
| 10 | use embassy_usb::Builder; | ||
| 10 | use embassy_usb::class::hid::{HidWriter, ReportId, RequestHandler, State}; | 11 | use embassy_usb::class::hid::{HidWriter, ReportId, RequestHandler, State}; |
| 11 | use embassy_usb::control::OutResponse; | 12 | use embassy_usb::control::OutResponse; |
| 12 | use embassy_usb::Builder; | ||
| 13 | use usbd_hid::descriptor::{MouseReport, SerializedDescriptor}; | 13 | use usbd_hid::descriptor::{MouseReport, SerializedDescriptor}; |
| 14 | use {defmt_rtt as _, panic_probe as _}; | 14 | use {defmt_rtt as _, panic_probe as _}; |
| 15 | 15 | ||
diff --git a/examples/stm32l5/src/bin/usb_serial.rs b/examples/stm32l5/src/bin/usb_serial.rs index a64bda31b..4f77fc1d7 100644 --- a/examples/stm32l5/src/bin/usb_serial.rs +++ b/examples/stm32l5/src/bin/usb_serial.rs | |||
| @@ -5,10 +5,10 @@ use defmt::{panic, *}; | |||
| 5 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| 6 | use embassy_futures::join::join; | 6 | use embassy_futures::join::join; |
| 7 | use embassy_stm32::usb::{Driver, Instance}; | 7 | use embassy_stm32::usb::{Driver, Instance}; |
| 8 | use embassy_stm32::{bind_interrupts, peripherals, usb, Config}; | 8 | use embassy_stm32::{Config, bind_interrupts, peripherals, usb}; |
| 9 | use embassy_usb::Builder; | ||
| 9 | use embassy_usb::class::cdc_acm::{CdcAcmClass, State}; | 10 | use embassy_usb::class::cdc_acm::{CdcAcmClass, State}; |
| 10 | use embassy_usb::driver::EndpointError; | 11 | use embassy_usb::driver::EndpointError; |
| 11 | use embassy_usb::Builder; | ||
| 12 | use {defmt_rtt as _, panic_probe as _}; | 12 | use {defmt_rtt as _, panic_probe as _}; |
| 13 | 13 | ||
| 14 | bind_interrupts!(struct Irqs { | 14 | bind_interrupts!(struct Irqs { |
diff --git a/examples/stm32u0/src/bin/adc.rs b/examples/stm32u0/src/bin/adc.rs index c8252e4e1..32a54299d 100644 --- a/examples/stm32u0/src/bin/adc.rs +++ b/examples/stm32u0/src/bin/adc.rs | |||
| @@ -2,8 +2,8 @@ | |||
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | 3 | ||
| 4 | use defmt::*; | 4 | use defmt::*; |
| 5 | use embassy_stm32::adc::{Adc, Resolution}; | ||
| 6 | use embassy_stm32::Config; | 5 | use embassy_stm32::Config; |
| 6 | use embassy_stm32::adc::{Adc, Resolution}; | ||
| 7 | use embassy_time::Duration; | 7 | use embassy_time::Duration; |
| 8 | use {defmt_rtt as _, panic_probe as _}; | 8 | use {defmt_rtt as _, panic_probe as _}; |
| 9 | 9 | ||
diff --git a/examples/stm32u0/src/bin/rng.rs b/examples/stm32u0/src/bin/rng.rs index 89445b042..07deda94c 100644 --- a/examples/stm32u0/src/bin/rng.rs +++ b/examples/stm32u0/src/bin/rng.rs | |||
| @@ -5,7 +5,7 @@ use defmt::*; | |||
| 5 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| 6 | use embassy_stm32::rcc::mux::Clk48sel; | 6 | use embassy_stm32::rcc::mux::Clk48sel; |
| 7 | use embassy_stm32::rng::Rng; | 7 | use embassy_stm32::rng::Rng; |
| 8 | use embassy_stm32::{bind_interrupts, peripherals, rng, Config}; | 8 | use embassy_stm32::{Config, bind_interrupts, peripherals, rng}; |
| 9 | use {defmt_rtt as _, panic_probe as _}; | 9 | use {defmt_rtt as _, panic_probe as _}; |
| 10 | 10 | ||
| 11 | bind_interrupts!(struct Irqs { | 11 | bind_interrupts!(struct Irqs { |
diff --git a/examples/stm32u0/src/bin/rtc.rs b/examples/stm32u0/src/bin/rtc.rs index 72fa0fde4..d071cfbc7 100644 --- a/examples/stm32u0/src/bin/rtc.rs +++ b/examples/stm32u0/src/bin/rtc.rs | |||
| @@ -4,8 +4,8 @@ | |||
| 4 | use chrono::{NaiveDate, NaiveDateTime}; | 4 | use chrono::{NaiveDate, NaiveDateTime}; |
| 5 | use defmt::*; | 5 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 6 | use embassy_executor::Spawner; |
| 7 | use embassy_stm32::rtc::{Rtc, RtcConfig}; | ||
| 8 | use embassy_stm32::Config; | 7 | use embassy_stm32::Config; |
| 8 | use embassy_stm32::rtc::{Rtc, RtcConfig}; | ||
| 9 | use embassy_time::Timer; | 9 | use embassy_time::Timer; |
| 10 | use {defmt_rtt as _, panic_probe as _}; | 10 | use {defmt_rtt as _, panic_probe as _}; |
| 11 | 11 | ||
diff --git a/examples/stm32u0/src/bin/usb_serial.rs b/examples/stm32u0/src/bin/usb_serial.rs index 273f40643..77d0640f6 100644 --- a/examples/stm32u0/src/bin/usb_serial.rs +++ b/examples/stm32u0/src/bin/usb_serial.rs | |||
| @@ -6,10 +6,10 @@ use defmt_rtt as _; // global logger | |||
| 6 | use embassy_executor::Spawner; | 6 | use embassy_executor::Spawner; |
| 7 | use embassy_futures::join::join; | 7 | use embassy_futures::join::join; |
| 8 | use embassy_stm32::usb::{Driver, Instance}; | 8 | use embassy_stm32::usb::{Driver, Instance}; |
| 9 | use embassy_stm32::{bind_interrupts, peripherals, usb, Config}; | 9 | use embassy_stm32::{Config, bind_interrupts, peripherals, usb}; |
| 10 | use embassy_usb::Builder; | ||
| 10 | use embassy_usb::class::cdc_acm::{CdcAcmClass, State}; | 11 | use embassy_usb::class::cdc_acm::{CdcAcmClass, State}; |
| 11 | use embassy_usb::driver::EndpointError; | 12 | use embassy_usb::driver::EndpointError; |
| 12 | use embassy_usb::Builder; | ||
| 13 | use panic_probe as _; | 13 | use panic_probe as _; |
| 14 | 14 | ||
| 15 | bind_interrupts!(struct Irqs { | 15 | bind_interrupts!(struct Irqs { |
diff --git a/examples/stm32u5/src/bin/adc.rs b/examples/stm32u5/src/bin/adc.rs index d2aa28087..91e33053e 100644 --- a/examples/stm32u5/src/bin/adc.rs +++ b/examples/stm32u5/src/bin/adc.rs | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | 3 | ||
| 4 | use defmt::*; | 4 | use defmt::*; |
| 5 | use embassy_stm32::adc; | 5 | use embassy_stm32::adc; |
| 6 | use embassy_stm32::adc::{adc4, AdcChannel}; | 6 | use embassy_stm32::adc::{AdcChannel, adc4}; |
| 7 | use {defmt_rtt as _, panic_probe as _}; | 7 | use {defmt_rtt as _, panic_probe as _}; |
| 8 | 8 | ||
| 9 | #[embassy_executor::main] | 9 | #[embassy_executor::main] |
diff --git a/examples/stm32u5/src/bin/ltdc.rs b/examples/stm32u5/src/bin/ltdc.rs index 46d1c120f..d1fddb679 100644 --- a/examples/stm32u5/src/bin/ltdc.rs +++ b/examples/stm32u5/src/bin/ltdc.rs | |||
| @@ -13,14 +13,14 @@ use embassy_stm32::gpio::{Level, Output, Speed}; | |||
| 13 | use embassy_stm32::ltdc::{self, Ltdc, LtdcConfiguration, LtdcLayer, LtdcLayerConfig, PolarityActive, PolarityEdge}; | 13 | use embassy_stm32::ltdc::{self, Ltdc, LtdcConfiguration, LtdcLayer, LtdcLayerConfig, PolarityActive, PolarityEdge}; |
| 14 | use embassy_stm32::{bind_interrupts, peripherals}; | 14 | use embassy_stm32::{bind_interrupts, peripherals}; |
| 15 | use embassy_time::{Duration, Timer}; | 15 | use embassy_time::{Duration, Timer}; |
| 16 | use embedded_graphics::Pixel; | ||
| 16 | use embedded_graphics::draw_target::DrawTarget; | 17 | use embedded_graphics::draw_target::DrawTarget; |
| 17 | use embedded_graphics::geometry::{OriginDimensions, Point, Size}; | 18 | use embedded_graphics::geometry::{OriginDimensions, Point, Size}; |
| 18 | use embedded_graphics::image::Image; | 19 | use embedded_graphics::image::Image; |
| 19 | use embedded_graphics::pixelcolor::raw::RawU24; | ||
| 20 | use embedded_graphics::pixelcolor::Rgb888; | 20 | use embedded_graphics::pixelcolor::Rgb888; |
| 21 | use embedded_graphics::pixelcolor::raw::RawU24; | ||
| 21 | use embedded_graphics::prelude::*; | 22 | use embedded_graphics::prelude::*; |
| 22 | use embedded_graphics::primitives::Rectangle; | 23 | use embedded_graphics::primitives::Rectangle; |
| 23 | use embedded_graphics::Pixel; | ||
| 24 | use heapless::{Entry, FnvIndexMap}; | 24 | use heapless::{Entry, FnvIndexMap}; |
| 25 | use tinybmp::Bmp; | 25 | use tinybmp::Bmp; |
| 26 | use {defmt_rtt as _, panic_probe as _}; | 26 | use {defmt_rtt as _, panic_probe as _}; |
| @@ -317,7 +317,7 @@ impl OriginDimensions for DoubleBuffer { | |||
| 317 | mod rcc_setup { | 317 | mod rcc_setup { |
| 318 | 318 | ||
| 319 | use embassy_stm32::time::Hertz; | 319 | use embassy_stm32::time::Hertz; |
| 320 | use embassy_stm32::{rcc, Config, Peripherals}; | 320 | use embassy_stm32::{Config, Peripherals, rcc}; |
| 321 | 321 | ||
| 322 | /// Sets up clocks for the stm32u5g9zj mcu | 322 | /// Sets up clocks for the stm32u5g9zj mcu |
| 323 | /// change this if you plan to use a different microcontroller | 323 | /// change this if you plan to use a different microcontroller |
diff --git a/examples/stm32u5/src/bin/usb_hs_serial.rs b/examples/stm32u5/src/bin/usb_hs_serial.rs index d37e7777b..c444d3479 100644 --- a/examples/stm32u5/src/bin/usb_hs_serial.rs +++ b/examples/stm32u5/src/bin/usb_hs_serial.rs | |||
| @@ -6,10 +6,10 @@ use defmt_rtt as _; // global logger | |||
| 6 | use embassy_executor::Spawner; | 6 | use embassy_executor::Spawner; |
| 7 | use embassy_futures::join::join; | 7 | use embassy_futures::join::join; |
| 8 | use embassy_stm32::usb::{Driver, Instance}; | 8 | use embassy_stm32::usb::{Driver, Instance}; |
| 9 | use embassy_stm32::{bind_interrupts, peripherals, usb, Config}; | 9 | use embassy_stm32::{Config, bind_interrupts, peripherals, usb}; |
| 10 | use embassy_usb::Builder; | ||
| 10 | use embassy_usb::class::cdc_acm::{CdcAcmClass, State}; | 11 | use embassy_usb::class::cdc_acm::{CdcAcmClass, State}; |
| 11 | use embassy_usb::driver::EndpointError; | 12 | use embassy_usb::driver::EndpointError; |
| 12 | use embassy_usb::Builder; | ||
| 13 | use panic_probe as _; | 13 | use panic_probe as _; |
| 14 | 14 | ||
| 15 | bind_interrupts!(struct Irqs { | 15 | bind_interrupts!(struct Irqs { |
diff --git a/examples/stm32u5/src/bin/usb_serial.rs b/examples/stm32u5/src/bin/usb_serial.rs index ff7f4e5be..c0a768cbb 100644 --- a/examples/stm32u5/src/bin/usb_serial.rs +++ b/examples/stm32u5/src/bin/usb_serial.rs | |||
| @@ -6,10 +6,10 @@ use defmt_rtt as _; // global logger | |||
| 6 | use embassy_executor::Spawner; | 6 | use embassy_executor::Spawner; |
| 7 | use embassy_futures::join::join; | 7 | use embassy_futures::join::join; |
| 8 | use embassy_stm32::usb::{Driver, Instance}; | 8 | use embassy_stm32::usb::{Driver, Instance}; |
| 9 | use embassy_stm32::{bind_interrupts, peripherals, usb, Config}; | 9 | use embassy_stm32::{Config, bind_interrupts, peripherals, usb}; |
| 10 | use embassy_usb::Builder; | ||
| 10 | use embassy_usb::class::cdc_acm::{CdcAcmClass, State}; | 11 | use embassy_usb::class::cdc_acm::{CdcAcmClass, State}; |
| 11 | use embassy_usb::driver::EndpointError; | 12 | use embassy_usb::driver::EndpointError; |
| 12 | use embassy_usb::Builder; | ||
| 13 | use panic_probe as _; | 13 | use panic_probe as _; |
| 14 | 14 | ||
| 15 | bind_interrupts!(struct Irqs { | 15 | bind_interrupts!(struct Irqs { |
diff --git a/examples/stm32wb/src/bin/eddystone_beacon.rs b/examples/stm32wb/src/bin/eddystone_beacon.rs index 3bd8b4a63..f309ca3a2 100644 --- a/examples/stm32wb/src/bin/eddystone_beacon.rs +++ b/examples/stm32wb/src/bin/eddystone_beacon.rs | |||
| @@ -8,15 +8,15 @@ use embassy_executor::Spawner; | |||
| 8 | use embassy_stm32::bind_interrupts; | 8 | use embassy_stm32::bind_interrupts; |
| 9 | use embassy_stm32::ipcc::{Config, ReceiveInterruptHandler, TransmitInterruptHandler}; | 9 | use embassy_stm32::ipcc::{Config, ReceiveInterruptHandler, TransmitInterruptHandler}; |
| 10 | use embassy_stm32::rcc::WPAN_DEFAULT; | 10 | use embassy_stm32::rcc::WPAN_DEFAULT; |
| 11 | use embassy_stm32_wpan::TlMbox; | ||
| 12 | use embassy_stm32_wpan::hci::BdAddr; | ||
| 11 | use embassy_stm32_wpan::hci::host::uart::UartHci; | 13 | use embassy_stm32_wpan::hci::host::uart::UartHci; |
| 12 | use embassy_stm32_wpan::hci::host::{AdvertisingFilterPolicy, EncryptionKey, HostHci, OwnAddressType}; | 14 | use embassy_stm32_wpan::hci::host::{AdvertisingFilterPolicy, EncryptionKey, HostHci, OwnAddressType}; |
| 13 | use embassy_stm32_wpan::hci::types::AdvertisingType; | 15 | use embassy_stm32_wpan::hci::types::AdvertisingType; |
| 14 | use embassy_stm32_wpan::hci::vendor::command::gap::{AdvertisingDataType, DiscoverableParameters, GapCommands, Role}; | 16 | use embassy_stm32_wpan::hci::vendor::command::gap::{AdvertisingDataType, DiscoverableParameters, GapCommands, Role}; |
| 15 | use embassy_stm32_wpan::hci::vendor::command::gatt::GattCommands; | 17 | use embassy_stm32_wpan::hci::vendor::command::gatt::GattCommands; |
| 16 | use embassy_stm32_wpan::hci::vendor::command::hal::{ConfigData, HalCommands, PowerLevel}; | 18 | use embassy_stm32_wpan::hci::vendor::command::hal::{ConfigData, HalCommands, PowerLevel}; |
| 17 | use embassy_stm32_wpan::hci::BdAddr; | ||
| 18 | use embassy_stm32_wpan::lhci::LhciC1DeviceInformationCcrp; | 19 | use embassy_stm32_wpan::lhci::LhciC1DeviceInformationCcrp; |
| 19 | use embassy_stm32_wpan::TlMbox; | ||
| 20 | use {defmt_rtt as _, panic_probe as _}; | 20 | use {defmt_rtt as _, panic_probe as _}; |
| 21 | 21 | ||
| 22 | bind_interrupts!(struct Irqs{ | 22 | bind_interrupts!(struct Irqs{ |
diff --git a/examples/stm32wb/src/bin/gatt_server.rs b/examples/stm32wb/src/bin/gatt_server.rs index 5d927bc00..2ed257566 100644 --- a/examples/stm32wb/src/bin/gatt_server.rs +++ b/examples/stm32wb/src/bin/gatt_server.rs | |||
| @@ -8,6 +8,7 @@ use embassy_executor::Spawner; | |||
| 8 | use embassy_stm32::bind_interrupts; | 8 | use embassy_stm32::bind_interrupts; |
| 9 | use embassy_stm32::ipcc::{Config, ReceiveInterruptHandler, TransmitInterruptHandler}; | 9 | use embassy_stm32::ipcc::{Config, ReceiveInterruptHandler, TransmitInterruptHandler}; |
| 10 | use embassy_stm32::rcc::WPAN_DEFAULT; | 10 | use embassy_stm32::rcc::WPAN_DEFAULT; |
| 11 | use embassy_stm32_wpan::TlMbox; | ||
| 11 | use embassy_stm32_wpan::hci::event::command::{CommandComplete, ReturnParameters}; | 12 | use embassy_stm32_wpan::hci::event::command::{CommandComplete, ReturnParameters}; |
| 12 | use embassy_stm32_wpan::hci::host::uart::{Packet, UartHci}; | 13 | use embassy_stm32_wpan::hci::host::uart::{Packet, UartHci}; |
| 13 | use embassy_stm32_wpan::hci::host::{AdvertisingFilterPolicy, EncryptionKey, HostHci, OwnAddressType}; | 14 | use embassy_stm32_wpan::hci::host::{AdvertisingFilterPolicy, EncryptionKey, HostHci, OwnAddressType}; |
| @@ -28,7 +29,6 @@ use embassy_stm32_wpan::hci::{BdAddr, Event}; | |||
| 28 | use embassy_stm32_wpan::lhci::LhciC1DeviceInformationCcrp; | 29 | use embassy_stm32_wpan::lhci::LhciC1DeviceInformationCcrp; |
| 29 | use embassy_stm32_wpan::sub::ble::Ble; | 30 | use embassy_stm32_wpan::sub::ble::Ble; |
| 30 | use embassy_stm32_wpan::sub::mm; | 31 | use embassy_stm32_wpan::sub::mm; |
| 31 | use embassy_stm32_wpan::TlMbox; | ||
| 32 | use {defmt_rtt as _, panic_probe as _}; | 32 | use {defmt_rtt as _, panic_probe as _}; |
| 33 | 33 | ||
| 34 | bind_interrupts!(struct Irqs{ | 34 | bind_interrupts!(struct Irqs{ |
diff --git a/examples/stm32wb/src/bin/mac_ffd.rs b/examples/stm32wb/src/bin/mac_ffd.rs index ede6cf4b9..18a52e162 100644 --- a/examples/stm32wb/src/bin/mac_ffd.rs +++ b/examples/stm32wb/src/bin/mac_ffd.rs | |||
| @@ -6,11 +6,11 @@ use embassy_executor::Spawner; | |||
| 6 | use embassy_stm32::bind_interrupts; | 6 | use embassy_stm32::bind_interrupts; |
| 7 | use embassy_stm32::ipcc::{Config, ReceiveInterruptHandler, TransmitInterruptHandler}; | 7 | use embassy_stm32::ipcc::{Config, ReceiveInterruptHandler, TransmitInterruptHandler}; |
| 8 | use embassy_stm32::rcc::WPAN_DEFAULT; | 8 | use embassy_stm32::rcc::WPAN_DEFAULT; |
| 9 | use embassy_stm32_wpan::TlMbox; | ||
| 9 | use embassy_stm32_wpan::mac::commands::{AssociateResponse, ResetRequest, SetRequest, StartRequest}; | 10 | use embassy_stm32_wpan::mac::commands::{AssociateResponse, ResetRequest, SetRequest, StartRequest}; |
| 10 | use embassy_stm32_wpan::mac::event::MacEvent; | 11 | use embassy_stm32_wpan::mac::event::MacEvent; |
| 11 | use embassy_stm32_wpan::mac::typedefs::{MacChannel, MacStatus, PanId, PibId, SecurityLevel}; | 12 | use embassy_stm32_wpan::mac::typedefs::{MacChannel, MacStatus, PanId, PibId, SecurityLevel}; |
| 12 | use embassy_stm32_wpan::sub::mm; | 13 | use embassy_stm32_wpan::sub::mm; |
| 13 | use embassy_stm32_wpan::TlMbox; | ||
| 14 | use {defmt_rtt as _, panic_probe as _}; | 14 | use {defmt_rtt as _, panic_probe as _}; |
| 15 | 15 | ||
| 16 | bind_interrupts!(struct Irqs{ | 16 | bind_interrupts!(struct Irqs{ |
diff --git a/examples/stm32wb/src/bin/mac_ffd_net.rs b/examples/stm32wb/src/bin/mac_ffd_net.rs index cc3b21e2e..5296943a1 100644 --- a/examples/stm32wb/src/bin/mac_ffd_net.rs +++ b/examples/stm32wb/src/bin/mac_ffd_net.rs | |||
| @@ -6,11 +6,11 @@ use embassy_executor::Spawner; | |||
| 6 | use embassy_stm32::bind_interrupts; | 6 | use embassy_stm32::bind_interrupts; |
| 7 | use embassy_stm32::ipcc::{Config, ReceiveInterruptHandler, TransmitInterruptHandler}; | 7 | use embassy_stm32::ipcc::{Config, ReceiveInterruptHandler, TransmitInterruptHandler}; |
| 8 | use embassy_stm32::rcc::WPAN_DEFAULT; | 8 | use embassy_stm32::rcc::WPAN_DEFAULT; |
| 9 | use embassy_stm32_wpan::TlMbox; | ||
| 9 | use embassy_stm32_wpan::mac::commands::{ResetRequest, SetRequest, StartRequest}; | 10 | use embassy_stm32_wpan::mac::commands::{ResetRequest, SetRequest, StartRequest}; |
| 10 | use embassy_stm32_wpan::mac::typedefs::{MacChannel, PanId, PibId}; | 11 | use embassy_stm32_wpan::mac::typedefs::{MacChannel, PanId, PibId}; |
| 11 | use embassy_stm32_wpan::mac::{self, Runner}; | 12 | use embassy_stm32_wpan::mac::{self, Runner}; |
| 12 | use embassy_stm32_wpan::sub::mm; | 13 | use embassy_stm32_wpan::sub::mm; |
| 13 | use embassy_stm32_wpan::TlMbox; | ||
| 14 | use static_cell::StaticCell; | 14 | use static_cell::StaticCell; |
| 15 | use {defmt_rtt as _, panic_probe as _}; | 15 | use {defmt_rtt as _, panic_probe as _}; |
| 16 | 16 | ||
diff --git a/examples/stm32wb/src/bin/mac_rfd.rs b/examples/stm32wb/src/bin/mac_rfd.rs index d872104a8..883179023 100644 --- a/examples/stm32wb/src/bin/mac_rfd.rs +++ b/examples/stm32wb/src/bin/mac_rfd.rs | |||
| @@ -6,13 +6,13 @@ use embassy_executor::Spawner; | |||
| 6 | use embassy_stm32::bind_interrupts; | 6 | use embassy_stm32::bind_interrupts; |
| 7 | use embassy_stm32::ipcc::{Config, ReceiveInterruptHandler, TransmitInterruptHandler}; | 7 | use embassy_stm32::ipcc::{Config, ReceiveInterruptHandler, TransmitInterruptHandler}; |
| 8 | use embassy_stm32::rcc::WPAN_DEFAULT; | 8 | use embassy_stm32::rcc::WPAN_DEFAULT; |
| 9 | use embassy_stm32_wpan::TlMbox; | ||
| 9 | use embassy_stm32_wpan::mac::commands::{AssociateRequest, DataRequest, GetRequest, ResetRequest, SetRequest}; | 10 | use embassy_stm32_wpan::mac::commands::{AssociateRequest, DataRequest, GetRequest, ResetRequest, SetRequest}; |
| 10 | use embassy_stm32_wpan::mac::event::MacEvent; | 11 | use embassy_stm32_wpan::mac::event::MacEvent; |
| 11 | use embassy_stm32_wpan::mac::typedefs::{ | 12 | use embassy_stm32_wpan::mac::typedefs::{ |
| 12 | AddressMode, Capabilities, KeyIdMode, MacAddress, MacChannel, PanId, PibId, SecurityLevel, | 13 | AddressMode, Capabilities, KeyIdMode, MacAddress, MacChannel, PanId, PibId, SecurityLevel, |
| 13 | }; | 14 | }; |
| 14 | use embassy_stm32_wpan::sub::mm; | 15 | use embassy_stm32_wpan::sub::mm; |
| 15 | use embassy_stm32_wpan::TlMbox; | ||
| 16 | use {defmt_rtt as _, panic_probe as _}; | 16 | use {defmt_rtt as _, panic_probe as _}; |
| 17 | 17 | ||
| 18 | bind_interrupts!(struct Irqs{ | 18 | bind_interrupts!(struct Irqs{ |
diff --git a/examples/stm32wb/src/bin/tl_mbox_mac.rs b/examples/stm32wb/src/bin/tl_mbox_mac.rs index 95c73872b..16d0a1527 100644 --- a/examples/stm32wb/src/bin/tl_mbox_mac.rs +++ b/examples/stm32wb/src/bin/tl_mbox_mac.rs | |||
| @@ -6,8 +6,8 @@ use embassy_executor::Spawner; | |||
| 6 | use embassy_stm32::bind_interrupts; | 6 | use embassy_stm32::bind_interrupts; |
| 7 | use embassy_stm32::ipcc::{Config, ReceiveInterruptHandler, TransmitInterruptHandler}; | 7 | use embassy_stm32::ipcc::{Config, ReceiveInterruptHandler, TransmitInterruptHandler}; |
| 8 | use embassy_stm32::rcc::WPAN_DEFAULT; | 8 | use embassy_stm32::rcc::WPAN_DEFAULT; |
| 9 | use embassy_stm32_wpan::sub::mm; | ||
| 10 | use embassy_stm32_wpan::TlMbox; | 9 | use embassy_stm32_wpan::TlMbox; |
| 10 | use embassy_stm32_wpan::sub::mm; | ||
| 11 | use {defmt_rtt as _, panic_probe as _}; | 11 | use {defmt_rtt as _, panic_probe as _}; |
| 12 | 12 | ||
| 13 | bind_interrupts!(struct Irqs{ | 13 | bind_interrupts!(struct Irqs{ |
diff --git a/examples/stm32wba/src/bin/adc.rs b/examples/stm32wba/src/bin/adc.rs index a9651d57e..8c80470b8 100644 --- a/examples/stm32wba/src/bin/adc.rs +++ b/examples/stm32wba/src/bin/adc.rs | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | 3 | ||
| 4 | use defmt::*; | 4 | use defmt::*; |
| 5 | use embassy_stm32::adc::{adc4, AdcChannel}; | 5 | use embassy_stm32::adc::{AdcChannel, adc4}; |
| 6 | use {defmt_rtt as _, panic_probe as _}; | 6 | use {defmt_rtt as _, panic_probe as _}; |
| 7 | 7 | ||
| 8 | #[embassy_executor::main] | 8 | #[embassy_executor::main] |
diff --git a/examples/stm32wba/src/bin/pwm.rs b/examples/stm32wba/src/bin/pwm.rs index de690fda0..f20c77a7c 100644 --- a/examples/stm32wba/src/bin/pwm.rs +++ b/examples/stm32wba/src/bin/pwm.rs | |||
| @@ -4,13 +4,13 @@ | |||
| 4 | use defmt::*; | 4 | use defmt::*; |
| 5 | use defmt_rtt as _; // global logger | 5 | use defmt_rtt as _; // global logger |
| 6 | use embassy_executor::Spawner; | 6 | use embassy_executor::Spawner; |
| 7 | use embassy_stm32::Config; | ||
| 7 | use embassy_stm32::gpio::OutputType; | 8 | use embassy_stm32::gpio::OutputType; |
| 8 | use embassy_stm32::rcc::{ | 9 | use embassy_stm32::rcc::{ |
| 9 | AHB5Prescaler, AHBPrescaler, APBPrescaler, PllDiv, PllMul, PllPreDiv, PllSource, Sysclk, VoltageScale, | 10 | AHB5Prescaler, AHBPrescaler, APBPrescaler, PllDiv, PllMul, PllPreDiv, PllSource, Sysclk, VoltageScale, |
| 10 | }; | 11 | }; |
| 11 | use embassy_stm32::time::khz; | 12 | use embassy_stm32::time::khz; |
| 12 | use embassy_stm32::timer::simple_pwm::{PwmPin, SimplePwm}; | 13 | use embassy_stm32::timer::simple_pwm::{PwmPin, SimplePwm}; |
| 13 | use embassy_stm32::Config; | ||
| 14 | use embassy_time::Timer; | 14 | use embassy_time::Timer; |
| 15 | use panic_probe as _; | 15 | use panic_probe as _; |
| 16 | 16 | ||
diff --git a/examples/stm32wba6/src/bin/adc.rs b/examples/stm32wba6/src/bin/adc.rs index a9651d57e..8c80470b8 100644 --- a/examples/stm32wba6/src/bin/adc.rs +++ b/examples/stm32wba6/src/bin/adc.rs | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | 3 | ||
| 4 | use defmt::*; | 4 | use defmt::*; |
| 5 | use embassy_stm32::adc::{adc4, AdcChannel}; | 5 | use embassy_stm32::adc::{AdcChannel, adc4}; |
| 6 | use {defmt_rtt as _, panic_probe as _}; | 6 | use {defmt_rtt as _, panic_probe as _}; |
| 7 | 7 | ||
| 8 | #[embassy_executor::main] | 8 | #[embassy_executor::main] |
diff --git a/examples/stm32wba6/src/bin/pwm.rs b/examples/stm32wba6/src/bin/pwm.rs index 2c696834a..64ae01945 100644 --- a/examples/stm32wba6/src/bin/pwm.rs +++ b/examples/stm32wba6/src/bin/pwm.rs | |||
| @@ -4,13 +4,13 @@ | |||
| 4 | use defmt::*; | 4 | use defmt::*; |
| 5 | use defmt_rtt as _; // global logger | 5 | use defmt_rtt as _; // global logger |
| 6 | use embassy_executor::Spawner; | 6 | use embassy_executor::Spawner; |
| 7 | use embassy_stm32::Config; | ||
| 7 | use embassy_stm32::gpio::OutputType; | 8 | use embassy_stm32::gpio::OutputType; |
| 8 | use embassy_stm32::rcc::{ | 9 | use embassy_stm32::rcc::{ |
| 9 | AHB5Prescaler, AHBPrescaler, APBPrescaler, PllDiv, PllMul, PllPreDiv, PllSource, Sysclk, VoltageScale, | 10 | AHB5Prescaler, AHBPrescaler, APBPrescaler, PllDiv, PllMul, PllPreDiv, PllSource, Sysclk, VoltageScale, |
| 10 | }; | 11 | }; |
| 11 | use embassy_stm32::time::khz; | 12 | use embassy_stm32::time::khz; |
| 12 | use embassy_stm32::timer::simple_pwm::{PwmPin, SimplePwm}; | 13 | use embassy_stm32::timer::simple_pwm::{PwmPin, SimplePwm}; |
| 13 | use embassy_stm32::Config; | ||
| 14 | use embassy_time::Timer; | 14 | use embassy_time::Timer; |
| 15 | use panic_probe as _; | 15 | use panic_probe as _; |
| 16 | 16 | ||
diff --git a/examples/stm32wba6/src/bin/usb_hs_serial.rs b/examples/stm32wba6/src/bin/usb_hs_serial.rs index 20bdeaac3..a60eeb480 100644 --- a/examples/stm32wba6/src/bin/usb_hs_serial.rs +++ b/examples/stm32wba6/src/bin/usb_hs_serial.rs | |||
| @@ -5,10 +5,10 @@ use defmt::{panic, *}; | |||
| 5 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| 6 | use embassy_futures::join::join; | 6 | use embassy_futures::join::join; |
| 7 | use embassy_stm32::usb::{Driver, Instance}; | 7 | use embassy_stm32::usb::{Driver, Instance}; |
| 8 | use embassy_stm32::{bind_interrupts, peripherals, usb, Config}; | 8 | use embassy_stm32::{Config, bind_interrupts, peripherals, usb}; |
| 9 | use embassy_usb::Builder; | ||
| 9 | use embassy_usb::class::cdc_acm::{CdcAcmClass, State}; | 10 | use embassy_usb::class::cdc_acm::{CdcAcmClass, State}; |
| 10 | use embassy_usb::driver::EndpointError; | 11 | use embassy_usb::driver::EndpointError; |
| 11 | use embassy_usb::Builder; | ||
| 12 | use {defmt_rtt as _, panic_probe as _}; | 12 | use {defmt_rtt as _, panic_probe as _}; |
| 13 | 13 | ||
| 14 | bind_interrupts!(struct Irqs { | 14 | bind_interrupts!(struct Irqs { |
diff --git a/examples/stm32wl/src/bin/adc.rs b/examples/stm32wl/src/bin/adc.rs index 118f02ae1..6b21b086b 100644 --- a/examples/stm32wl/src/bin/adc.rs +++ b/examples/stm32wl/src/bin/adc.rs | |||
| @@ -5,8 +5,8 @@ use core::mem::MaybeUninit; | |||
| 5 | 5 | ||
| 6 | use defmt::*; | 6 | use defmt::*; |
| 7 | use embassy_executor::Spawner; | 7 | use embassy_executor::Spawner; |
| 8 | use embassy_stm32::adc::{Adc, CkModePclk, Clock, SampleTime}; | ||
| 9 | use embassy_stm32::SharedData; | 8 | use embassy_stm32::SharedData; |
| 9 | use embassy_stm32::adc::{Adc, CkModePclk, Clock, SampleTime}; | ||
| 10 | use embassy_time::Timer; | 10 | use embassy_time::Timer; |
| 11 | use {defmt_rtt as _, panic_probe as _}; | 11 | use {defmt_rtt as _, panic_probe as _}; |
| 12 | 12 | ||
diff --git a/examples/stm32wl/src/bin/blinky.rs b/examples/stm32wl/src/bin/blinky.rs index a2a90871d..f7f57e35c 100644 --- a/examples/stm32wl/src/bin/blinky.rs +++ b/examples/stm32wl/src/bin/blinky.rs | |||
| @@ -5,8 +5,8 @@ use core::mem::MaybeUninit; | |||
| 5 | 5 | ||
| 6 | use defmt::*; | 6 | use defmt::*; |
| 7 | use embassy_executor::Spawner; | 7 | use embassy_executor::Spawner; |
| 8 | use embassy_stm32::gpio::{Level, Output, Speed}; | ||
| 9 | use embassy_stm32::SharedData; | 8 | use embassy_stm32::SharedData; |
| 9 | use embassy_stm32::gpio::{Level, Output, Speed}; | ||
| 10 | use embassy_time::Timer; | 10 | use embassy_time::Timer; |
| 11 | use {defmt_rtt as _, panic_probe as _}; | 11 | use {defmt_rtt as _, panic_probe as _}; |
| 12 | 12 | ||
diff --git a/examples/stm32wl/src/bin/button.rs b/examples/stm32wl/src/bin/button.rs index 21bcd2ac6..07bc95ad7 100644 --- a/examples/stm32wl/src/bin/button.rs +++ b/examples/stm32wl/src/bin/button.rs | |||
| @@ -5,8 +5,8 @@ use core::mem::MaybeUninit; | |||
| 5 | 5 | ||
| 6 | use cortex_m_rt::entry; | 6 | use cortex_m_rt::entry; |
| 7 | use defmt::*; | 7 | use defmt::*; |
| 8 | use embassy_stm32::gpio::{Input, Level, Output, Pull, Speed}; | ||
| 9 | use embassy_stm32::SharedData; | 8 | use embassy_stm32::SharedData; |
| 9 | use embassy_stm32::gpio::{Input, Level, Output, Pull, Speed}; | ||
| 10 | use {defmt_rtt as _, panic_probe as _}; | 10 | use {defmt_rtt as _, panic_probe as _}; |
| 11 | 11 | ||
| 12 | #[unsafe(link_section = ".shared_data")] | 12 | #[unsafe(link_section = ".shared_data")] |
diff --git a/examples/stm32wl/src/bin/button_exti.rs b/examples/stm32wl/src/bin/button_exti.rs index 0a8aece34..953b13bac 100644 --- a/examples/stm32wl/src/bin/button_exti.rs +++ b/examples/stm32wl/src/bin/button_exti.rs | |||
| @@ -5,9 +5,9 @@ use core::mem::MaybeUninit; | |||
| 5 | 5 | ||
| 6 | use defmt::*; | 6 | use defmt::*; |
| 7 | use embassy_executor::Spawner; | 7 | use embassy_executor::Spawner; |
| 8 | use embassy_stm32::SharedData; | ||
| 8 | use embassy_stm32::exti::ExtiInput; | 9 | use embassy_stm32::exti::ExtiInput; |
| 9 | use embassy_stm32::gpio::Pull; | 10 | use embassy_stm32::gpio::Pull; |
| 10 | use embassy_stm32::SharedData; | ||
| 11 | use {defmt_rtt as _, panic_probe as _}; | 11 | use {defmt_rtt as _, panic_probe as _}; |
| 12 | 12 | ||
| 13 | #[unsafe(link_section = ".shared_data")] | 13 | #[unsafe(link_section = ".shared_data")] |
diff --git a/examples/stm32wl/src/bin/flash.rs b/examples/stm32wl/src/bin/flash.rs index 320a9723a..bc707820d 100644 --- a/examples/stm32wl/src/bin/flash.rs +++ b/examples/stm32wl/src/bin/flash.rs | |||
| @@ -5,8 +5,8 @@ use core::mem::MaybeUninit; | |||
| 5 | 5 | ||
| 6 | use defmt::{info, unwrap}; | 6 | use defmt::{info, unwrap}; |
| 7 | use embassy_executor::Spawner; | 7 | use embassy_executor::Spawner; |
| 8 | use embassy_stm32::flash::Flash; | ||
| 9 | use embassy_stm32::SharedData; | 8 | use embassy_stm32::SharedData; |
| 9 | use embassy_stm32::flash::Flash; | ||
| 10 | use {defmt_rtt as _, panic_probe as _}; | 10 | use {defmt_rtt as _, panic_probe as _}; |
| 11 | 11 | ||
| 12 | #[unsafe(link_section = ".shared_data")] | 12 | #[unsafe(link_section = ".shared_data")] |
diff --git a/examples/stm32wl/src/bin/random.rs b/examples/stm32wl/src/bin/random.rs index 68b9d7d00..931f9819a 100644 --- a/examples/stm32wl/src/bin/random.rs +++ b/examples/stm32wl/src/bin/random.rs | |||
| @@ -7,7 +7,7 @@ use defmt::*; | |||
| 7 | use embassy_executor::Spawner; | 7 | use embassy_executor::Spawner; |
| 8 | use embassy_stm32::rng::{self, Rng}; | 8 | use embassy_stm32::rng::{self, Rng}; |
| 9 | use embassy_stm32::time::Hertz; | 9 | use embassy_stm32::time::Hertz; |
| 10 | use embassy_stm32::{bind_interrupts, peripherals, SharedData}; | 10 | use embassy_stm32::{SharedData, bind_interrupts, peripherals}; |
| 11 | use {defmt_rtt as _, panic_probe as _}; | 11 | use {defmt_rtt as _, panic_probe as _}; |
| 12 | 12 | ||
| 13 | bind_interrupts!(struct Irqs{ | 13 | bind_interrupts!(struct Irqs{ |
diff --git a/examples/stm32wl/src/bin/uart_async.rs b/examples/stm32wl/src/bin/uart_async.rs index 505a85f47..829ea2de7 100644 --- a/examples/stm32wl/src/bin/uart_async.rs +++ b/examples/stm32wl/src/bin/uart_async.rs | |||
| @@ -6,7 +6,7 @@ use core::mem::MaybeUninit; | |||
| 6 | use defmt::*; | 6 | use defmt::*; |
| 7 | use embassy_executor::Spawner; | 7 | use embassy_executor::Spawner; |
| 8 | use embassy_stm32::usart::{Config, InterruptHandler, Uart}; | 8 | use embassy_stm32::usart::{Config, InterruptHandler, Uart}; |
| 9 | use embassy_stm32::{bind_interrupts, peripherals, SharedData}; | 9 | use embassy_stm32::{SharedData, bind_interrupts, peripherals}; |
| 10 | use {defmt_rtt as _, panic_probe as _}; | 10 | use {defmt_rtt as _, panic_probe as _}; |
| 11 | 11 | ||
| 12 | bind_interrupts!(struct Irqs{ | 12 | bind_interrupts!(struct Irqs{ |
diff --git a/tests/mspm0/src/bin/dma.rs b/tests/mspm0/src/bin/dma.rs index 6fd973a18..9c56acadc 100644 --- a/tests/mspm0/src/bin/dma.rs +++ b/tests/mspm0/src/bin/dma.rs | |||
| @@ -11,8 +11,8 @@ use core::slice; | |||
| 11 | 11 | ||
| 12 | use defmt::{assert, assert_eq, *}; | 12 | use defmt::{assert, assert_eq, *}; |
| 13 | use embassy_executor::Spawner; | 13 | use embassy_executor::Spawner; |
| 14 | use embassy_mspm0::dma::{Channel, Transfer, TransferMode, TransferOptions, Word}; | ||
| 15 | use embassy_mspm0::Peri; | 14 | use embassy_mspm0::Peri; |
| 15 | use embassy_mspm0::dma::{Channel, Transfer, TransferMode, TransferOptions, Word}; | ||
| 16 | use {defmt_rtt as _, panic_probe as _}; | 16 | use {defmt_rtt as _, panic_probe as _}; |
| 17 | 17 | ||
| 18 | #[embassy_executor::main] | 18 | #[embassy_executor::main] |
diff --git a/tests/perf-client/src/lib.rs b/tests/perf-client/src/lib.rs index 4bd9e5674..1ba071e8d 100644 --- a/tests/perf-client/src/lib.rs +++ b/tests/perf-client/src/lib.rs | |||
| @@ -4,7 +4,7 @@ use defmt::{assert, *}; | |||
| 4 | use embassy_futures::join::join; | 4 | use embassy_futures::join::join; |
| 5 | use embassy_net::tcp::TcpSocket; | 5 | use embassy_net::tcp::TcpSocket; |
| 6 | use embassy_net::{Ipv4Address, Stack}; | 6 | use embassy_net::{Ipv4Address, Stack}; |
| 7 | use embassy_time::{with_timeout, Duration, Timer}; | 7 | use embassy_time::{Duration, Timer, with_timeout}; |
| 8 | 8 | ||
| 9 | pub struct Expected { | 9 | pub struct Expected { |
| 10 | pub down_kbps: usize, | 10 | pub down_kbps: usize, |
diff --git a/tests/rp/src/bin/cyw43-perf.rs b/tests/rp/src/bin/cyw43-perf.rs index 555134ffd..9487f5e1a 100644 --- a/tests/rp/src/bin/cyw43-perf.rs +++ b/tests/rp/src/bin/cyw43-perf.rs | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | teleprobe_meta::target!(b"rpi-pico"); | 3 | teleprobe_meta::target!(b"rpi-pico"); |
| 4 | 4 | ||
| 5 | use cyw43::JoinOptions; | 5 | use cyw43::JoinOptions; |
| 6 | use cyw43_pio::{PioSpi, DEFAULT_CLOCK_DIVIDER}; | 6 | use cyw43_pio::{DEFAULT_CLOCK_DIVIDER, PioSpi}; |
| 7 | use defmt::{panic, *}; | 7 | use defmt::{panic, *}; |
| 8 | use embassy_executor::Spawner; | 8 | use embassy_executor::Spawner; |
| 9 | use embassy_net::{Config, StackResources}; | 9 | use embassy_net::{Config, StackResources}; |
diff --git a/tests/rp/src/bin/gpio_multicore.rs b/tests/rp/src/bin/gpio_multicore.rs index f48dd207b..6abcba590 100644 --- a/tests/rp/src/bin/gpio_multicore.rs +++ b/tests/rp/src/bin/gpio_multicore.rs | |||
| @@ -7,10 +7,10 @@ teleprobe_meta::target!(b"pimoroni-pico-plus-2"); | |||
| 7 | 7 | ||
| 8 | use defmt::{info, unwrap}; | 8 | use defmt::{info, unwrap}; |
| 9 | use embassy_executor::Executor; | 9 | use embassy_executor::Executor; |
| 10 | use embassy_rp::Peri; | ||
| 10 | use embassy_rp::gpio::{Input, Level, Output, Pull}; | 11 | use embassy_rp::gpio::{Input, Level, Output, Pull}; |
| 11 | use embassy_rp::multicore::{spawn_core1, Stack}; | 12 | use embassy_rp::multicore::{Stack, spawn_core1}; |
| 12 | use embassy_rp::peripherals::{PIN_0, PIN_1}; | 13 | use embassy_rp::peripherals::{PIN_0, PIN_1}; |
| 13 | use embassy_rp::Peri; | ||
| 14 | use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex; | 14 | use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex; |
| 15 | use embassy_sync::channel::Channel; | 15 | use embassy_sync::channel::Channel; |
| 16 | use static_cell::StaticCell; | 16 | use static_cell::StaticCell; |
diff --git a/tests/rp/src/bin/multicore.rs b/tests/rp/src/bin/multicore.rs index 11b03cfea..7e34bc778 100644 --- a/tests/rp/src/bin/multicore.rs +++ b/tests/rp/src/bin/multicore.rs | |||
| @@ -7,7 +7,7 @@ teleprobe_meta::target!(b"pimoroni-pico-plus-2"); | |||
| 7 | 7 | ||
| 8 | use defmt::{info, unwrap}; | 8 | use defmt::{info, unwrap}; |
| 9 | use embassy_executor::Executor; | 9 | use embassy_executor::Executor; |
| 10 | use embassy_rp::multicore::{spawn_core1, Stack}; | 10 | use embassy_rp::multicore::{Stack, spawn_core1}; |
| 11 | use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex; | 11 | use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex; |
| 12 | use embassy_sync::channel::Channel; | 12 | use embassy_sync::channel::Channel; |
| 13 | use static_cell::StaticCell; | 13 | use static_cell::StaticCell; |
diff --git a/tests/rp/src/bin/overclock.rs b/tests/rp/src/bin/overclock.rs index 167a26eb2..87a03b5e2 100644 --- a/tests/rp/src/bin/overclock.rs +++ b/tests/rp/src/bin/overclock.rs | |||
| @@ -8,7 +8,7 @@ teleprobe_meta::target!(b"pimoroni-pico-plus-2"); | |||
| 8 | 8 | ||
| 9 | use defmt::info; | 9 | use defmt::info; |
| 10 | use embassy_executor::Spawner; | 10 | use embassy_executor::Spawner; |
| 11 | use embassy_rp::clocks::{clk_sys_freq, core_voltage, ClockConfig, CoreVoltage}; | 11 | use embassy_rp::clocks::{ClockConfig, CoreVoltage, clk_sys_freq, core_voltage}; |
| 12 | use embassy_rp::config::Config; | 12 | use embassy_rp::config::Config; |
| 13 | use embassy_time::Instant; | 13 | use embassy_time::Instant; |
| 14 | use {defmt_rtt as _, panic_probe as _}; | 14 | use {defmt_rtt as _, panic_probe as _}; |
diff --git a/tests/rp/src/bin/pio_multi_load.rs b/tests/rp/src/bin/pio_multi_load.rs index aca476d56..82bbab272 100644 --- a/tests/rp/src/bin/pio_multi_load.rs +++ b/tests/rp/src/bin/pio_multi_load.rs | |||
| @@ -57,7 +57,9 @@ async fn main(_spawner: Spawner) { | |||
| 57 | assert_eq!(loaded2.wrap.target, 14); | 57 | assert_eq!(loaded2.wrap.target, 14); |
| 58 | 58 | ||
| 59 | // wrapping around the end of program space automatically works | 59 | // wrapping around the end of program space automatically works |
| 60 | let prg3 = pio_asm!("nop", "nop", "nop", "nop", "nop", "nop", "nop", "nop", "nop", "nop", "nop", "irq 2",); | 60 | let prg3 = pio_asm!( |
| 61 | "nop", "nop", "nop", "nop", "nop", "nop", "nop", "nop", "nop", "nop", "nop", "irq 2", | ||
| 62 | ); | ||
| 61 | let loaded3 = common.load_program(&prg3.program); | 63 | let loaded3 = common.load_program(&prg3.program); |
| 62 | assert_eq!(loaded3.origin, 24); | 64 | assert_eq!(loaded3.origin, 24); |
| 63 | assert_eq!(loaded3.wrap.source, 3); | 65 | assert_eq!(loaded3.wrap.source, 3); |
diff --git a/tests/rp/src/bin/rtc.rs b/tests/rp/src/bin/rtc.rs index c66981d95..e1def7b5b 100644 --- a/tests/rp/src/bin/rtc.rs +++ b/tests/rp/src/bin/rtc.rs | |||
| @@ -5,7 +5,7 @@ teleprobe_meta::target!(b"rpi-pico"); | |||
| 5 | 5 | ||
| 6 | use defmt::{assert, *}; | 6 | use defmt::{assert, *}; |
| 7 | use embassy_executor::Spawner; | 7 | use embassy_executor::Spawner; |
| 8 | use embassy_futures::select::{select, Either}; | 8 | use embassy_futures::select::{Either, select}; |
| 9 | use embassy_rp::bind_interrupts; | 9 | use embassy_rp::bind_interrupts; |
| 10 | use embassy_rp::rtc::{DateTime, DateTimeFilter, DayOfWeek, Rtc}; | 10 | use embassy_rp::rtc::{DateTime, DateTimeFilter, DayOfWeek, Rtc}; |
| 11 | use embassy_time::{Duration, Instant, Timer}; | 11 | use embassy_time::{Duration, Instant, Timer}; |
diff --git a/tests/rp/src/bin/spinlock_mutex_multicore.rs b/tests/rp/src/bin/spinlock_mutex_multicore.rs index c56d43ade..25c4faf37 100644 --- a/tests/rp/src/bin/spinlock_mutex_multicore.rs +++ b/tests/rp/src/bin/spinlock_mutex_multicore.rs | |||
| @@ -7,7 +7,7 @@ teleprobe_meta::target!(b"pimoroni-pico-plus-2"); | |||
| 7 | 7 | ||
| 8 | use defmt::{info, unwrap}; | 8 | use defmt::{info, unwrap}; |
| 9 | use embassy_executor::Executor; | 9 | use embassy_executor::Executor; |
| 10 | use embassy_rp::multicore::{spawn_core1, Stack}; | 10 | use embassy_rp::multicore::{Stack, spawn_core1}; |
| 11 | use embassy_rp::spinlock_mutex::SpinlockRawMutex; | 11 | use embassy_rp::spinlock_mutex::SpinlockRawMutex; |
| 12 | use embassy_sync::channel::Channel; | 12 | use embassy_sync::channel::Channel; |
| 13 | use static_cell::StaticCell; | 13 | use static_cell::StaticCell; |
diff --git a/tests/stm32/src/bin/afio.rs b/tests/stm32/src/bin/afio.rs index 81d50874b..d88765717 100644 --- a/tests/stm32/src/bin/afio.rs +++ b/tests/stm32/src/bin/afio.rs | |||
| @@ -16,7 +16,7 @@ use embassy_stm32::timer::qei::Qei; | |||
| 16 | use embassy_stm32::timer::simple_pwm::{PwmPin, SimplePwm}; | 16 | use embassy_stm32::timer::simple_pwm::{PwmPin, SimplePwm}; |
| 17 | use embassy_stm32::timer::{Ch1, Ch2}; | 17 | use embassy_stm32::timer::{Ch1, Ch2}; |
| 18 | use embassy_stm32::usart::{Uart, UartRx, UartTx}; | 18 | use embassy_stm32::usart::{Uart, UartRx, UartTx}; |
| 19 | use embassy_stm32::{bind_interrupts, Peripherals}; | 19 | use embassy_stm32::{Peripherals, bind_interrupts}; |
| 20 | 20 | ||
| 21 | #[cfg(not(feature = "afio-connectivity-line"))] | 21 | #[cfg(not(feature = "afio-connectivity-line"))] |
| 22 | bind_interrupts!(struct Irqs { | 22 | bind_interrupts!(struct Irqs { |
diff --git a/tests/stm32/src/bin/cryp.rs b/tests/stm32/src/bin/cryp.rs index f54c99cc3..640de50e3 100644 --- a/tests/stm32/src/bin/cryp.rs +++ b/tests/stm32/src/bin/cryp.rs | |||
| @@ -5,9 +5,9 @@ | |||
| 5 | #[path = "../common.rs"] | 5 | #[path = "../common.rs"] |
| 6 | mod common; | 6 | mod common; |
| 7 | 7 | ||
| 8 | use aes_gcm::Aes128Gcm; | ||
| 8 | use aes_gcm::aead::heapless::Vec; | 9 | use aes_gcm::aead::heapless::Vec; |
| 9 | use aes_gcm::aead::{AeadInPlace, KeyInit}; | 10 | use aes_gcm::aead::{AeadInPlace, KeyInit}; |
| 10 | use aes_gcm::Aes128Gcm; | ||
| 11 | use common::*; | 11 | use common::*; |
| 12 | use embassy_executor::Spawner; | 12 | use embassy_executor::Spawner; |
| 13 | use embassy_stm32::cryp::{self, *}; | 13 | use embassy_stm32::cryp::{self, *}; |
diff --git a/tests/stm32/src/bin/fdcan.rs b/tests/stm32/src/bin/fdcan.rs index c2a1a7bb8..d97f493df 100644 --- a/tests/stm32/src/bin/fdcan.rs +++ b/tests/stm32/src/bin/fdcan.rs | |||
| @@ -8,7 +8,7 @@ mod common; | |||
| 8 | use common::*; | 8 | use common::*; |
| 9 | use embassy_executor::Spawner; | 9 | use embassy_executor::Spawner; |
| 10 | use embassy_stm32::peripherals::*; | 10 | use embassy_stm32::peripherals::*; |
| 11 | use embassy_stm32::{bind_interrupts, can, Config}; | 11 | use embassy_stm32::{Config, bind_interrupts, can}; |
| 12 | use embassy_time::Duration; | 12 | use embassy_time::Duration; |
| 13 | use {defmt_rtt as _, panic_probe as _}; | 13 | use {defmt_rtt as _, panic_probe as _}; |
| 14 | 14 | ||
diff --git a/tests/stm32/src/bin/stop.rs b/tests/stm32/src/bin/stop.rs index 8119c1f39..833ca05d0 100644 --- a/tests/stm32/src/bin/stop.rs +++ b/tests/stm32/src/bin/stop.rs | |||
| @@ -9,10 +9,10 @@ use chrono::NaiveDate; | |||
| 9 | use common::*; | 9 | use common::*; |
| 10 | use cortex_m_rt::entry; | 10 | use cortex_m_rt::entry; |
| 11 | use embassy_executor::Spawner; | 11 | use embassy_executor::Spawner; |
| 12 | use embassy_stm32::low_power::{stop_ready, stop_with_rtc, Executor, StopMode}; | 12 | use embassy_stm32::Config; |
| 13 | use embassy_stm32::low_power::{Executor, StopMode, stop_ready, stop_with_rtc}; | ||
| 13 | use embassy_stm32::rcc::LsConfig; | 14 | use embassy_stm32::rcc::LsConfig; |
| 14 | use embassy_stm32::rtc::{Rtc, RtcConfig}; | 15 | use embassy_stm32::rtc::{Rtc, RtcConfig}; |
| 15 | use embassy_stm32::Config; | ||
| 16 | use embassy_time::Timer; | 16 | use embassy_time::Timer; |
| 17 | use static_cell::StaticCell; | 17 | use static_cell::StaticCell; |
| 18 | 18 | ||
diff --git a/tests/stm32/src/bin/ucpd.rs b/tests/stm32/src/bin/ucpd.rs index 97aefe1a0..c794afff8 100644 --- a/tests/stm32/src/bin/ucpd.rs +++ b/tests/stm32/src/bin/ucpd.rs | |||
| @@ -9,7 +9,7 @@ use defmt::{assert, assert_eq}; | |||
| 9 | use embassy_executor::Spawner; | 9 | use embassy_executor::Spawner; |
| 10 | use embassy_futures::join::join; | 10 | use embassy_futures::join::join; |
| 11 | use embassy_stm32::ucpd::{self, CcPhy, CcPull, CcSel, CcVState, RxError, Ucpd}; | 11 | use embassy_stm32::ucpd::{self, CcPhy, CcPull, CcSel, CcVState, RxError, Ucpd}; |
| 12 | use embassy_stm32::{bind_interrupts, peripherals, Peri}; | 12 | use embassy_stm32::{Peri, bind_interrupts, peripherals}; |
| 13 | use embassy_time::Timer; | 13 | use embassy_time::Timer; |
| 14 | 14 | ||
| 15 | bind_interrupts!(struct Irqs { | 15 | bind_interrupts!(struct Irqs { |
diff --git a/tests/stm32/src/bin/usart.rs b/tests/stm32/src/bin/usart.rs index 129c7b692..0b98d3eeb 100644 --- a/tests/stm32/src/bin/usart.rs +++ b/tests/stm32/src/bin/usart.rs | |||
| @@ -7,7 +7,7 @@ use common::*; | |||
| 7 | use defmt::{assert, assert_eq, unreachable}; | 7 | use defmt::{assert, assert_eq, unreachable}; |
| 8 | use embassy_executor::Spawner; | 8 | use embassy_executor::Spawner; |
| 9 | use embassy_stm32::usart::{Config, ConfigError, Error, Uart}; | 9 | use embassy_stm32::usart::{Config, ConfigError, Error, Uart}; |
| 10 | use embassy_time::{block_for, Duration, Instant}; | 10 | use embassy_time::{Duration, Instant, block_for}; |
| 11 | 11 | ||
| 12 | #[embassy_executor::main] | 12 | #[embassy_executor::main] |
| 13 | async fn main(_spawner: Spawner) { | 13 | async fn main(_spawner: Spawner) { |
diff --git a/tests/stm32/src/bin/wpan_ble.rs b/tests/stm32/src/bin/wpan_ble.rs index 8957bfc04..0f396b848 100644 --- a/tests/stm32/src/bin/wpan_ble.rs +++ b/tests/stm32/src/bin/wpan_ble.rs | |||
| @@ -12,16 +12,16 @@ use embassy_executor::Spawner; | |||
| 12 | use embassy_stm32::bind_interrupts; | 12 | use embassy_stm32::bind_interrupts; |
| 13 | use embassy_stm32::ipcc::{Config, ReceiveInterruptHandler, TransmitInterruptHandler}; | 13 | use embassy_stm32::ipcc::{Config, ReceiveInterruptHandler, TransmitInterruptHandler}; |
| 14 | use embassy_stm32::rcc::WPAN_DEFAULT; | 14 | use embassy_stm32::rcc::WPAN_DEFAULT; |
| 15 | use embassy_stm32_wpan::TlMbox; | ||
| 16 | use embassy_stm32_wpan::hci::BdAddr; | ||
| 15 | use embassy_stm32_wpan::hci::host::uart::UartHci; | 17 | use embassy_stm32_wpan::hci::host::uart::UartHci; |
| 16 | use embassy_stm32_wpan::hci::host::{AdvertisingFilterPolicy, EncryptionKey, HostHci, OwnAddressType}; | 18 | use embassy_stm32_wpan::hci::host::{AdvertisingFilterPolicy, EncryptionKey, HostHci, OwnAddressType}; |
| 17 | use embassy_stm32_wpan::hci::types::AdvertisingType; | 19 | use embassy_stm32_wpan::hci::types::AdvertisingType; |
| 18 | use embassy_stm32_wpan::hci::vendor::command::gap::{AdvertisingDataType, DiscoverableParameters, GapCommands, Role}; | 20 | use embassy_stm32_wpan::hci::vendor::command::gap::{AdvertisingDataType, DiscoverableParameters, GapCommands, Role}; |
| 19 | use embassy_stm32_wpan::hci::vendor::command::gatt::GattCommands; | 21 | use embassy_stm32_wpan::hci::vendor::command::gatt::GattCommands; |
| 20 | use embassy_stm32_wpan::hci::vendor::command::hal::{ConfigData, HalCommands, PowerLevel}; | 22 | use embassy_stm32_wpan::hci::vendor::command::hal::{ConfigData, HalCommands, PowerLevel}; |
| 21 | use embassy_stm32_wpan::hci::BdAddr; | ||
| 22 | use embassy_stm32_wpan::lhci::LhciC1DeviceInformationCcrp; | 23 | use embassy_stm32_wpan::lhci::LhciC1DeviceInformationCcrp; |
| 23 | use embassy_stm32_wpan::sub::mm; | 24 | use embassy_stm32_wpan::sub::mm; |
| 24 | use embassy_stm32_wpan::TlMbox; | ||
| 25 | use {defmt_rtt as _, panic_probe as _}; | 25 | use {defmt_rtt as _, panic_probe as _}; |
| 26 | 26 | ||
| 27 | bind_interrupts!(struct Irqs{ | 27 | bind_interrupts!(struct Irqs{ |
diff --git a/tests/stm32/src/bin/wpan_mac.rs b/tests/stm32/src/bin/wpan_mac.rs index 79e13d524..f27146c44 100644 --- a/tests/stm32/src/bin/wpan_mac.rs +++ b/tests/stm32/src/bin/wpan_mac.rs | |||
| @@ -10,13 +10,13 @@ use embassy_executor::Spawner; | |||
| 10 | use embassy_stm32::bind_interrupts; | 10 | use embassy_stm32::bind_interrupts; |
| 11 | use embassy_stm32::ipcc::{Config, ReceiveInterruptHandler, TransmitInterruptHandler}; | 11 | use embassy_stm32::ipcc::{Config, ReceiveInterruptHandler, TransmitInterruptHandler}; |
| 12 | use embassy_stm32::rcc::WPAN_DEFAULT; | 12 | use embassy_stm32::rcc::WPAN_DEFAULT; |
| 13 | use embassy_stm32_wpan::TlMbox; | ||
| 13 | use embassy_stm32_wpan::mac::commands::{AssociateRequest, GetRequest, ResetRequest, SetRequest}; | 14 | use embassy_stm32_wpan::mac::commands::{AssociateRequest, GetRequest, ResetRequest, SetRequest}; |
| 14 | use embassy_stm32_wpan::mac::event::MacEvent; | 15 | use embassy_stm32_wpan::mac::event::MacEvent; |
| 15 | use embassy_stm32_wpan::mac::typedefs::{ | 16 | use embassy_stm32_wpan::mac::typedefs::{ |
| 16 | AddressMode, Capabilities, KeyIdMode, MacAddress, MacChannel, PanId, PibId, SecurityLevel, | 17 | AddressMode, Capabilities, KeyIdMode, MacAddress, MacChannel, PanId, PibId, SecurityLevel, |
| 17 | }; | 18 | }; |
| 18 | use embassy_stm32_wpan::sub::mm; | 19 | use embassy_stm32_wpan::sub::mm; |
| 19 | use embassy_stm32_wpan::TlMbox; | ||
| 20 | use {defmt_rtt as _, panic_probe as _}; | 20 | use {defmt_rtt as _, panic_probe as _}; |
| 21 | 21 | ||
| 22 | bind_interrupts!(struct Irqs{ | 22 | bind_interrupts!(struct Irqs{ |
diff --git a/tests/stm32/src/common.rs b/tests/stm32/src/common.rs index f800769ab..2bd934d6f 100644 --- a/tests/stm32/src/common.rs +++ b/tests/stm32/src/common.rs | |||
| @@ -1,11 +1,11 @@ | |||
| 1 | #![macro_use] | 1 | #![macro_use] |
| 2 | 2 | ||
| 3 | pub use defmt::*; | 3 | pub use defmt::*; |
| 4 | use embassy_stm32::Config; | ||
| 4 | #[allow(unused)] | 5 | #[allow(unused)] |
| 5 | use embassy_stm32::rcc::*; | 6 | use embassy_stm32::rcc::*; |
| 6 | #[allow(unused)] | 7 | #[allow(unused)] |
| 7 | use embassy_stm32::time::Hertz; | 8 | use embassy_stm32::time::Hertz; |
| 8 | use embassy_stm32::Config; | ||
| 9 | use {defmt_rtt as _, panic_probe as _}; | 9 | use {defmt_rtt as _, panic_probe as _}; |
| 10 | 10 | ||
| 11 | #[cfg(feature = "stm32f103c8")] | 11 | #[cfg(feature = "stm32f103c8")] |
diff --git a/tests/utils/src/bin/saturate_serial.rs b/tests/utils/src/bin/saturate_serial.rs index 85676b106..1c8a8b322 100644 --- a/tests/utils/src/bin/saturate_serial.rs +++ b/tests/utils/src/bin/saturate_serial.rs | |||
| @@ -2,7 +2,7 @@ use std::path::Path; | |||
| 2 | use std::time::Duration; | 2 | use std::time::Duration; |
| 3 | use std::{env, io, process, thread}; | 3 | use std::{env, io, process, thread}; |
| 4 | 4 | ||
| 5 | use rand::{rng, Rng}; | 5 | use rand::{Rng, rng}; |
| 6 | use serial::SerialPort; | 6 | use serial::SerialPort; |
| 7 | 7 | ||
| 8 | pub fn main() { | 8 | pub fn main() { |
