[][src]Struct lpc82x_hal::usart::USART

pub struct USART<UsartX, State = Enabled> { /* fields omitted */ }

Interface to a USART peripheral

Controls the USART. Use Peripherals to gain access to an instance of this struct.

Please refer to the module documentation for more information.

Methods

impl<UsartX> USART<UsartX, Disabled> where
    UsartX: Peripheral
[src]

pub fn enable<Rx, Tx>(
    self,
    baud_rate: &BaudRate,
    syscon: &mut Handle,
    _: Function<UsartX::Rx, Assigned<Rx>>,
    _: Function<UsartX::Tx, Assigned<Tx>>
) -> USART<UsartX, Enabled> where
    Rx: PinTrait,
    Tx: PinTrait,
    UsartX::Rx: FunctionTrait<Rx>,
    UsartX::Tx: FunctionTrait<Tx>, 
[src]

Enable the USART

This method is only available, if USART is in the Disabled state. Code that attempts to call this method when the peripheral is already enabled will not compile.

Consumes this instance of USART and returns another instance that has its State type parameter set to Enabled.

Limitations

For USART to function correctly, the UARTFRG reset must be cleared. This is the default, so unless you have messed with those settings, you should be good.

Examples

Please refer to the module documentation for a full example.

impl<UsartX> USART<UsartX, Enabled> where
    UsartX: Peripheral
[src]

pub fn disable(self, syscon: &mut Handle) -> USART<UsartX, Disabled>[src]

Disable the USART

This method is only available, if USART is in the Enabled state. Code that attempts to call this method when the peripheral is already disabled will not compile.

Consumes this instance of USART and returns another instance that has its State type parameter set to Disabled.

pub fn enable_interrupts(&mut self, nvic: &mut NVIC)[src]

Enable the USART interrupts

Enable the interrupts for this USART peripheral. This only enables the interrupts via the NVIC. It doesn't enable any specific interrupt.

pub fn rx(&self) -> Receiver<UsartX>[src]

Return USART receiver

pub fn tx(&self) -> Transmitter<UsartX>[src]

Return USART transmitter

impl<UsartX, State> USART<UsartX, State>[src]

pub fn free(self) -> UsartX[src]

Return the raw peripheral

This method serves as an escape hatch from the HAL API. It returns the raw peripheral, allowing you to do whatever you want with it, without limitations imposed by the API.

If you are using this method because a feature you need is missing from the HAL API, please open an issue or, if an issue for your feature request already exists, comment on the existing issue, so we can prioritize it accordingly.

Auto Trait Implementations

impl<UsartX, State> Send for USART<UsartX, State> where
    State: Send,
    UsartX: Send

impl<UsartX, State> Sync for USART<UsartX, State> where
    State: Sync,
    UsartX: Sync

Blanket Implementations

impl<T> From for T[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.

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

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

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

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