mod driver;
mod register;

use anyhow::Result;

#[derive(Clone, Debug, PartialEq, Eq)]
pub struct A4963Diagnostic {
    pub fault_flag: bool,
    pub power_on_reset: bool,
    pub serial_transfer_error: bool,
    pub high_temperature_warning: bool,
    pub overtemperature_shutdown: bool,
    pub loss_of_synchronization: bool,
    pub undervoltage: bool,
    pub phase_a_high_side_fault: bool,
    pub phase_a_low_side_fault: bool,
    pub phase_b_high_side_fault: bool,
    pub phase_b_low_side_fault: bool,
    pub phase_c_high_side_fault: bool,
    pub phase_c_low_side_fault: bool,
}

pub trait A4963 {

    fn check_health(&mut self) -> Result<A4963Diagnostic>;

    fn write_configuration(&mut self) -> Result<()>;

    // fn check_health(&mut self) -> Result<()>;
}

pub use driver::A4963Driver;
