[−][src]Struct stm32f0xx_hal::serial::Serial
Serial abstraction
Methods
impl<TXPIN, RXPIN> Serial<USART1, TXPIN, RXPIN> where
TXPIN: TxPin<USART1>,
RXPIN: RxPin<USART1>,
[src]
TXPIN: TxPin<USART1>,
RXPIN: RxPin<USART1>,
pub fn usart1(
usart: USART1,
pins: (TXPIN, RXPIN),
baud_rate: Bps,
rcc: &mut Rcc
) -> Self
[src]
usart: USART1,
pins: (TXPIN, RXPIN),
baud_rate: Bps,
rcc: &mut Rcc
) -> Self
Creates a new serial instance
impl<TXPIN> Serial<USART1, TXPIN, ()> where
TXPIN: TxPin<USART1>,
[src]
TXPIN: TxPin<USART1>,
pub fn usart1tx(
usart: USART1,
txpin: TXPIN,
baud_rate: Bps,
rcc: &mut Rcc
) -> Self
[src]
usart: USART1,
txpin: TXPIN,
baud_rate: Bps,
rcc: &mut Rcc
) -> Self
Creates a new tx-only serial instance
impl<RXPIN> Serial<USART1, (), RXPIN> where
RXPIN: RxPin<USART1>,
[src]
RXPIN: RxPin<USART1>,
pub fn usart1rx(
usart: USART1,
rxpin: RXPIN,
baud_rate: Bps,
rcc: &mut Rcc
) -> Self
[src]
usart: USART1,
rxpin: RXPIN,
baud_rate: Bps,
rcc: &mut Rcc
) -> Self
Creates a new tx-only serial instance
impl<TXPIN, RXPIN> Serial<USART1, TXPIN, RXPIN>
[src]
pub fn listen(&mut self, event: Event)
[src]
Starts listening for an interrupt event
pub fn unlisten(&mut self, event: Event)
[src]
Stop listening for an interrupt event
impl<TXPIN, RXPIN> Serial<USART2, TXPIN, RXPIN> where
TXPIN: TxPin<USART2>,
RXPIN: RxPin<USART2>,
[src]
TXPIN: TxPin<USART2>,
RXPIN: RxPin<USART2>,
pub fn usart2(
usart: USART2,
pins: (TXPIN, RXPIN),
baud_rate: Bps,
rcc: &mut Rcc
) -> Self
[src]
usart: USART2,
pins: (TXPIN, RXPIN),
baud_rate: Bps,
rcc: &mut Rcc
) -> Self
Creates a new serial instance
impl<TXPIN> Serial<USART2, TXPIN, ()> where
TXPIN: TxPin<USART2>,
[src]
TXPIN: TxPin<USART2>,
pub fn usart2tx(
usart: USART2,
txpin: TXPIN,
baud_rate: Bps,
rcc: &mut Rcc
) -> Self
[src]
usart: USART2,
txpin: TXPIN,
baud_rate: Bps,
rcc: &mut Rcc
) -> Self
Creates a new tx-only serial instance
impl<RXPIN> Serial<USART2, (), RXPIN> where
RXPIN: RxPin<USART2>,
[src]
RXPIN: RxPin<USART2>,
pub fn usart2rx(
usart: USART2,
rxpin: RXPIN,
baud_rate: Bps,
rcc: &mut Rcc
) -> Self
[src]
usart: USART2,
rxpin: RXPIN,
baud_rate: Bps,
rcc: &mut Rcc
) -> Self
Creates a new tx-only serial instance
impl<TXPIN, RXPIN> Serial<USART2, TXPIN, RXPIN>
[src]
pub fn listen(&mut self, event: Event)
[src]
Starts listening for an interrupt event
pub fn unlisten(&mut self, event: Event)
[src]
Stop listening for an interrupt event
impl<USART, TXPIN, RXPIN> Serial<USART, TXPIN, RXPIN> where
USART: Deref<Target = RegisterBlock>,
[src]
USART: Deref<Target = RegisterBlock>,
pub fn split(self) -> (Tx<USART>, Rx<USART>) where
TXPIN: TxPin<USART>,
RXPIN: RxPin<USART>,
[src]
TXPIN: TxPin<USART>,
RXPIN: RxPin<USART>,
Splits the UART Peripheral in a Tx and an Rx part This is required for sending/receiving
pub fn release(self) -> (USART, (TXPIN, RXPIN))
[src]
Trait Implementations
impl<USART, TXPIN, RXPIN> Write for Serial<USART, TXPIN, RXPIN> where
USART: Deref<Target = RegisterBlock>,
TXPIN: TxPin<USART>,
[src]
USART: Deref<Target = RegisterBlock>,
TXPIN: TxPin<USART>,
fn write_str(&mut self, s: &str) -> Result
[src]
fn write_char(&mut self, c: char) -> Result<(), Error>
1.1.0[src]
fn write_fmt(&mut self, args: Arguments) -> Result<(), Error>
1.0.0[src]
impl<USART, TXPIN, RXPIN> Read<u8> for Serial<USART, TXPIN, RXPIN> where
USART: Deref<Target = RegisterBlock>,
RXPIN: RxPin<USART>,
[src]
USART: Deref<Target = RegisterBlock>,
RXPIN: RxPin<USART>,
type Error = Error
Read error
fn read(&mut self) -> Result<u8, Error>
[src]
Tries to read a byte from the uart
impl<USART, TXPIN, RXPIN> Write<u8> for Serial<USART, TXPIN, RXPIN> where
USART: Deref<Target = RegisterBlock>,
TXPIN: TxPin<USART>,
[src]
USART: Deref<Target = RegisterBlock>,
TXPIN: TxPin<USART>,
Auto Trait Implementations
impl<USART, TXPIN, RXPIN> Unpin for Serial<USART, TXPIN, RXPIN> where
RXPIN: Unpin,
TXPIN: Unpin,
USART: Unpin,
RXPIN: Unpin,
TXPIN: Unpin,
USART: Unpin,
impl<USART, TXPIN, RXPIN> Send for Serial<USART, TXPIN, RXPIN> where
RXPIN: Send,
TXPIN: Send,
USART: Send,
RXPIN: Send,
TXPIN: Send,
USART: Send,
impl<USART, TXPIN, RXPIN> Sync for Serial<USART, TXPIN, RXPIN> where
RXPIN: Sync,
TXPIN: Sync,
USART: Sync,
RXPIN: Sync,
TXPIN: Sync,
USART: Sync,
Blanket Implementations
impl<T> From<T> for T
[src]
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.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same<T> for T
type Output = T
Should always be Self