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:

[dependencies] libmedium = "0.2"

Cargo-Features

Standard features

Non standard features

Examples

```rust use libmedium::{ Hwmon, Hwmons, sensors::{Sensor, SensorBase}, };

let hwmons = Hwmons::parsereadonly().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{}: {}", temp_sensor.name(), temperature); } } ```

```rust use libmedium::{ Hwmon, Hwmons, sensors::PwmSensor, units::{Pwm, PwmEnable}, };

let hwmons = Hwmons::parsereadwrite().unwrap(); for (, _, hwmon) in &hwmons { for (, pwm) in hwmon.pwms() { pwm.writeenable(PwmEnable::ManualControl).unwrap(); pwm.writepwm(Pwm::from_percent(100.0)).unwrap(); } } ```

License

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