[][src]Trait libmedium::sensors::PwmSensor

pub trait PwmSensor: SensorBase {
    fn read_pwm(&self) -> Result<Pwm, Error> { ... }
fn read_enable(&self) -> Result<PwmEnable, Error> { ... }
fn read_mode(&self) -> Result<PwmMode, Error> { ... }
fn read_frequency(&self) -> Result<Frequency, Error> { ... }
fn write_pwm(&self, pwm: Pwm) -> Result<(), Error>
    where
        Self: WritableSensorBase
, { ... }
fn write_enable(&self, enable: PwmEnable) -> Result<(), Error>
    where
        Self: WritableSensorBase
, { ... }
fn write_mode(&self, mode: PwmMode) -> Result<(), Error>
    where
        Self: WritableSensorBase
, { ... }
fn write_frequency(&self, freq: Frequency) -> Result<(), Error>
    where
        Self: WritableSensorBase
, { ... } }

Trait implemented by all pwm sensors.

Provided methods

fn read_pwm(&self) -> Result<Pwm, Error>

Reads the pwm subfunction of this pwm sensor. Returns an error, if this sensor doesn't support the subfunction.

fn read_enable(&self) -> Result<PwmEnable, Error>

Reads the enable subfunction of this pwm sensor. Returns an error, if this sensor doesn't support the subfunction.

fn read_mode(&self) -> Result<PwmMode, Error>

Reads the mode subfunction of this pwm sensor. Returns an error, if this sensor doesn't support the subfunction.

fn read_frequency(&self) -> Result<Frequency, Error>

Reads the freq subfunction of this pwm sensor. Returns an error, if this sensor doesn't support the subfunction.

fn write_pwm(&self, pwm: Pwm) -> Result<(), Error> where
    Self: WritableSensorBase

Converts pwm and writes it to this pwm's pwm subfunction. Returns an error, if this sensor doesn't support the subfunction.

fn write_enable(&self, enable: PwmEnable) -> Result<(), Error> where
    Self: WritableSensorBase

Converts enable and writes it to this pwm's enable subfunction. Returns an error, if this sensor doesn't support the subfunction.

fn write_mode(&self, mode: PwmMode) -> Result<(), Error> where
    Self: WritableSensorBase

Converts mode and writes it to this pwm's mode subfunction. Returns an error, if this sensor doesn't support the subfunction.

fn write_frequency(&self, freq: Frequency) -> Result<(), Error> where
    Self: WritableSensorBase

Converts freq and writes it to this pwm's freq subfunction. Returns an error, if this sensor doesn't support the subfunction.

Loading content...

Implementors

impl PwmSensor for ReadOnlyPwm[src]

impl PwmSensor for ReadWritePwm[src]

Loading content...