pub struct Serial<USART, PINS> { /* private fields */ }
Expand description

Serial abstraction

Implementations

Configures the serial interface and creates the interface struct.

Config is a config struct that configures baud rate, stop bits and parity.

Clocks passes information about the current frequencies of the clocks. The existence of the struct ensures that the clock settings are fixed.

The serial struct takes ownership over the USARTX device registers and the specified PINS

MAPR and APBX are register handles which are passed for configuration. (MAPR is used to map the USART to the corresponding pins. APBX is used to reset the USART.)

Starts listening for an interrupt event

Check for, and return, any errors

See Rx::check_for_error.

Stops listening for an interrupt event

Splits the Serial abstraction into a transmitter and a receiver half

Frees the USART peripheral

Configures the serial interface and creates the interface struct.

Config is a config struct that configures baud rate, stop bits and parity.

Clocks passes information about the current frequencies of the clocks. The existence of the struct ensures that the clock settings are fixed.

The serial struct takes ownership over the USARTX device registers and the specified PINS

MAPR and APBX are register handles which are passed for configuration. (MAPR is used to map the USART to the corresponding pins. APBX is used to reset the USART.)

Starts listening for an interrupt event

Check for, and return, any errors

See Rx::check_for_error.

Stops listening for an interrupt event

Splits the Serial abstraction into a transmitter and a receiver half

Frees the USART peripheral

Trait Implementations

Read error

Reads a single word from the serial interface

Read error

Reads a single word from the serial interface

Writes a string slice into this writer, returning whether the write succeeded. Read more

Writes a char into this writer, returning whether the write succeeded. Read more

Glue for usage of the write! macro with implementors of this trait. Read more

Write error

Ensures that none of the previously written words are still buffered

Writes a single word to the serial interface

Write error

Ensures that none of the previously written words are still buffered

Writes a single word to the serial interface

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.