pub struct WriteBuilder { /* private fields */ }Expand description
Build a Data Shifting Command set to write bytes.
Implementations§
Source§impl WriteBuilder
impl WriteBuilder
Sourcepub fn with_clock_direction(self, direction: ClockEdge) -> Self
pub fn with_clock_direction(self, direction: ClockEdge) -> Self
Set this command to write the bits on a specific clock edge.
By default, the WriteBuilder will build the command with the clock direction set Rising (meaning read on the rising clock).
use mpsse::{Builder, ClockEdge};
let commands = Builder::new()
.write_data(vec![0x01])
.with_clock_direction(ClockEdge::Rising)
.then()
.write_data(vec![0x01])
.with_clock_direction(ClockEdge::Falling)
.build();
assert_eq!(commands, vec![0x10, 0x00, 0x00, 0x01, 0x11, 0x00, 0x00, 0x01])Sourcepub fn with_bit_direction(self, direction: BitDirection) -> Self
pub fn with_bit_direction(self, direction: BitDirection) -> Self
Set this command to write the bits in a specific direction
By default, the WriteBuilder will build the command with the bit direction set MsbFirst.
use mpsse::{Builder, BitDirection};
let commands = Builder::new()
.write_data(vec![0x01])
.with_bit_direction(BitDirection::MsbFirst)
.then()
.write_data(vec![0x01])
.with_bit_direction(BitDirection::LsbFirst)
.build();
assert_eq!(commands, vec![0x10, 0x00, 0x00, 0x01, 0x18, 0x00, 0x00, 0x01])Trait Implementations§
Auto Trait Implementations§
impl Freeze for WriteBuilder
impl RefUnwindSafe for WriteBuilder
impl Send for WriteBuilder
impl Sync for WriteBuilder
impl Unpin for WriteBuilder
impl UnsafeUnpin for WriteBuilder
impl UnwindSafe for WriteBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more