[][src]Struct ufire_sht20::SHT20

pub struct SHT20 { /* fields omitted */ }

Methods

impl SHT20[src]

pub fn new(filename: &'static str) -> Result<Self, Box<LinuxI2CError>>[src]

Create a new SHT20 object

Pass the i2c port to use.

Example

let mut sht20 = SHT20::new("/dev/i2c-3").unwrap();

pub fn temperature(&mut self) -> Result<f32, Box<LinuxI2CError>>[src]

Start a temperature measurement

Example

let mut sht20 = SHT20::new("/dev/i2c-3").unwrap();
let temp:f32 = sht20.temperature().unwrap();

pub fn humidity(&mut self) -> Result<f32, Box<LinuxI2CError>>[src]

Start a humidity measurement

Example

let mut sht20 = SHT20::new("/dev/i2c-3").unwrap();
let hum:f32 = sht20.humidity().unwrap();

pub fn _reset(&mut self) -> Result<(), Box<LinuxI2CError>>[src]

pub fn _write_register(
    &mut self,
    register: u8,
    f_val: f32
) -> Result<(), Box<LinuxI2CError>>
[src]

pub fn _read_register(
    &mut self,
    register: u8
) -> Result<f32, Box<LinuxI2CError>>
[src]

pub fn _change_register(
    &mut self,
    register: u8
) -> Result<(), Box<LinuxI2CError>>
[src]

Auto Trait Implementations

impl Send for SHT20

impl Unpin for SHT20

impl Sync for SHT20

impl UnwindSafe for SHT20

impl RefUnwindSafe for SHT20

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]