Enum mio_serial::BaudRate
[−]
[src]
pub enum BaudRate {
Baud50,
Baud75,
Baud110,
Baud134,
Baud150,
Baud200,
Baud300,
Baud600,
Baud1200,
Baud1800,
Baud2400,
Baud4800,
Baud9600,
Baud19200,
Baud38400,
Baud57600,
Baud115200,
Baud230400,
Baud460800,
Baud500000,
Baud576000,
Baud921600,
Baud1000000,
Baud1152000,
Baud1500000,
Baud2000000,
Baud2500000,
Baud3000000,
Baud3500000,
Baud4000000,
BaudOther(u32),
}Serial port baud rates.
Portability
The BaudRate variants with numeric suffixes, e.g., Baud9600, indicate standard baud rates
that are widely-supported on many systems. While non-standard baud rates can be set with
BaudOther, their behavior is system-dependent. Some systems may not support arbitrary baud
rates. Using the standard baud rates is more likely to result in portable applications.
Variants
Baud5050 baud.
Baud7575 baud.
Baud110110 baud.
Baud134134 baud.
Baud150150 baud.
Baud200200 baud.
Baud300300 baud.
Baud600600 baud.
Baud12001200 baud.
Baud18001800 baud.
Baud24002400 baud.
Baud48004800 baud.
Baud96009600 baud.
Baud1920019,200 baud.
Baud3840038,400 baud.
Baud5760057,600 baud.
Baud115200115,200 baud.
Baud230400230,400 baud.
Baud460800460,800 baud.
Baud500000500,000 baud.
Baud576000576,000 baud.
Baud921600921,600 baud.
Baud10000001,000,000 baud.
Baud11520001,152,000 baud.
Baud15000001,500,000 baud.
Baud20000002,000,000 baud.
Baud25000002,500,000 baud.
Baud30000003,000,000 baud.
Baud35000003,500,000 baud.
Baud40000004,000,000 baud.
BaudOther(u32)Non-standard baud rates.
BaudOther can be used to set non-standard baud rates by setting its member to be the
desired baud rate.
BaudOther(4_000_000); // 4,000,000 baud
Non-standard baud rates may not be supported on all systems.
Methods
impl BaudRate[src]
fn standard_rates() -> Vec<u32>[src]
Returns all cross-platform baud rates
fn platform_rates() -> Vec<u32>[src]
Returns all available baud rates for the current platform
Trait Implementations
impl Copy for BaudRate[src]
impl Clone for BaudRate[src]
impl From<u32> for BaudRate[src]
fn from(speed: u32) -> BaudRate[src]
Creates a BaudRate for a particular speed.
This function can be used to select a BaudRate variant from an integer containing the
desired baud rate.
Example
assert_eq!(BaudRate::Baud9600, BaudRate::from(9600)); assert_eq!(BaudRate::BaudOther(50000), BaudRate::from(50000)); assert_eq!(BaudRate::Baud9600, 9600u32.into()); assert_eq!(BaudRate::BaudOther(50000), 50000u32.into());