pub struct Serial<UART, TX, RX, RTS, CTS> { /* private fields */ }Expand description
Serial abstraction
Implementations§
Source§impl<TX, RX, RTS, CTS> Serial<UART0, TX, RX, RTS, CTS>
impl<TX, RX, RTS, CTS> Serial<UART0, TX, RX, RTS, CTS>
Sourcepub fn uart0(
uart: UART0,
tx_pin: TX,
rx_pin: RX,
rts_pin: RTS,
cts_pin: CTS,
baud_rate: Bps,
nl_mode: NewlineMode,
clocks: &Clocks,
pc: &PowerControl,
) -> Self
pub fn uart0( uart: UART0, tx_pin: TX, rx_pin: RX, rts_pin: RTS, cts_pin: CTS, baud_rate: Bps, nl_mode: NewlineMode, clocks: &Clocks, pc: &PowerControl, ) -> Self
Configures a UART peripheral to provide serial communication
Sourcepub fn change_baud_rate(&mut self, baud_rate: Bps, clocks: &Clocks)
pub fn change_baud_rate(&mut self, baud_rate: Bps, clocks: &Clocks)
Change the current baud rate for the UART. We need the
clocks object in order to calculate the magic baud rate
register values.
Sourcepub fn split(self) -> (Tx<UART0, TX, RTS>, Rx<UART0, RX, CTS>)
pub fn split(self) -> (Tx<UART0, TX, RTS>, Rx<UART0, RX, CTS>)
Splits the Serial abstraction into a transmitter and a
receiver half. If you do this you can transmit and receive
in different threads.
Source§impl<TX, RX, RTS, CTS> Serial<UART1, TX, RX, RTS, CTS>
impl<TX, RX, RTS, CTS> Serial<UART1, TX, RX, RTS, CTS>
Sourcepub fn uart1(
uart: UART1,
tx_pin: TX,
rx_pin: RX,
rts_pin: RTS,
cts_pin: CTS,
baud_rate: Bps,
nl_mode: NewlineMode,
clocks: &Clocks,
pc: &PowerControl,
) -> Self
pub fn uart1( uart: UART1, tx_pin: TX, rx_pin: RX, rts_pin: RTS, cts_pin: CTS, baud_rate: Bps, nl_mode: NewlineMode, clocks: &Clocks, pc: &PowerControl, ) -> Self
Configures a UART peripheral to provide serial communication
Sourcepub fn change_baud_rate(&mut self, baud_rate: Bps, clocks: &Clocks)
pub fn change_baud_rate(&mut self, baud_rate: Bps, clocks: &Clocks)
Change the current baud rate for the UART. We need the
clocks object in order to calculate the magic baud rate
register values.
Sourcepub fn split(self) -> (Tx<UART1, TX, RTS>, Rx<UART1, RX, CTS>)
pub fn split(self) -> (Tx<UART1, TX, RTS>, Rx<UART1, RX, CTS>)
Splits the Serial abstraction into a transmitter and a
receiver half. If you do this you can transmit and receive
in different threads.
Source§impl<TX, RX, RTS, CTS> Serial<UART2, TX, RX, RTS, CTS>
impl<TX, RX, RTS, CTS> Serial<UART2, TX, RX, RTS, CTS>
Sourcepub fn uart2(
uart: UART2,
tx_pin: TX,
rx_pin: RX,
rts_pin: RTS,
cts_pin: CTS,
baud_rate: Bps,
nl_mode: NewlineMode,
clocks: &Clocks,
pc: &PowerControl,
) -> Self
pub fn uart2( uart: UART2, tx_pin: TX, rx_pin: RX, rts_pin: RTS, cts_pin: CTS, baud_rate: Bps, nl_mode: NewlineMode, clocks: &Clocks, pc: &PowerControl, ) -> Self
Configures a UART peripheral to provide serial communication
Sourcepub fn change_baud_rate(&mut self, baud_rate: Bps, clocks: &Clocks)
pub fn change_baud_rate(&mut self, baud_rate: Bps, clocks: &Clocks)
Change the current baud rate for the UART. We need the
clocks object in order to calculate the magic baud rate
register values.
Sourcepub fn split(self) -> (Tx<UART2, TX, RTS>, Rx<UART2, RX, CTS>)
pub fn split(self) -> (Tx<UART2, TX, RTS>, Rx<UART2, RX, CTS>)
Splits the Serial abstraction into a transmitter and a
receiver half. If you do this you can transmit and receive
in different threads.
Source§impl<TX, RX, RTS, CTS> Serial<UART3, TX, RX, RTS, CTS>
impl<TX, RX, RTS, CTS> Serial<UART3, TX, RX, RTS, CTS>
Sourcepub fn uart3(
uart: UART3,
tx_pin: TX,
rx_pin: RX,
rts_pin: RTS,
cts_pin: CTS,
baud_rate: Bps,
nl_mode: NewlineMode,
clocks: &Clocks,
pc: &PowerControl,
) -> Self
pub fn uart3( uart: UART3, tx_pin: TX, rx_pin: RX, rts_pin: RTS, cts_pin: CTS, baud_rate: Bps, nl_mode: NewlineMode, clocks: &Clocks, pc: &PowerControl, ) -> Self
Configures a UART peripheral to provide serial communication
Sourcepub fn change_baud_rate(&mut self, baud_rate: Bps, clocks: &Clocks)
pub fn change_baud_rate(&mut self, baud_rate: Bps, clocks: &Clocks)
Change the current baud rate for the UART. We need the
clocks object in order to calculate the magic baud rate
register values.
Sourcepub fn split(self) -> (Tx<UART3, TX, RTS>, Rx<UART3, RX, CTS>)
pub fn split(self) -> (Tx<UART3, TX, RTS>, Rx<UART3, RX, CTS>)
Splits the Serial abstraction into a transmitter and a
receiver half. If you do this you can transmit and receive
in different threads.
Source§impl<TX, RX, RTS, CTS> Serial<UART4, TX, RX, RTS, CTS>
impl<TX, RX, RTS, CTS> Serial<UART4, TX, RX, RTS, CTS>
Sourcepub fn uart4(
uart: UART4,
tx_pin: TX,
rx_pin: RX,
rts_pin: RTS,
cts_pin: CTS,
baud_rate: Bps,
nl_mode: NewlineMode,
clocks: &Clocks,
pc: &PowerControl,
) -> Self
pub fn uart4( uart: UART4, tx_pin: TX, rx_pin: RX, rts_pin: RTS, cts_pin: CTS, baud_rate: Bps, nl_mode: NewlineMode, clocks: &Clocks, pc: &PowerControl, ) -> Self
Configures a UART peripheral to provide serial communication
Sourcepub fn change_baud_rate(&mut self, baud_rate: Bps, clocks: &Clocks)
pub fn change_baud_rate(&mut self, baud_rate: Bps, clocks: &Clocks)
Change the current baud rate for the UART. We need the
clocks object in order to calculate the magic baud rate
register values.
Sourcepub fn split(self) -> (Tx<UART4, TX, RTS>, Rx<UART4, RX, CTS>)
pub fn split(self) -> (Tx<UART4, TX, RTS>, Rx<UART4, RX, CTS>)
Splits the Serial abstraction into a transmitter and a
receiver half. If you do this you can transmit and receive
in different threads.
Source§impl<TX, RX, RTS, CTS> Serial<UART5, TX, RX, RTS, CTS>
impl<TX, RX, RTS, CTS> Serial<UART5, TX, RX, RTS, CTS>
Sourcepub fn uart5(
uart: UART5,
tx_pin: TX,
rx_pin: RX,
rts_pin: RTS,
cts_pin: CTS,
baud_rate: Bps,
nl_mode: NewlineMode,
clocks: &Clocks,
pc: &PowerControl,
) -> Self
pub fn uart5( uart: UART5, tx_pin: TX, rx_pin: RX, rts_pin: RTS, cts_pin: CTS, baud_rate: Bps, nl_mode: NewlineMode, clocks: &Clocks, pc: &PowerControl, ) -> Self
Configures a UART peripheral to provide serial communication
Sourcepub fn change_baud_rate(&mut self, baud_rate: Bps, clocks: &Clocks)
pub fn change_baud_rate(&mut self, baud_rate: Bps, clocks: &Clocks)
Change the current baud rate for the UART. We need the
clocks object in order to calculate the magic baud rate
register values.
Sourcepub fn split(self) -> (Tx<UART5, TX, RTS>, Rx<UART5, RX, CTS>)
pub fn split(self) -> (Tx<UART5, TX, RTS>, Rx<UART5, RX, CTS>)
Splits the Serial abstraction into a transmitter and a
receiver half. If you do this you can transmit and receive
in different threads.
Source§impl<TX, RX, RTS, CTS> Serial<UART6, TX, RX, RTS, CTS>
impl<TX, RX, RTS, CTS> Serial<UART6, TX, RX, RTS, CTS>
Sourcepub fn uart6(
uart: UART6,
tx_pin: TX,
rx_pin: RX,
rts_pin: RTS,
cts_pin: CTS,
baud_rate: Bps,
nl_mode: NewlineMode,
clocks: &Clocks,
pc: &PowerControl,
) -> Self
pub fn uart6( uart: UART6, tx_pin: TX, rx_pin: RX, rts_pin: RTS, cts_pin: CTS, baud_rate: Bps, nl_mode: NewlineMode, clocks: &Clocks, pc: &PowerControl, ) -> Self
Configures a UART peripheral to provide serial communication
Sourcepub fn change_baud_rate(&mut self, baud_rate: Bps, clocks: &Clocks)
pub fn change_baud_rate(&mut self, baud_rate: Bps, clocks: &Clocks)
Change the current baud rate for the UART. We need the
clocks object in order to calculate the magic baud rate
register values.
Sourcepub fn split(self) -> (Tx<UART6, TX, RTS>, Rx<UART6, RX, CTS>)
pub fn split(self) -> (Tx<UART6, TX, RTS>, Rx<UART6, RX, CTS>)
Splits the Serial abstraction into a transmitter and a
receiver half. If you do this you can transmit and receive
in different threads.
Source§impl<TX, RX, RTS, CTS> Serial<UART7, TX, RX, RTS, CTS>
impl<TX, RX, RTS, CTS> Serial<UART7, TX, RX, RTS, CTS>
Sourcepub fn uart7(
uart: UART7,
tx_pin: TX,
rx_pin: RX,
rts_pin: RTS,
cts_pin: CTS,
baud_rate: Bps,
nl_mode: NewlineMode,
clocks: &Clocks,
pc: &PowerControl,
) -> Self
pub fn uart7( uart: UART7, tx_pin: TX, rx_pin: RX, rts_pin: RTS, cts_pin: CTS, baud_rate: Bps, nl_mode: NewlineMode, clocks: &Clocks, pc: &PowerControl, ) -> Self
Configures a UART peripheral to provide serial communication
Sourcepub fn change_baud_rate(&mut self, baud_rate: Bps, clocks: &Clocks)
pub fn change_baud_rate(&mut self, baud_rate: Bps, clocks: &Clocks)
Change the current baud rate for the UART. We need the
clocks object in order to calculate the magic baud rate
register values.
Sourcepub fn split(self) -> (Tx<UART7, TX, RTS>, Rx<UART7, RX, CTS>)
pub fn split(self) -> (Tx<UART7, TX, RTS>, Rx<UART7, RX, CTS>)
Splits the Serial abstraction into a transmitter and a
receiver half. If you do this you can transmit and receive
in different threads.
Trait Implementations§
Source§impl<TX, RX, RTS, CTS> Write for Serial<UART0, TX, RX, RTS, CTS>
Allows the Uart to be passed to ‘write!()’ and friends.
impl<TX, RX, RTS, CTS> Write for Serial<UART0, TX, RX, RTS, CTS>
Allows the Uart to be passed to ‘write!()’ and friends.
Source§impl<TX, RX, RTS, CTS> Write for Serial<UART1, TX, RX, RTS, CTS>
Allows the Uart to be passed to ‘write!()’ and friends.
impl<TX, RX, RTS, CTS> Write for Serial<UART1, TX, RX, RTS, CTS>
Allows the Uart to be passed to ‘write!()’ and friends.
Source§impl<TX, RX, RTS, CTS> Write for Serial<UART2, TX, RX, RTS, CTS>
Allows the Uart to be passed to ‘write!()’ and friends.
impl<TX, RX, RTS, CTS> Write for Serial<UART2, TX, RX, RTS, CTS>
Allows the Uart to be passed to ‘write!()’ and friends.
Source§impl<TX, RX, RTS, CTS> Write for Serial<UART3, TX, RX, RTS, CTS>
Allows the Uart to be passed to ‘write!()’ and friends.
impl<TX, RX, RTS, CTS> Write for Serial<UART3, TX, RX, RTS, CTS>
Allows the Uart to be passed to ‘write!()’ and friends.
Source§impl<TX, RX, RTS, CTS> Write for Serial<UART4, TX, RX, RTS, CTS>
Allows the Uart to be passed to ‘write!()’ and friends.
impl<TX, RX, RTS, CTS> Write for Serial<UART4, TX, RX, RTS, CTS>
Allows the Uart to be passed to ‘write!()’ and friends.
Source§impl<TX, RX, RTS, CTS> Write for Serial<UART5, TX, RX, RTS, CTS>
Allows the Uart to be passed to ‘write!()’ and friends.
impl<TX, RX, RTS, CTS> Write for Serial<UART5, TX, RX, RTS, CTS>
Allows the Uart to be passed to ‘write!()’ and friends.
Source§impl<TX, RX, RTS, CTS> Write for Serial<UART6, TX, RX, RTS, CTS>
Allows the Uart to be passed to ‘write!()’ and friends.
impl<TX, RX, RTS, CTS> Write for Serial<UART6, TX, RX, RTS, CTS>
Allows the Uart to be passed to ‘write!()’ and friends.
Source§impl<TX, RX, RTS, CTS> Write for Serial<UART7, TX, RX, RTS, CTS>
Allows the Uart to be passed to ‘write!()’ and friends.
impl<TX, RX, RTS, CTS> Write for Serial<UART7, TX, RX, RTS, CTS>
Allows the Uart to be passed to ‘write!()’ and friends.