1 | /// Timer channel. |
---|---|
2 | #[derive(Clone, Copy)] |
3 | pub enum Channel { |
4 | /// Channel 1. |
5 | Ch1, |
6 | /// Channel 2. |
7 | Ch2, |
8 | } |
9 | |
10 | impl Channel { |
11 | /// Get the channel index (0..1) |
12 | pub fn index(&self) -> usize { |
13 | match self { |
14 | Channel::Ch1 => 0, |
15 | Channel::Ch2 => 1, |
16 | } |
17 | } |
18 | } |
19 |