Struct hmc5883_async::HMC5983
source · [−]pub struct HMC5983<I2C> { /* private fields */ }
Implementations
sourceimpl<I2C, CommE> HMC5983<I2C> where
I2C: I2c<Error = CommE>,
CommE: Debug,
impl<I2C, CommE> HMC5983<I2C> where
I2C: I2c<Error = CommE>,
CommE: Debug,
pub fn new(i2c: I2C) -> Self
pub async fn init(
&mut self,
delay_source: &mut impl DelayUs
) -> Result<(), Error<CommE>>
sourcepub async fn set_gain(&mut self, gain: GainSetting) -> Result<(), Error<CommE>>
pub async fn set_gain(&mut self, gain: GainSetting) -> Result<(), Error<CommE>>
Set the mag gain, which determines the range
sourcepub async fn set_all_config_a(
&mut self,
mode: MeasurementModeSetting,
odr: OdrSetting,
averaging: SampleAvgSetting,
temp_enabled: bool
) -> Result<(), Error<CommE>>
pub async fn set_all_config_a(
&mut self,
mode: MeasurementModeSetting,
odr: OdrSetting,
averaging: SampleAvgSetting,
temp_enabled: bool
) -> Result<(), Error<CommE>>
Set all of the Config A register settings
pub async fn get_mag_vector(&mut self) -> Result<[i16; 3], Error<CommE>>
sourcepub async fn get_temperature(&mut self) -> Result<i16, Error<CommE>>
pub async fn get_temperature(&mut self) -> Result<i16, Error<CommE>>
Read temperature from device Result is degrees Celsius
Trait Implementations
Auto Trait Implementations
impl<I2C> RefUnwindSafe for HMC5983<I2C> where
I2C: RefUnwindSafe,
impl<I2C> Send for HMC5983<I2C> where
I2C: Send,
impl<I2C> Sync for HMC5983<I2C> where
I2C: Sync,
impl<I2C> Unpin for HMC5983<I2C> where
I2C: Unpin,
impl<I2C> UnwindSafe for HMC5983<I2C> where
I2C: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more