Struct stm32f3xx_hal::serial::config::Config [−][src]
#[non_exhaustive]pub struct Config { pub baudrate: Baud, pub parity: Parity, pub stopbits: StopBits, }
Expand description
Configuration struct for Serial providing all
communication-related / parameters. Serial always uses eight data
bits plus the parity bit - if selected.
Create a configuration by using default in combination with the
builder methods. The following snippet shows creating a configuration
for 19,200 Baud, 8N1 by deriving it from the default value:
let config = Config::default().baudrate(19_200.Bd()); assert!(config.baudrate == 19_200.Bd()); assert!(config.parity == Parity::None); assert!(config.stopbits == StopBits::STOP1);
Fields (Non-exhaustive)
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.baudrate: BaudSerial interface baud rate
parity: ParityWhether and how to generate/check a parity bit
stopbits: StopBitsThe number of stop bits to follow the last data bit or the parity bit