pub struct Serial;
Expand description
Struct managing all access to the robot’s serial port connection
Implementations§
source§impl Serial
impl Serial
sourcepub fn enable_USART_RXC_interrupt()
pub fn enable_USART_RXC_interrupt()
Enable the USART_RXC interrupt
sourcepub fn enable_USART_TXC_interrupt()
pub fn enable_USART_TXC_interrupt()
Enable the USART_TXC interrupt
sourcepub fn disable_USART_RXC_interrupt()
pub fn disable_USART_RXC_interrupt()
Disable the USART_RXC interrupt
sourcepub fn disable_USART_TXC_interrupt()
pub fn disable_USART_TXC_interrupt()
Disable the USART_TXC interrupt
sourcepub fn set_baudrate_low()
pub fn set_baudrate_low()
Configure serial connection to low baudrate UBRR_BAUD_LOW
.
sourcepub fn set_baudrate_high()
pub fn set_baudrate_high()
Configure serial connection to high baudrate UBRR_BAUD_HIGH
.
sourcepub fn read_raw() -> u8
pub fn read_raw() -> u8
Reads a single raw byte from the Serial
connection. Blocks until the processor is ready
to receive the next byte, i.e., the corresponding bit UDRE
is set in UCSRA
.
sourcepub fn write_raw(b: u8)
pub fn write_raw(b: u8)
Writes a single raw byte to the Serial
connection. Blocks until the processor is ready to
send the next byte, i.e., the corresponding bit UDRE
is set in UCSRA
.
sourcepub fn write<T: SerialWritable>(value: T)
pub fn write<T: SerialWritable>(value: T)
Write something to the Serial
connection. By default, supports &str
, char
, and basic
number types (in decimal notation).
sourcepub fn write_dec<T: SerialWritableDecimal>(value: T)
pub fn write_dec<T: SerialWritableDecimal>(value: T)
Write a number formatted as decimal to the Serial
connection.
sourcepub fn write_hex<T: SerialWritableHexadecimal>(value: T)
pub fn write_hex<T: SerialWritableHexadecimal>(value: T)
Write a number formatted as hexadecimal to the Serial
connection.