pub struct MpuConfig<MODE> { /* private fields */ }
Expand description
Configuration of MPU9250
Implementations§
source§impl MpuConfig<Imu>
impl MpuConfig<Imu>
sourcepub fn imu() -> Self
pub fn imu() -> Self
Creates configuration for Imu
driver (accelerometer + gyroscope).
with default Accel scale
, Gyro scale
, [Mag scale
],
AccelDataRate
, GyroTempDataRate
,
and no sample rate divisor.
source§impl MpuConfig<Marg>
impl MpuConfig<Marg>
sourcepub fn marg() -> Self
pub fn marg() -> Self
Creates configuration for Marg
driver
(accelerometer + gyroscope + magnetometer)
with default Accel scale
, Gyro scale
, Mag scale
,
AccelDataRate
, GyroTempDataRate
,
and no sample rate divisor.
source§impl<MODE> MpuConfig<MODE>
impl<MODE> MpuConfig<MODE>
sourcepub fn gyro_scale(&mut self, scale: GyroScale) -> &mut Self
pub fn gyro_scale(&mut self, scale: GyroScale) -> &mut Self
Sets gyroscope full reading scale (Gyro scale
).
sourcepub fn accel_scale(&mut self, scale: AccelScale) -> &mut Self
pub fn accel_scale(&mut self, scale: AccelScale) -> &mut Self
Sets accelerometer full reading scale (Accel scale
).
sourcepub fn accel_data_rate(&mut self, data_rate: AccelDataRate) -> &mut Self
pub fn accel_data_rate(&mut self, data_rate: AccelDataRate) -> &mut Self
Sets accelerometer data rate config (AccelDataRate
).
sourcepub fn gyro_temp_data_rate(&mut self, data_rate: GyroTempDataRate) -> &mut Self
pub fn gyro_temp_data_rate(&mut self, data_rate: GyroTempDataRate) -> &mut Self
Sets gyroscope and temperatures data rate config
(GyroTempDataRate
).
sourcepub fn sample_rate_divisor(&mut self, smplrt_div: u8) -> &mut Self
pub fn sample_rate_divisor(&mut self, smplrt_div: u8) -> &mut Self
Sets sample rate divisor.
Sample rate divisor divides the internal sample rate to generate
the sample rate that controls sensor data output rate, FIFO sample
rate. NOTE: This register is only effective when dlpf mode used for
GyroTempDataRate see GyroTempDataRate
.
SampleRate = InternalSampleRate / (1 + SMPLRT_DIV).