pub struct UartBitbangEncoder {
pub config: UartBitbangConfig,
}
Expand description
An encoder for creating UART bitbanging samples for transmission. TX
is
the bit in the output sample bitfield to use for TX transmissions.
Fields§
§config: UartBitbangConfig
Implementations§
Source§impl UartBitbangEncoder
impl UartBitbangEncoder
pub fn new(config: UartBitbangConfig) -> Self
Sourcepub fn encode_break(&self, samples: &mut Vec<u8>)
pub fn encode_break(&self, samples: &mut Vec<u8>)
Encode the transmission of a UART break condition into a bitbanging sample, to be used on the TX pin.
Sourcepub fn encode_character(&self, data: u8, samples: &mut Vec<u8>)
pub fn encode_character(&self, data: u8, samples: &mut Vec<u8>)
Encode the transmission of a character into UART bitbanging samples, to be used on the TX pin. When configured to use X data bits, only the X
Sourcepub fn encode_characters(&self, chars: &[u8], samples: &mut Vec<u8>)
pub fn encode_characters(&self, chars: &[u8], samples: &mut Vec<u8>)
Helper function to encode multiple characters into UART bitbanging samples in one call.
Sourcepub fn encode_transfer(
&self,
transfer: &UartTransfer,
samples: &mut Vec<u8>,
) -> Result<()>
pub fn encode_transfer( &self, transfer: &UartTransfer, samples: &mut Vec<u8>, ) -> Result<()>
Encode a UART transmission (data / break) into UART bitbanging samples,
Sourcepub fn encode_transfers(
&self,
transfers: &[UartTransfer],
samples: &mut Vec<u8>,
) -> Result<()>
pub fn encode_transfers( &self, transfers: &[UartTransfer], samples: &mut Vec<u8>, ) -> Result<()>
Helper function to encode multiple UART transfers into UART bitbanging samples in one call.
Auto Trait Implementations§
impl Freeze for UartBitbangEncoder
impl RefUnwindSafe for UartBitbangEncoder
impl Send for UartBitbangEncoder
impl Sync for UartBitbangEncoder
impl Unpin for UartBitbangEncoder
impl UnwindSafe for UartBitbangEncoder
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