FaultStatus

Struct FaultStatus 

Source
pub struct FaultStatus {
    pub fault: bool,
    pub gvdd_uv: bool,
    pub gvdd_ov: bool,
    pub pvdd_uv: bool,
    pub otsd: bool,
    pub otw: bool,
    pub fetha_oc: bool,
    pub fetla_oc: bool,
    pub fethb_oc: bool,
    pub fetlb_oc: bool,
    pub fethc_oc: bool,
    pub fetlc_oc: bool,
}
Expand description

Complete fault status from both DRV8301 status registers

This struct provides a comprehensive view of all fault conditions reported by the DRV8301 gate driver IC.

Fields§

§fault: bool

Master fault indicator (OR of all fault conditions)

§gvdd_uv: bool

GVDD undervoltage fault (GVDD < ~8V)

§gvdd_ov: bool

GVDD overvoltage fault (GVDD > ~16V)

§pvdd_uv: bool

PVDD undervoltage fault (PVDD < ~5.9V)

§otsd: bool

Overtemperature shutdown (die temp > ~150°C)

§otw: bool

Overtemperature warning (die temp > ~130°C)

§fetha_oc: bool

Phase A high-side FET overcurrent

§fetla_oc: bool

Phase A low-side FET overcurrent

§fethb_oc: bool

Phase B high-side FET overcurrent

§fetlb_oc: bool

Phase B low-side FET overcurrent

§fethc_oc: bool

Phase C high-side FET overcurrent

§fetlc_oc: bool

Phase C low-side FET overcurrent

Implementations§

Source§

impl FaultStatus

Source

pub fn has_overcurrent(&self) -> bool

Returns true if any overcurrent fault is active on any phase

Source

pub fn has_thermal(&self) -> bool

Returns true if any thermal condition (warning or shutdown) is active

Source

pub fn has_voltage_fault(&self) -> bool

Returns true if any voltage fault (UV or OV) is active

Source

pub fn is_ok(&self) -> bool

Returns true if no faults are active

Source

pub fn phase_a_overcurrent(&self) -> bool

Returns true if any phase A FET has an overcurrent fault

Source

pub fn phase_b_overcurrent(&self) -> bool

Returns true if any phase B FET has an overcurrent fault

Source

pub fn phase_c_overcurrent(&self) -> bool

Returns true if any phase C FET has an overcurrent fault

Trait Implementations§

Source§

impl Clone for FaultStatus

Source§

fn clone(&self) -> FaultStatus

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for FaultStatus

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for FaultStatus

Source§

fn default() -> FaultStatus

Returns the “default value” for a type. Read more
Source§

impl PartialEq for FaultStatus

Source§

fn eq(&self, other: &FaultStatus) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for FaultStatus

Source§

impl Eq for FaultStatus

Source§

impl StructuralPartialEq for FaultStatus

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.