#embedded-hal-driver #accelerometer

mc3479

Driver for the MEMSIC MC3479 16-bit 3-axis accelerometer

1 unstable release

Uses new Rust 2024

0.1.0 Oct 16, 2025

#782 in Hardware support

Download history 226/week @ 2025-10-16 87/week @ 2025-10-23 34/week @ 2025-10-30 23/week @ 2025-11-06 68/week @ 2025-11-13 69/week @ 2025-11-20 80/week @ 2025-11-27 62/week @ 2025-12-04 61/week @ 2025-12-11 37/week @ 2025-12-18

170 downloads per month

BSD-2-Clause-Patent

49KB
1K SLoC

MC3479

A Rust driver for the MEMSIC MC3479 16-bit 3-axis accelerometer.


lib.rs:

MC3479

A Rust driver for the MEMSIC MC3479 16-bit 3-axis accelerometer.

The device has two different operational states, standby and wake, and reconfiguring the device is only allowed in the standby state. These two states are realized in the form of two different Rust types, StandbyState and WakeState, with methods that allow for transitioning from one state to the other.

Example

let mut standby = match mc3479::StandbyState::new(i2c, TargetAddr::Addr0) {
    Ok(standby) => standby,
    Err((err, _i2c)) => {
        panic!("Failed to initialize MC3479 driver: {err}");
    },
};
standby.set_sample_rate(SampleRate::_1000Hz).unwrap();
standby.set_range(Range::_8g).unwrap();
standby.set_fifo_enabled(true).unwrap();
let wake = match standby.wake() {
    Ok(wake) => wake,
    Err((err, _standby)) => panic!("Failed to transition to wake state: {err}"),
};

Dependencies

~56KB