pub struct Diagnostics { /* private fields */ }Expand description
Diagnostics flags from the DIAG_AGC register (0x3FFD)
Implementations§
Source§impl Diagnostics
impl Diagnostics
Sourcepub const fn comp_high(&self) -> bool
pub const fn comp_high(&self) -> bool
COMP_HIGH: Magnetic field too strong
Set when the magnetic field is above the recommended range The sensor may still work but accuracy could be affected
Sourcepub const fn comp_low(&self) -> bool
pub const fn comp_low(&self) -> bool
COMP_LOW: Magnetic field too weak
Set when the magnetic field is below the recommended range The sensor may still work but accuracy could be affected
Sourcepub const fn cordic_overflow(&self) -> bool
pub const fn cordic_overflow(&self) -> bool
COF: CORDIC overflow
Set when an overflow occurred in the CORDIC calculation When this bit is set, angle and magnitude data is invalid
Sourcepub const fn offset_comp_finished(&self) -> bool
pub const fn offset_comp_finished(&self) -> bool
OCF: Offset compensation finished
This flag is set to 1 after power-up when the offset compensation algorithm has finished. After power-up, the flag remains at 1
Sourcepub const fn agc_value(&self) -> u8
pub const fn agc_value(&self) -> u8
Get the Automatic Gain Control (AGC) value
Returns an 8-bit value where:
- 0 = high magnetic field (close to sensor)
- 255 = low magnetic field (far from sensor)
Typical values are between 60-200. Values outside this range may indicate the magnet is too close or too far
Sourcepub const fn magnetic_field_ok(&self) -> bool
pub const fn magnetic_field_ok(&self) -> bool
Check if the magnetic field strength is within acceptable range
Returns true if neither COMP_HIGH nor COMP_LOW is set
Trait Implementations§
Source§impl Clone for Diagnostics
impl Clone for Diagnostics
Source§fn clone(&self) -> Diagnostics
fn clone(&self) -> Diagnostics
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more