Skip to content

Rust library for the Microchip MCP346x family of ADCs

Notifications You must be signed in to change notification settings

zandemax/mcp346x-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MCP346x Sigma-Delta ADC

crates.io docs.rs

This crate contains a platform-agnostic driver for the MCP346[1/2/4] Sigma-Delta ADC, using the embedded-hal traits.

Currently, you can:

  • Initialize the device
  • Configure Input MUX and IRQ Pullup
  • Set the conversion or power down mode
  • Obtain measurements

Usage

Single Measurement

use mcp346x::*;

let spi_pins = (sck, miso, mosi);
let spi = Spi::new(p.SPI0, spi_pins, Frequency::K500, MODE_0);

let address = 0b01; // This is the default address for most chips
let mut adc = MCP346x::new(spi, address).into_continuous_mode()?;

adc.set_clock_source(mcp346x::ClockSource::Internal)?;
adc.set_irq_internal_pullup(true)?;

let voltage = adc.measure()?;

Status

  • Initialization
  • Powerdown/wakeup/conversion
  • Take Measurements
  • Input MUX configuration
  • SCAN mode
  • Expose other Configurations
  • Communication CRC checksums

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

About

Rust library for the Microchip MCP346x family of ADCs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages