diff options
Diffstat (limited to 'embassy-mspm0/src/lib.rs')
| -rw-r--r-- | embassy-mspm0/src/lib.rs | 19 |
1 files changed, 19 insertions, 0 deletions
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; | |||
| 8 | pub mod gpio; | 8 | pub mod gpio; |
| 9 | pub mod timer; | 9 | pub mod timer; |
| 10 | 10 | ||
| 11 | /// Operating modes for peripherals. | ||
| 12 | pub mod mode { | ||
| 13 | trait SealedMode {} | ||
| 14 | |||
| 15 | /// Operating mode for a peripheral. | ||
| 16 | #[allow(private_bounds)] | ||
| 17 | pub trait Mode: SealedMode {} | ||
| 18 | |||
| 19 | /// Blocking mode. | ||
| 20 | pub struct Blocking; | ||
| 21 | impl SealedMode for Blocking {} | ||
| 22 | impl Mode for Blocking {} | ||
| 23 | |||
| 24 | /// Async mode. | ||
| 25 | pub struct Async; | ||
| 26 | impl SealedMode for Async {} | ||
| 27 | impl Mode for Async {} | ||
| 28 | } | ||
| 29 | |||
| 11 | #[cfg(feature = "_time-driver")] | 30 | #[cfg(feature = "_time-driver")] |
| 12 | mod time_driver; | 31 | mod time_driver; |
| 13 | 32 | ||
