mirror of
https://github.com/embassy-rs/embassy.git
synced 2025-09-29 05:11:31 +00:00
stm32/timer: Merge channel typestate structs
This commit is contained in:
parent
d097ccc68c
commit
eee2d8c84d
@ -12,20 +12,12 @@ use super::{
|
||||
CaptureCompareInterruptHandler, Channel, Channel1Pin, Channel2Pin, Channel3Pin, Channel4Pin,
|
||||
GeneralInstance4Channel,
|
||||
};
|
||||
pub use super::{Ch1, Ch2, Ch3, Ch4};
|
||||
use crate::gpio::{AfType, AnyPin, Pull};
|
||||
use crate::interrupt::typelevel::{Binding, Interrupt};
|
||||
use crate::time::Hertz;
|
||||
use crate::Peripheral;
|
||||
|
||||
/// Channel 1 marker type.
|
||||
pub enum Ch1 {}
|
||||
/// Channel 2 marker type.
|
||||
pub enum Ch2 {}
|
||||
/// Channel 3 marker type.
|
||||
pub enum Ch3 {}
|
||||
/// Channel 4 marker type.
|
||||
pub enum Ch4 {}
|
||||
|
||||
/// Capture pin wrapper.
|
||||
///
|
||||
/// This wraps a pin to make it usable with capture.
|
||||
|
@ -41,6 +41,15 @@ impl Channel {
|
||||
}
|
||||
}
|
||||
|
||||
/// Channel 1 marker type.
|
||||
pub enum Ch1 {}
|
||||
/// Channel 2 marker type.
|
||||
pub enum Ch2 {}
|
||||
/// Channel 3 marker type.
|
||||
pub enum Ch3 {}
|
||||
/// Channel 4 marker type.
|
||||
pub enum Ch4 {}
|
||||
|
||||
/// Amount of bits of a timer.
|
||||
#[derive(Clone, Copy, PartialEq, Eq, Debug)]
|
||||
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
|
||||
|
@ -6,6 +6,7 @@ use embassy_hal_internal::{into_ref, PeripheralRef};
|
||||
use stm32_metapac::timer::vals;
|
||||
|
||||
use super::low_level::Timer;
|
||||
pub use super::{Ch1, Ch2};
|
||||
use super::{Channel1Pin, Channel2Pin, GeneralInstance4Channel};
|
||||
use crate::gpio::{AfType, AnyPin, Pull};
|
||||
use crate::Peripheral;
|
||||
@ -18,11 +19,6 @@ pub enum Direction {
|
||||
Downcounting,
|
||||
}
|
||||
|
||||
/// Channel 1 marker type.
|
||||
pub enum Ch1 {}
|
||||
/// Channel 2 marker type.
|
||||
pub enum Ch2 {}
|
||||
|
||||
/// Wrapper for using a pin with QEI.
|
||||
pub struct QeiPin<'d, T, Channel> {
|
||||
_pin: PeripheralRef<'d, AnyPin>,
|
||||
|
Loading…
x
Reference in New Issue
Block a user