Struct stm32f4xx_hal::serial::Serial
source · [−]pub struct Serial<USART, PINS, WORD = u8> { /* private fields */ }
Expand description
Serial abstraction
Implementations
sourceimpl<USART, TX, WORD> Serial<USART, (TX, NoPin), WORD> where
(TX, NoPin): Pins<USART>,
USART: Instance,
impl<USART, TX, WORD> Serial<USART, (TX, NoPin), WORD> where
(TX, NoPin): Pins<USART>,
USART: Instance,
sourceimpl<USART, RX, WORD> Serial<USART, (NoPin, RX), WORD> where
(NoPin, RX): Pins<USART>,
USART: Instance,
impl<USART, RX, WORD> Serial<USART, (NoPin, RX), WORD> where
(NoPin, RX): Pins<USART>,
USART: Instance,
sourceimpl<USART, PINS, WORD> Serial<USART, PINS, WORD> where
USART: Instance,
impl<USART, PINS, WORD> Serial<USART, PINS, WORD> where
USART: Instance,
sourcepub fn listen(&mut self, event: Event)
pub fn listen(&mut self, event: Event)
Starts listening for an interrupt event
Note, you will also have to enable the corresponding interrupt in the NVIC to start receiving events.
sourcepub fn is_tx_empty(&self) -> bool
pub fn is_tx_empty(&self) -> bool
Return true if the tx register is empty (and can accept data)
sourcepub fn is_rx_not_empty(&self) -> bool
pub fn is_rx_not_empty(&self) -> bool
Return true if the rx register is not empty (and can be read)
sourcepub fn clear_idle_interrupt(&self)
pub fn clear_idle_interrupt(&self)
Clear idle line interrupt flag
pub fn split(self) -> (Tx<USART, WORD>, Rx<USART, WORD>)
sourceimpl<USART, PINS> Serial<USART, PINS, u8> where
USART: Instance,
impl<USART, PINS> Serial<USART, PINS, u8> where
USART: Instance,
sourcepub fn with_u16_data(self) -> Serial<USART, PINS, u16>
pub fn with_u16_data(self) -> Serial<USART, PINS, u16>
Converts this Serial into a version that can read and write u16
values instead of u8
s
This can be used with a word length of 9 bits.
sourceimpl<USART, PINS> Serial<USART, PINS, u16> where
USART: Instance,
impl<USART, PINS> Serial<USART, PINS, u16> where
USART: Instance,
sourcepub fn with_u8_data(self) -> Serial<USART, PINS, u8>
pub fn with_u8_data(self) -> Serial<USART, PINS, u8>
Converts this Serial into a version that can read and write u8
values instead of u16
s
This can be used with a word length of 8 bits.
Trait Implementations
sourceimpl<USART, PINS, WORD> Read<WORD> for Serial<USART, PINS, WORD> where
USART: Instance,
Rx<USART, WORD>: Read<WORD, Error = Error>,
impl<USART, PINS, WORD> Read<WORD> for Serial<USART, PINS, WORD> where
USART: Instance,
Rx<USART, WORD>: Read<WORD, Error = Error>,
sourceimpl<USART, PINS, WORD: Copy> Read<WORD> for Serial<USART, PINS, WORD> where
USART: Instance,
Rx<USART, WORD>: Read<WORD> + ErrorType<Error = Self::Error>,
impl<USART, PINS, WORD: Copy> Read<WORD> for Serial<USART, PINS, WORD> where
USART: Instance,
Rx<USART, WORD>: Read<WORD> + ErrorType<Error = Self::Error>,
sourceimpl<USART: Instance, PINS> Write for Serial<USART, PINS>
impl<USART: Instance, PINS> Write for Serial<USART, PINS>
sourceimpl<USART, PINS, WORD> Write<WORD> for Serial<USART, PINS, WORD> where
USART: Instance,
Tx<USART, WORD>: Write<WORD, Error = Error>,
impl<USART, PINS, WORD> Write<WORD> for Serial<USART, PINS, WORD> where
USART: Instance,
Tx<USART, WORD>: Write<WORD, Error = Error>,
sourceimpl<USART, PINS, WORD: Copy> Write<WORD> for Serial<USART, PINS, WORD> where
USART: Instance,
Tx<USART, WORD>: Write<WORD> + ErrorType<Error = Self::Error>,
impl<USART, PINS, WORD: Copy> Write<WORD> for Serial<USART, PINS, WORD> where
USART: Instance,
Tx<USART, WORD>: Write<WORD> + ErrorType<Error = Self::Error>,
sourceimpl<USART, PINS, WORD: Copy> Write<WORD> for Serial<USART, PINS, WORD> where
USART: Instance,
Tx<USART, WORD>: Write<WORD> + ErrorType<Error = Self::Error>,
impl<USART, PINS, WORD: Copy> Write<WORD> for Serial<USART, PINS, WORD> where
USART: Instance,
Tx<USART, WORD>: Write<WORD> + ErrorType<Error = Self::Error>,
sourceimpl<USART: Instance, PINS> Write<u16> for Serial<USART, PINS, u16>
impl<USART: Instance, PINS> Write<u16> for Serial<USART, PINS, u16>
Auto Trait Implementations
impl<USART, PINS, WORD> RefUnwindSafe for Serial<USART, PINS, WORD> where
PINS: RefUnwindSafe,
USART: RefUnwindSafe,
WORD: RefUnwindSafe,
impl<USART, PINS, WORD> Send for Serial<USART, PINS, WORD> where
PINS: Send,
USART: Send,
WORD: Send,
impl<USART, PINS, WORD> Sync for Serial<USART, PINS, WORD> where
PINS: Sync,
USART: Sync,
WORD: Sync,
impl<USART, PINS, WORD> Unpin for Serial<USART, PINS, WORD> where
PINS: Unpin,
USART: Unpin,
WORD: Unpin,
impl<USART, PINS, WORD> UnwindSafe for Serial<USART, PINS, WORD> where
PINS: UnwindSafe,
USART: UnwindSafe,
WORD: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more