aboutsummaryrefslogtreecommitdiff
path: root/embassy-stm32/src/lptim/channel.rs
blob: 17fc2fb8609dc845b27aea777a1280de024d2378 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/// Timer channel.
#[derive(Clone, Copy)]
pub enum Channel {
    /// Channel 1.
    Ch1,
    /// Channel 2.
    Ch2,
}

impl Channel {
    /// Get the channel index (0..1)
    pub fn index(&self) -> usize {
        match self {
            Channel::Ch1 => 0,
            Channel::Ch2 => 1,
        }
    }
}