embassy-stm32 0.6.0

Embassy Hardware Abstraction Layer (HAL) for ST STM32 series microcontrollers
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::pac::lptim::vals;

/// Direction of a low-power timer channel
pub enum ChannelDirection {
    /// Use channel as a PWM output
    OutputPwm,
    /// Use channel as an input capture
    InputCapture,
}

impl From<ChannelDirection> for vals::Ccsel {
    fn from(direction: ChannelDirection) -> Self {
        match direction {
            ChannelDirection::OutputPwm => vals::Ccsel::OUTPUT_COMPARE,
            ChannelDirection::InputCapture => vals::Ccsel::INPUT_CAPTURE,
        }
    }
}