pub struct UartBitbangEncoder<const TX: u8> {
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<const TX: u8> UartBitbangEncoder<TX>
impl<const TX: u8> UartBitbangEncoder<TX>
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<const TX: u8> Freeze for UartBitbangEncoder<TX>
impl<const TX: u8> RefUnwindSafe for UartBitbangEncoder<TX>
impl<const TX: u8> Send for UartBitbangEncoder<TX>
impl<const TX: u8> Sync for UartBitbangEncoder<TX>
impl<const TX: u8> Unpin for UartBitbangEncoder<TX>
impl<const TX: u8> UnwindSafe for UartBitbangEncoder<TX>
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