[−][src]Trait libmedium::sensors::PwmSensor
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,
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,
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,
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,
Self: WritableSensorBase,
Converts freq and writes it to this pwm's freq subfunction. Returns an error, if this sensor doesn't support the subfunction.