[−][src]Struct lpc82x_hal::usart::USART
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]
UsartX: Peripheral,
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]
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>,
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]
UsartX: Peripheral,
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,
State: Send,
UsartX: Send,
impl<UsartX, State> Sync for USART<UsartX, State> where
State: Sync,
UsartX: Sync,
State: Sync,
UsartX: Sync,
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,