1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
pub const FIRST_LINE_ADDRESS: u8 = 0x00;
const SECOND_LINE_ADDRESS: u8 = 0x40;

/// Enumeration of default lines.
pub enum DefaultLines {
    One,
    Two,
}

impl From<DefaultLines> for u8 {
    /// Returns the hardware address of the line.
    fn from(line: DefaultLines) -> Self {
        match line {
            DefaultLines::One => FIRST_LINE_ADDRESS,
            DefaultLines::Two => SECOND_LINE_ADDRESS,
        }
    }
}