[][src]Struct avr_hal_generic::usart::Baudrate

pub struct Baudrate<CLOCK> {
    pub ubrr: u16,
    pub u2x: bool,
    pub _clock: PhantomData<CLOCK>,
}

Representation of a USART baudrate

Precalculated parameters for configuring a certain USART baudrate.

Fields

ubrr: u16

Value of the UBRR# register

u2x: bool

Value of the U2X# bit

_clock: PhantomData<CLOCK>

The baudrate calculation depends on the configured clock rate, thus a CLOCK generic parameter is needed.

Implementations

impl<CLOCK: Clock> Baudrate<CLOCK>[src]

pub fn new(baud: u32) -> Baudrate<CLOCK>[src]

Calculate parameters for a certain baudrate at a certain CLOCK speed.

pub fn with_exact(u2x: bool, ubrr: u16) -> Baudrate<CLOCK>[src]

Construct a Baudrate from given UBRR# and U2X# values.

This provides exact control over the resulting clock speed.

Trait Implementations

impl<CLOCK: Clone> Clone for Baudrate<CLOCK>[src]

impl<CLOCK: Copy> Copy for Baudrate<CLOCK>[src]

impl<CLOCK: Debug> Debug for Baudrate<CLOCK>[src]

impl<CLOCK: Clock> Eq for Baudrate<CLOCK>[src]

impl<CLOCK: Clock> From<u32> for Baudrate<CLOCK>[src]

impl<CLOCK: Clock> Ord for Baudrate<CLOCK>[src]

impl<CLOCK: Clock> PartialEq<Baudrate<CLOCK>> for Baudrate<CLOCK>[src]

impl<CLOCK: Clock> PartialOrd<Baudrate<CLOCK>> for Baudrate<CLOCK>[src]

Auto Trait Implementations

impl<CLOCK> Send for Baudrate<CLOCK> where
    CLOCK: Send
[src]

impl<CLOCK> Sync for Baudrate<CLOCK> where
    CLOCK: Sync
[src]

impl<CLOCK> Unpin for Baudrate<CLOCK> where
    CLOCK: Unpin
[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.