Crates.io | ads122x04 |
lib.rs | ads122x04 |
version | 0.3.0 |
source | src |
created_at | 2023-09-07 15:59:13.381256 |
updated_at | 2023-11-29 09:12:50.28782 |
description | Platform-agnostic driver for the ADS122C04 and ADS122U04 analog to digital converters. |
homepage | https://github.com/hacknus/ads122x04-rs |
repository | https://github.com/hacknus/ads122x04-rs |
max_upload_size | |
id | 966367 |
size | 38,455 |
A platform agnostic rust driver for the ADS122U04 (UART) and ADS122C04 (I2C) ADC from Texas Instruments.
To use this driver, consult the I2C example below:
use ads122x04::{interface::*, registers::*, ADS122x04, Error as ADS122x04Error};
{
let mut adc = ADS122x04::new_i2c(address, i2c);
adc.reset();
adc.calibrate_offset();
adc.set_input_mux(Mux::Ain1Ain0);
adc.set_conversion_mode(ConversionMode::Continuous);
adc.set_current_level(CurrentSource::Off);
adc.set_current_route_1(CurrentRoute::Ain3);
adc.start();
let measurement = adc.get_voltage();
}
TODO: