Type Alias embedded_hal_mock::eh0::pin::Mock

source ·
pub type Mock = Generic<Transaction>;
Available on crate feature eh0 only.
Expand description

Mock Pin implementation

Aliased Type§

struct Mock { /* private fields */ }

Trait Implementations§

source§

impl InputPin for Mock

§

type Error = MockError

Error type

source§

fn is_high(&self) -> Result<bool, Self::Error>

Is the input pin high?

source§

fn is_low(&self) -> Result<bool, Self::Error>

Is the input pin low?

source§

impl OutputPin for Mock

Single digital push-pull output pin

§

type Error = MockError

Error type

source§

fn set_low(&mut self) -> Result<(), Self::Error>

Drives the pin low

source§

fn set_high(&mut self) -> Result<(), Self::Error>

Drives the pin high

source§

fn set_state(&mut self, state: PinState) -> Result<(), Self::Error>

Drives the pin high or low depending on the provided value Read more
source§

impl PwmPin for Mock

§

type Duty = u16

Type for the duty methods Read more
source§

fn disable(&mut self)

Disables a PWM channel
source§

fn enable(&mut self)

Enables a PWM channel
source§

fn get_duty(&self) -> Self::Duty

Returns the current duty cycle
source§

fn get_max_duty(&self) -> Self::Duty

Returns the maximum duty cycle value
source§

fn set_duty(&mut self, duty: Self::Duty)

Sets a new duty cycle