Struct avr_tester::DigitalPin
source · pub struct DigitalPin<'a> { /* private fields */ }
Expand description
Manages a single digital pin (e.g. PD4
).
Implementations§
source§impl<'a> DigitalPin<'a>
impl<'a> DigitalPin<'a>
sourcepub fn assert_low(&mut self)
pub fn assert_low(&mut self)
Asserts that pin’s state is low.
sourcepub fn assert_high(&mut self)
pub fn assert_high(&mut self)
Asserts that pin’s state is high.
sourcepub fn pulse_in(&mut self) -> AvrDuration
pub fn pulse_in(&mut self) -> AvrDuration
Waits until pin switches state (e.g. from low to high or from high to low).
Returns duration it took for the pin to switch state.
sourcepub fn wait_while_low(&mut self) -> AvrDuration
pub fn wait_while_low(&mut self) -> AvrDuration
Waits until pin becomes high; if the pin is already high, exits immediately.
Returns duration it took for the pin to get high.
sourcepub fn wait_while_high(&mut self) -> AvrDuration
pub fn wait_while_high(&mut self) -> AvrDuration
Waits until pin becomes low; if the pin is already low, exits immediately.
Returns duration it took for the pin to get low.