pub struct Tx<I, State, Throttle> { /* private fields */ }Expand description
USART transmitter
Can be accessed through USART.
§embedded-hal traits
embedded_hal::serial::Writefor non-blocking writesembedded_hal::blocking::serial::Writefor blocking writes
Implementations§
Source§impl<I, W, Mode, Throttle> Tx<I, Enabled<W, Mode>, Throttle>
impl<I, W, Mode, Throttle> Tx<I, Enabled<W, Mode>, Throttle>
Sourcepub fn enable_rts<P, S>(
&mut self,
function: Function<I::Rts, Unassigned>,
pin: Pin<P, S>,
swm: &mut Handle,
) -> (Function<I::Rts, Assigned<P>>, <Pin<P, S> as AssignFunction<I::Rts, <I::Rts as FunctionTrait<P>>::Kind>>::Assigned)where
P: Trait,
S: State,
Pin<P, S>: AssignFunction<I::Rts, <I::Rts as FunctionTrait<P>>::Kind>,
I::Rts: FunctionTrait<P>,
pub fn enable_rts<P, S>(
&mut self,
function: Function<I::Rts, Unassigned>,
pin: Pin<P, S>,
swm: &mut Handle,
) -> (Function<I::Rts, Assigned<P>>, <Pin<P, S> as AssignFunction<I::Rts, <I::Rts as FunctionTrait<P>>::Kind>>::Assigned)where
P: Trait,
S: State,
Pin<P, S>: AssignFunction<I::Rts, <I::Rts as FunctionTrait<P>>::Kind>,
I::Rts: FunctionTrait<P>,
Enable RTS signal
Configure the transmitter to assert the Request to Send (RTS) signal, when it is ready to send.
This is a convenience method that ensures the correct RTS function for this peripheral instance is assigned to a pin. The same effect can be achieved by just assigning the function using the SWM API.
Sourcepub fn disable_rts<P, S>(
&mut self,
function: Function<I::Rts, Assigned<P>>,
pin: Pin<P, S>,
swm: &mut Handle,
) -> (Function<I::Rts, Unassigned>, <Pin<P, S> as UnassignFunction<I::Rts, <I::Rts as FunctionTrait<P>>::Kind>>::Unassigned)where
P: Trait,
S: State,
Pin<P, S>: UnassignFunction<I::Rts, <I::Rts as FunctionTrait<P>>::Kind>,
I::Rts: FunctionTrait<P>,
pub fn disable_rts<P, S>(
&mut self,
function: Function<I::Rts, Assigned<P>>,
pin: Pin<P, S>,
swm: &mut Handle,
) -> (Function<I::Rts, Unassigned>, <Pin<P, S> as UnassignFunction<I::Rts, <I::Rts as FunctionTrait<P>>::Kind>>::Unassigned)where
P: Trait,
S: State,
Pin<P, S>: UnassignFunction<I::Rts, <I::Rts as FunctionTrait<P>>::Kind>,
I::Rts: FunctionTrait<P>,
Disable RTS signal
Configure the transmitter to no longer assert the Request to Send (RTS) signal.
This is a convenience method that ensures the correct RTS function for this peripheral instance is unassigned. The same effect can be achieved by just unassigning the function using the SWM API.
Sourcepub fn is_flag_set(&self, flag: Flag) -> bool
pub fn is_flag_set(&self, flag: Flag) -> bool
Query whether the provided flag is set
Flags that need to be reset by software will be reset by this operation.
Sourcepub fn enable_interrupts(&mut self, interrupts: Interrupts)
pub fn enable_interrupts(&mut self, interrupts: Interrupts)
Enable interrupts
Enables all interrupts set to true in interrupts. Interrupts set to
false are not affected.
§Example
use lpc8xx_hal::usart;
// Enable only RXRDY and TXRDY, leave other interrupts untouched.
usart.enable_interrupts(usart::Interrupts {
RXRDY: true,
TXRDY: true,
.. usart::Interrupts::default()
});Sourcepub fn disable_interrupts(&mut self, interrupts: Interrupts)
pub fn disable_interrupts(&mut self, interrupts: Interrupts)
Disable interrupts
Disables all interrupts set to true in interrupts. Interrupts set to
false are not affected.
§Example
use lpc8xx_hal::usart;
// Disable only RXRDY and TXRDY, leave other interrupts untouched.
usart.disable_interrupts(usart::Interrupts {
RXRDY: true,
TXRDY: true,
.. usart::Interrupts::default()
});Source§impl<I, W, Mode> Tx<I, Enabled<W, Mode>, NoThrottle>
impl<I, W, Mode> Tx<I, Enabled<W, Mode>, NoThrottle>
Source§impl<I, W, Mode, Function> Tx<I, Enabled<W, Mode>, CtsThrottle<Function>>
impl<I, W, Mode, Function> Tx<I, Enabled<W, Mode>, CtsThrottle<Function>>
Sourcepub fn disable_cts_throttling(
self,
) -> (Tx<I, Enabled<W, Mode>, NoThrottle>, Function)
pub fn disable_cts_throttling( self, ) -> (Tx<I, Enabled<W, Mode>, NoThrottle>, Function)
Disable throttling via CTS signal
Configure the transmitter to ignore the CTS signal. Returns the SWM function for the CTS signal, so it can be reused to enable CTS throttling again, or for something else.