| 1 | use crate::pac::lptim::vals; |
|---|---|
| 2 | |
| 3 | /// Direction of a low-power timer channel |
| 4 | pub enum ChannelDirection { |
| 5 | /// Use channel as a PWM output |
| 6 | OutputPwm, |
| 7 | /// Use channel as an input capture |
| 8 | InputCapture, |
| 9 | } |
| 10 | |
| 11 | impl From<ChannelDirection> for vals::Ccsel { |
| 12 | fn from(direction: ChannelDirection) -> Self { |
| 13 | match direction { |
| 14 | ChannelDirection::OutputPwm => vals::Ccsel::OUTPUT_COMPARE, |
| 15 | ChannelDirection::InputCapture => vals::Ccsel::INPUT_CAPTURE, |
| 16 | } |
| 17 | } |
| 18 | } |
| 19 |
