pub struct LineCoding { /* private fields */ }Expand description
Line coding parameters
This is provided by the host for specifying the standard UART parameters such as baud rate. Can be ignored if you don’t plan to interface with a physical UART.
Implementations§
Source§impl LineCoding
impl LineCoding
Sourcepub const fn new(
data_rate: u32,
stop_bits: StopBits,
parity_type: ParityType,
data_bits: u8,
) -> Self
pub const fn new( data_rate: u32, stop_bits: StopBits, parity_type: ParityType, data_bits: u8, ) -> Self
Creates line coding parameters.
Sourcepub fn from_bytes(bytes: [u8; 7]) -> Self
pub fn from_bytes(bytes: [u8; 7]) -> Self
Decodes the 7-byte SET_LINE_CODING/GET_LINE_CODING payload (CDC PSTN 1.2 Table 17).
Out-of-range stop bits and parity fall back to one stop bit and no parity.
Sourcepub const fn to_bytes(&self) -> [u8; 7]
pub const fn to_bytes(&self) -> [u8; 7]
Encodes the 7-byte SET_LINE_CODING/GET_LINE_CODING payload.
Sourcepub const fn parity_type(&self) -> ParityType
pub const fn parity_type(&self) -> ParityType
Gets the parity type for UART communication.
Trait Implementations§
Source§impl Clone for LineCoding
impl Clone for LineCoding
Source§fn clone(&self) -> LineCoding
fn clone(&self) -> LineCoding
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for LineCoding
Source§impl Debug for LineCoding
impl Debug for LineCoding
Source§impl Default for LineCoding
impl Default for LineCoding
impl Eq for LineCoding
Source§impl Format for LineCoding
impl Format for LineCoding
Source§impl PartialEq for LineCoding
impl PartialEq for LineCoding
impl StructuralPartialEq for LineCoding
Auto Trait Implementations§
impl Freeze for LineCoding
impl RefUnwindSafe for LineCoding
impl Send for LineCoding
impl Sync for LineCoding
impl Unpin for LineCoding
impl UnsafeUnpin for LineCoding
impl UnwindSafe for LineCoding
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