Module avr_oxide::devices::serialport

source ·
Expand description

Abstractions for serial I/O devices, implementing the Read/Write interfaces provided by avr_oxide::io.

The SerialPort implementation supports the port multiplexing of the AVR controller, meaning that an underlying USART may be connected to different pins of the controller at runtime. Thus the device must be instantiated with both the USART device to use, and the pins which will be used for receive and transmit.

§Usage


  // Configure the serial port early so we can get any panic!() messages
  let mut serial= OxideSerialPort::using_port_and_pins(board::usb_serial(),
                                                       board::usb_serial_pins().0,
                                                       board::usb_serial_pins().1).mode(SerialPortMode::Asynch(BaudRate::Baud9600, DataBits::Bits8, Parity::None, StopBits::Bits1));
  serial.write(b"Welcome to AVRoxide\n");

Structs§

  • Encapsulation of a serial port exposing the standard io::Read/io::Write traits. Also generates Oxide event notifications.

Enums§

  • State of the serial port sent with Oxide events.

Type Aliases§

  • Options for controlling how data is transmitted by the serial port device.

Trait Aliases§