pub struct Serial<USART, PINS> { /* private fields */ }Expand description
Serial abstraction
Implementations§
Source§impl<PINS> Serial<USART1, PINS>
impl<PINS> Serial<USART1, PINS>
Sourcepub fn usart1(
usart: USART1,
pins: PINS,
config: impl Into<Config>,
clocks: Clocks,
apb: &mut <USART1 as RccBus>::Bus,
) -> Self
pub fn usart1( usart: USART1, pins: PINS, config: impl Into<Config>, clocks: Clocks, apb: &mut <USART1 as RccBus>::Bus, ) -> Self
Configures the serial interface and creates the interface struct.
Config is a config struct that configures baud rate, stop bits and parity.
Clocks passes information about the current frequencies of
the clocks. The existence of the struct ensures that the
clock settings are fixed.
The serial struct takes ownership over the USARTX device
registers and the specified PINS
MAPR and APBX are register handles which are passed for
configuration. (MAPR is used to map the USART to the
corresponding pins. APBX is used to reset the USART.)
Sourcepub fn check_for_error() -> Result<(), Error>
pub fn check_for_error() -> Result<(), Error>
Check for, and return, any errors
See Rx::check_for_error.
Source§impl<PINS> Serial<USART2, PINS>
impl<PINS> Serial<USART2, PINS>
Sourcepub fn usart2(
usart: USART2,
pins: PINS,
config: impl Into<Config>,
clocks: Clocks,
apb: &mut <USART2 as RccBus>::Bus,
) -> Self
pub fn usart2( usart: USART2, pins: PINS, config: impl Into<Config>, clocks: Clocks, apb: &mut <USART2 as RccBus>::Bus, ) -> Self
Configures the serial interface and creates the interface struct.
Config is a config struct that configures baud rate, stop bits and parity.
Clocks passes information about the current frequencies of
the clocks. The existence of the struct ensures that the
clock settings are fixed.
The serial struct takes ownership over the USARTX device
registers and the specified PINS
MAPR and APBX are register handles which are passed for
configuration. (MAPR is used to map the USART to the
corresponding pins. APBX is used to reset the USART.)
Sourcepub fn check_for_error() -> Result<(), Error>
pub fn check_for_error() -> Result<(), Error>
Check for, and return, any errors
See Rx::check_for_error.