lm73

Crates.iolm73
lib.rslm73
version0.1.1
sourcesrc
created_at2018-12-07 20:07:04.692648
updated_at2018-12-15 13:54:29.647966
descriptionPlatform-agnostic Rust driver for the LM73 temperature sensor and thermal watchdog.
homepagehttps://github.com/iohe/lm73-rs
repositoryhttps://github.com/iohe/lm73-rs
max_upload_size
id100678
size34,049
Ioan Herisanu (iohe)

documentation

https://docs.rs/lm73

README

Rust LM73 Temperature Sensor and Thermal Watchdog Driver

crates.io Docs Build Status Coverage Status Maintenance Intention

This is based on LM75 work of Diego Barrios Romero

This is a platform agnostic Rust driver for the LM73 temperature sensor and thermal watchdog, based on the embedded-hal traits.

This driver allows you to:

  • Enable/disable the device.
  • Read the temperature.

The device

The LM73 temperature sensor includes a delta-sigma analog-to-digital converter, and a digital overtemperature detector. The host can query the LM73 through its I2C interface to read temperature at any time.

Datasheet:

Usage

extern crate linux_embedded_hal as hal;
extern crate lm73;

use hal::I2cdev;
use lm73::{ Lm73, SlaveAddr };

fn main() {
    let dev = I2cdev::new("/dev/i2c-1").unwrap();
    let address = SlaveAddr::default();
    let mut sensor = Lm73::new(dev, address);
    let temp_celsius = sensor.read_temperature().unwrap();
    println!("Temperature: {}ÂșC", temp_celsius);
}

License

Licensed under either of

Contributing

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.

Commit count: 7

cargo fmt