pub trait PwmOps: 'static + Sized {
type WfHw: Copy + Default;
// Provided methods
fn request(
_chip: &Chip<Self>,
_pwm: &Device,
_parent_dev: &Device<Bound>
) -> Result { ... }
fn capture(
_chip: &Chip<Self>,
_pwm: &Device,
_result: &mut pwm_capture,
_timeout: usize,
_parent_dev: &Device<Bound>
) -> Result { ... }
fn round_waveform_tohw(
_chip: &Chip<Self>,
_pwm: &Device,
_wf: &Waveform
) -> Result<RoundedWaveform<Self::WfHw>> { ... }
fn round_waveform_fromhw(
_chip: &Chip<Self>,
_pwm: &Device,
_wfhw: &Self::WfHw,
_wf: &mut Waveform
) -> Result { ... }
fn read_waveform(
_chip: &Chip<Self>,
_pwm: &Device,
_parent_dev: &Device<Bound>
) -> Result<Self::WfHw> { ... }
fn write_waveform(
_chip: &Chip<Self>,
_pwm: &Device,
_wfhw: &Self::WfHw,
_parent_dev: &Device<Bound>
) -> Result { ... }
}Expand description
Trait defining the operations for a PWM driver.
Required Associated Types§
Provided Methods§
sourcefn request(
_chip: &Chip<Self>,
_pwm: &Device,
_parent_dev: &Device<Bound>
) -> Result
fn request( _chip: &Chip<Self>, _pwm: &Device, _parent_dev: &Device<Bound> ) -> Result
Optional hook for when a PWM device is requested.
sourcefn capture(
_chip: &Chip<Self>,
_pwm: &Device,
_result: &mut pwm_capture,
_timeout: usize,
_parent_dev: &Device<Bound>
) -> Result
fn capture( _chip: &Chip<Self>, _pwm: &Device, _result: &mut pwm_capture, _timeout: usize, _parent_dev: &Device<Bound> ) -> Result
Optional hook for capturing a PWM signal.
sourcefn round_waveform_tohw(
_chip: &Chip<Self>,
_pwm: &Device,
_wf: &Waveform
) -> Result<RoundedWaveform<Self::WfHw>>
fn round_waveform_tohw( _chip: &Chip<Self>, _pwm: &Device, _wf: &Waveform ) -> Result<RoundedWaveform<Self::WfHw>>
Convert a generic waveform to the hardware-specific representation. This is typically a pure calculation and does not perform I/O.
sourcefn round_waveform_fromhw(
_chip: &Chip<Self>,
_pwm: &Device,
_wfhw: &Self::WfHw,
_wf: &mut Waveform
) -> Result
fn round_waveform_fromhw( _chip: &Chip<Self>, _pwm: &Device, _wfhw: &Self::WfHw, _wf: &mut Waveform ) -> Result
Convert a hardware-specific representation back to a generic waveform. This is typically a pure calculation and does not perform I/O.
Object Safety§
This trait is not object safe.