mirror of
https://github.com/embassy-rs/embassy.git
synced 2025-10-02 22:54:52 +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,
|
CaptureCompareInterruptHandler, Channel, Channel1Pin, Channel2Pin, Channel3Pin, Channel4Pin,
|
||||||
GeneralInstance4Channel,
|
GeneralInstance4Channel,
|
||||||
};
|
};
|
||||||
|
pub use super::{Ch1, Ch2, Ch3, Ch4};
|
||||||
use crate::gpio::{AfType, AnyPin, Pull};
|
use crate::gpio::{AfType, AnyPin, Pull};
|
||||||
use crate::interrupt::typelevel::{Binding, Interrupt};
|
use crate::interrupt::typelevel::{Binding, Interrupt};
|
||||||
use crate::time::Hertz;
|
use crate::time::Hertz;
|
||||||
use crate::Peripheral;
|
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.
|
/// Capture pin wrapper.
|
||||||
///
|
///
|
||||||
/// This wraps a pin to make it usable with capture.
|
/// 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.
|
/// Amount of bits of a timer.
|
||||||
#[derive(Clone, Copy, PartialEq, Eq, Debug)]
|
#[derive(Clone, Copy, PartialEq, Eq, Debug)]
|
||||||
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
|
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
|
||||||
|
@ -6,6 +6,7 @@ use embassy_hal_internal::{into_ref, PeripheralRef};
|
|||||||
use stm32_metapac::timer::vals;
|
use stm32_metapac::timer::vals;
|
||||||
|
|
||||||
use super::low_level::Timer;
|
use super::low_level::Timer;
|
||||||
|
pub use super::{Ch1, Ch2};
|
||||||
use super::{Channel1Pin, Channel2Pin, GeneralInstance4Channel};
|
use super::{Channel1Pin, Channel2Pin, GeneralInstance4Channel};
|
||||||
use crate::gpio::{AfType, AnyPin, Pull};
|
use crate::gpio::{AfType, AnyPin, Pull};
|
||||||
use crate::Peripheral;
|
use crate::Peripheral;
|
||||||
@ -18,11 +19,6 @@ pub enum Direction {
|
|||||||
Downcounting,
|
Downcounting,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Channel 1 marker type.
|
|
||||||
pub enum Ch1 {}
|
|
||||||
/// Channel 2 marker type.
|
|
||||||
pub enum Ch2 {}
|
|
||||||
|
|
||||||
/// Wrapper for using a pin with QEI.
|
/// Wrapper for using a pin with QEI.
|
||||||
pub struct QeiPin<'d, T, Channel> {
|
pub struct QeiPin<'d, T, Channel> {
|
||||||
_pin: PeripheralRef<'d, AnyPin>,
|
_pin: PeripheralRef<'d, AnyPin>,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user