tof_control/helper/
tcpc_type.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#[derive(Debug)]
pub struct TCPCTemp {
    pub tcpc_temp: f32,
}

#[derive(Debug)]
pub struct TCPCVcp {
    pub tcpc_vcp: [f32; 3],
}

#[derive(Debug)]
pub enum TCPCTempError {
    /// I2C Error
    I2C(i2cdev::linux::LinuxI2CError),
}

impl From<i2cdev::linux::LinuxI2CError> for TCPCTempError {
    fn from(e: i2cdev::linux::LinuxI2CError) -> Self {
        TCPCTempError::I2C(e)
    }
}

#[derive(Debug)]
pub enum TCPCVcpError {
    /// I2C Error
    I2C(i2cdev::linux::LinuxI2CError),
}

impl From<i2cdev::linux::LinuxI2CError> for TCPCVcpError {
    fn from(e: i2cdev::linux::LinuxI2CError) -> Self {
        TCPCVcpError::I2C(e)
    }
}