Enum stm32wlxx_hal::spi::BaudRate
source · #[repr(u8)]pub enum BaudRate {
Div256 = 7,
Div128 = 6,
Div64 = 5,
Div32 = 4,
Div16 = 3,
Div8 = 2,
Div4 = 1,
Div2 = 0,
}
Expand description
Baud rate divisors.
Variants§
Div256 = 7
Source clock / 256
Div128 = 6
Source clock / 128
Div64 = 5
Source clock / 64
Div32 = 4
Source clock / 32
Div16 = 3
Source clock / 16
Div8 = 2
Source clock / 8
Div4 = 1
Source clock / 4
Div2 = 0
Source clock / 2
Implementations§
source§impl BaudRate
impl BaudRate
sourcepub const fn div(&self) -> u16
pub const fn div(&self) -> u16
Get baud rate divisor.
Example
use stm32wlxx_hal::spi::BaudRate;
assert_eq!(BaudRate::Div256.div(), 256);
assert_eq!(BaudRate::Div128.div(), 128);
assert_eq!(BaudRate::Div64.div(), 64);
assert_eq!(BaudRate::Div32.div(), 32);
assert_eq!(BaudRate::Div16.div(), 16);
assert_eq!(BaudRate::Div8.div(), 8);
assert_eq!(BaudRate::Div4.div(), 4);
assert_eq!(BaudRate::Div2.div(), 2);
Trait Implementations§
source§impl PartialEq for BaudRate
impl PartialEq for BaudRate
impl Copy for BaudRate
impl Eq for BaudRate
impl StructuralEq for BaudRate
impl StructuralPartialEq for BaudRate
Auto Trait Implementations§
impl RefUnwindSafe for BaudRate
impl Send for BaudRate
impl Sync for BaudRate
impl Unpin for BaudRate
impl UnwindSafe for BaudRate
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more