pub struct Uart { /* private fields */ }
Expand description
Representation of a UART.
NOTE: Instances of this struct should never be created manually. Refer to the public constants the struct holds, which represent the UARTs A through E.
Implementations
sourceimpl Uart
impl Uart
sourcepub const A: Self = Uart {
baud: 0,
clock: &Clock::UART_A,
registers: UART_A_REGISTERS,
}
pub const A: Self = Uart { baud: 0, clock: &Clock::UART_A, registers: UART_A_REGISTERS, }
Representation of UART A.
sourcepub const B: Self = Uart {
baud: 0,
clock: &Clock::UART_B,
registers: UART_B_REGISTERS,
}
pub const B: Self = Uart { baud: 0, clock: &Clock::UART_B, registers: UART_B_REGISTERS, }
Representation of UART B.
sourcepub const C: Self = Uart {
baud: 0,
clock: &Clock::UART_C,
registers: UART_C_REGISTERS,
}
pub const C: Self = Uart { baud: 0, clock: &Clock::UART_C, registers: UART_C_REGISTERS, }
Representation of UART C.
sourceimpl Uart
impl Uart
sourcepub fn read_byte(&self) -> u8
pub fn read_byte(&self) -> u8
Reads a singly byte over UART and returns it.
This method blocks until data is available to read.
sourcepub fn read(&self, data: &mut [u8])
pub fn read(&self, data: &mut [u8])
Fills a mutable buffer of data with bytes read over UART.
This method blocks until the buffer is filled.
sourcepub fn write_byte(&self, byte: u8)
pub fn write_byte(&self, byte: u8)
Writes a single byte over UART.
This method blocks until data can be transferred.
sourcepub fn write(&self, data: &[u8])
pub fn write(&self, data: &[u8])
Writes a buffer of bytes over UART.
This method blocks until everything was transferred.
sourcepub fn invert(&self, mask: u32, enable: bool)
pub fn invert(&self, mask: u32, enable: bool)
Enables or disables inversion of the UART signal with the desired bitmask.
See the documentation of the UART_IRDA_CSR_0
bitfield for instructions
on the structure of the expected bitmask.
Trait Implementations
sourceimpl Write for Uart
impl Write for Uart
sourceimpl Write<u8> for Uart
impl Write<u8> for Uart
impl Copy for Uart
impl Eq for Uart
impl StructuralEq for Uart
impl StructuralPartialEq for Uart
impl Sync for Uart
Auto Trait Implementations
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more