pub struct UartBitbangDecoder<const RX: u8> {
pub config: UartBitbangConfig,
/* private fields */
}
Expand description
A decoder for decoding UART samples. RX
is the bit in the input sample
bitfield to use for RX transmissions.
Fields§
§config: UartBitbangConfig
Implementations§
Source§impl<const RX: u8> UartBitbangDecoder<RX>
impl<const RX: u8> UartBitbangDecoder<RX>
pub fn new(config: UartBitbangConfig) -> Self
Sourcepub fn decode_sample(&mut self, sample: u8) -> Result<Option<UartTransfer>>
pub fn decode_sample(&mut self, sample: u8) -> Result<Option<UartTransfer>>
Given a sampled waveform (where bit RX is the UART RX), advance the UART decoder state based on the contents of the sample. If the sample is the final stop bit, return the decoded UART transfer.
Sourcepub fn decode_samples(&mut self, samples: &Vec<u8>) -> Result<Vec<UartTransfer>>
pub fn decode_samples(&mut self, samples: &Vec<u8>) -> Result<Vec<UartTransfer>>
A helper function to decode a sequence of UART waveform samples, advancing the decoder based on the contents. If the sample contains any final stop bits, the decoded UART transfers are returned.
Auto Trait Implementations§
impl<const RX: u8> Freeze for UartBitbangDecoder<RX>
impl<const RX: u8> RefUnwindSafe for UartBitbangDecoder<RX>
impl<const RX: u8> Send for UartBitbangDecoder<RX>
impl<const RX: u8> Sync for UartBitbangDecoder<RX>
impl<const RX: u8> Unpin for UartBitbangDecoder<RX>
impl<const RX: u8> UnwindSafe for UartBitbangDecoder<RX>
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