tof_control/ltb_control/
ltb_init.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
use crate::ltb_control::{ltb_temp, ltb_threshold};
use crate::helper::ltb_type::LTBError;

pub fn initialize() -> Result<(), LTBError> {
    // Set Default Threshold Voltages
    initialize_threshold()?;
    // Initialize Temp Sensor
    initialize_temp()?;
    
    Ok(())
}

fn initialize_threshold() -> Result<(), LTBError> {
    ltb_threshold::set_default_threshold()?;

    Ok(())
}

fn initialize_temp() -> Result<(), LTBError> {
    // Configure Temp Sensors (TMP112)
    ltb_temp::config_temp()?;

    Ok(())
}