[−][src]Struct cntrlr::hw::mcu::kinetis::peripheral::uart::Uart
The handle to a UART
Implementations
impl<M, const N: usize> Uart<M, (), (), N>
[src]
pub fn set_divisor(&mut self, divisor: usize)
[src]
Set the Uart divisor.
The UART divider has 13 regular bits and 5 fractional bits, for a total of 18 bits. Bits above bit 17 will be ignored.
The final baud rate is 1/16th the rate selected by the divider
impl<M, R, const N: usize> Uart<M, (), R, N>
[src]
pub fn enable_tx<T>(self, tx: T) -> Uart<M, T, R, N> where
T: UartTx<M, N>,
[src]
T: UartTx<M, N>,
Enable this UART for transmitting.
Once enabled for transmit, the baud rate and wire format cannot be changed.
impl<M, T, const N: usize> Uart<M, T, (), N>
[src]
pub fn enable_rx<R>(self, rx: R) -> Uart<M, T, R, N> where
R: UartRx<M, N>,
[src]
R: UartRx<M, N>,
Enable this UART for recieving.
Once enabled for recieve, the baud rate and wire format cannot be changed.
impl<M, T, R: UartRx<M, N>, const N: usize> Uart<M, T, R, N>
[src]
pub fn read_data(&mut self) -> Option<u8>
[src]
Read a byte from the UART.
Returns None
if there is no data to be read.
pub fn enable_rx_intr(&mut self)
[src]
Enable the UART to interupt when a byte is recieved.
pub fn disable_rx(self) -> (Uart<M, T, (), N>, R)
[src]
Disable this UART for recieving.
impl<M, T: UartTx<M, N>, R, const N: usize> Uart<M, T, R, N>
[src]
pub fn write_data(&mut self, data: u8) -> Option<()>
[src]
Send a byte to the UART.
If the UART is not ready, behavior is unspecified.
pub fn is_transmit_complete(&self) -> bool
[src]
Check if the UART has transmitted all bytes in the FIFO
pub fn enable_tx_intr(&mut self)
[src]
Enable the UART to interrupt when it is ready to transmit a byte.
pub fn enable_complete_intr(&mut self)
[src]
Enable the UART to interrupt when it has completed trasmitting all buffered bytes
pub fn disable_tx(self) -> (Uart<M, (), R, N>, T)
[src]
Disable this uart for transmitting
impl<M, T, R, const N: usize> Uart<M, T, R, N> where
Uart<M, T, R, N>: Fifo,
[src]
Uart<M, T, R, N>: Fifo,
pub fn enable_tx_fifo(&mut self, depth: u8, watermark: u8)
[src]
Enable the transmit FIFO and set its watermark
See the chip documentation for valid values.
pub fn enable_rx_fifo(&mut self, depth: u8, watermark: u8)
[src]
Enable the recieve FIFO and set its watermark
See the chip documentation for valid values.
Trait Implementations
impl<T, R> Fifo for Uart<Mk20Dx128, T, R, 0>
[src]
impl<T, R> Fifo for Uart<Mk20Dx128, T, R, 1>
[src]
impl<T, R> Fifo for Uart<Mk64Fx512, T, R, 4>
[src]
impl<T, R> Fifo for Uart<Mk64Fx512, T, R, 5>
[src]
impl<T, R> Fifo for Uart<Mk66Fx1M0, T, R, 0>
[src]
impl<T, R> Fifo for Uart<Mk66Fx1M0, T, R, 1>
[src]
impl<T, R> Fifo for Uart<Mk66Fx1M0, T, R, 2>
[src]
impl<T, R> Fifo for Uart<Mk66Fx1M0, T, R, 3>
[src]
impl<T, R> Fifo for Uart<Mk66Fx1M0, T, R, 4>
[src]
impl<T, R> Fifo for Uart<Mk20Dx128, T, R, 2>
[src]
impl<T, R> Fifo for Uart<Mk20Dx256, T, R, 0>
[src]
impl<T, R> Fifo for Uart<Mk20Dx256, T, R, 1>
[src]
impl<T, R> Fifo for Uart<Mk20Dx256, T, R, 2>
[src]
impl<T, R> Fifo for Uart<Mk64Fx512, T, R, 0>
[src]
impl<T, R> Fifo for Uart<Mk64Fx512, T, R, 1>
[src]
impl<T, R> Fifo for Uart<Mk64Fx512, T, R, 2>
[src]
impl<T, R> Fifo for Uart<Mk64Fx512, T, R, 3>
[src]
impl Peripheral<Mk20Dx128> for Uart<Mk20Dx128, (), (), 0>
[src]
impl Peripheral<Mk20Dx128> for Uart<Mk20Dx128, (), (), 1>
[src]
impl Peripheral<Mk20Dx128> for Uart<Mk20Dx128, (), (), 2>
[src]
impl Peripheral<Mk20Dx256> for Uart<Mk20Dx256, (), (), 0>
[src]
impl Peripheral<Mk20Dx256> for Uart<Mk20Dx256, (), (), 1>
[src]
impl Peripheral<Mk20Dx256> for Uart<Mk20Dx256, (), (), 2>
[src]
impl Peripheral<Mk64Fx512> for Uart<Mk64Fx512, (), (), 0>
[src]
impl Peripheral<Mk64Fx512> for Uart<Mk64Fx512, (), (), 1>
[src]
impl Peripheral<Mk64Fx512> for Uart<Mk64Fx512, (), (), 2>
[src]
impl Peripheral<Mk64Fx512> for Uart<Mk64Fx512, (), (), 3>
[src]
impl Peripheral<Mk64Fx512> for Uart<Mk64Fx512, (), (), 4>
[src]
impl Peripheral<Mk64Fx512> for Uart<Mk64Fx512, (), (), 5>
[src]
impl Peripheral<Mk66Fx1M0> for Uart<Mk66Fx1M0, (), (), 0>
[src]
impl Peripheral<Mk66Fx1M0> for Uart<Mk66Fx1M0, (), (), 1>
[src]
impl Peripheral<Mk66Fx1M0> for Uart<Mk66Fx1M0, (), (), 2>
[src]
impl Peripheral<Mk66Fx1M0> for Uart<Mk66Fx1M0, (), (), 3>
[src]
impl Peripheral<Mk66Fx1M0> for Uart<Mk66Fx1M0, (), (), 4>
[src]
impl Peripheral<Mkl26Z64> for Uart<Mkl26Z64, (), (), 0>
[src]
impl Peripheral<Mkl26Z64> for Uart<Mkl26Z64, (), (), 1>
[src]
impl Peripheral<Mkl26Z64> for Uart<Mkl26Z64, (), (), 2>
[src]
Auto Trait Implementations
impl<M, T, R, const N: usize> Send for Uart<M, T, R, N> where
M: Send,
R: Send,
T: Send,
[src]
M: Send,
R: Send,
T: Send,
impl<M, T, R, const N: usize> !Sync for Uart<M, T, R, N>
[src]
impl<M, T, R, const N: usize> Unpin for Uart<M, T, R, N> where
M: Unpin,
R: Unpin,
T: Unpin,
[src]
M: Unpin,
R: Unpin,
T: Unpin,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,