unsafe forbidden License

libmedium

A safe rust library to communicate with the sysfs interface of lm-sensors.

Usage

Just add this to your Cargo.toml file:

toml [dependencies] libmedium = "0.6"

Cargo-Features

Standard features

Non standard features

Examples

```rust use libmedium::{ parse_hwmons, sensors::{Input, Sensor}, };

let hwmons = parsehwmons().unwrap(); for (hwmonindex, hwmonname, hwmon) in &hwmons { println!("hwmon{} with name {}:", hwmonindex, hwmonname); for (, tempsensor) in hwmon.temps() { let temperature = tempsensor.readinput().unwrap(); println!("\t{}: {}", tempsensor.name(), temperature); } } ```

```rust use libmedium::{ parse_hwmons, sensors::WriteablePwmSensor, units::{Pwm, PwmEnable}, };

let hwmons = parsehwmons().unwrap(); for (, , hwmon) in &hwmons { for (, pwm) in hwmon.writeablepwms() { pwm.writeenable(PwmEnable::ManualControl).unwrap(); pwm.writepwm(Pwm::fromu8(255)).unwrap(); } } ```

License

This project is licensed under the MIT License - see the LICENSE file for details