From 07da54ec18ce5c8dbd07b3d894665e54b75dbe52 Mon Sep 17 00:00:00 2001 From: i509VCB Date: Fri, 21 Mar 2025 19:18:19 -0500 Subject: mspm0: generate all singletons --- embassy-mspm0/src/lib.rs | 19 +++++++++++++++++++ embassy-mspm0/src/time_driver.rs | 3 +++ 2 files changed, 22 insertions(+) (limited to 'embassy-mspm0/src') diff --git a/embassy-mspm0/src/lib.rs b/embassy-mspm0/src/lib.rs index 1191b1010..f13245453 100644 --- a/embassy-mspm0/src/lib.rs +++ b/embassy-mspm0/src/lib.rs @@ -8,6 +8,25 @@ pub(crate) mod fmt; pub mod gpio; pub mod timer; +/// Operating modes for peripherals. +pub mod mode { + trait SealedMode {} + + /// Operating mode for a peripheral. + #[allow(private_bounds)] + pub trait Mode: SealedMode {} + + /// Blocking mode. + pub struct Blocking; + impl SealedMode for Blocking {} + impl Mode for Blocking {} + + /// Async mode. + pub struct Async; + impl SealedMode for Async {} + impl Mode for Async {} +} + #[cfg(feature = "_time-driver")] mod time_driver; diff --git a/embassy-mspm0/src/time_driver.rs b/embassy-mspm0/src/time_driver.rs index 937ce58d4..e80e89e55 100644 --- a/embassy-mspm0/src/time_driver.rs +++ b/embassy-mspm0/src/time_driver.rs @@ -12,6 +12,9 @@ use mspm0_metapac::tim::{Counterregs16, Tim}; use crate::peripherals; use crate::timer::SealedTimer; +#[cfg(any(time_driver_timg12, time_driver_timg13))] +compile_error!("TIMG12 and TIMG13 are not supported by the time driver yet"); + // Currently TIMG12 and TIMG13 are excluded because those are 32-bit timers. #[cfg(time_driver_timg0)] type T = peripherals::TIMG0; -- cgit