tof_control/helper/
pb_type.rsuse serde::{Deserialize, Serialize};
#[derive(Debug, Serialize, Deserialize)]
pub struct PBMoniData {
pub pb_temp: PBTemp,
pub pb_vcp: PBVcp,
}
#[derive(Debug, Serialize, Deserialize)]
pub struct PBTemp {
pub pds_temp: f32,
pub pas_temp: f32,
pub nas_temp: f32,
pub shv_temp: f32,
}
#[derive(Debug, Serialize, Deserialize)]
pub struct PBVcp {
pub p3v6_pa_vcp: [f32; 3],
pub n1v6_pa_vcp: [f32; 3],
pub p3v4f_ltb_vcp: [f32; 3],
pub p3v4d_ltb_vcp: [f32; 3],
pub p3v6_ltb_vcp: [f32; 3],
pub n1v6_ltb_vcp: [f32; 3],
}
#[derive(Debug)]
pub enum PBError {
I2C(i2cdev::linux::LinuxI2CError),
}
impl std::fmt::Display for PBError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "PBError")
}
}
impl From<i2cdev::linux::LinuxI2CError> for PBError {
fn from(e: i2cdev::linux::LinuxI2CError) -> Self {
PBError::I2C(e)
}
}