Ashet OS

namespace: ashet.io.serial

Documentation

Functions and types related to serial busses like RS232, RS485 or similar.

Types

Asynchronous Operations

async_call configure(in port: SerialPort, in acceptable_baud_error: f32, out current_baud_rate: u32, out current_data_bits: u8, out current_stop_bits: StopBits, out current_parity: Parity, out current_control_flow: ControlFlow, out current_sw_control_flow_rx: SoftwareControlFlow, out current_sw_control_flow_tx: SoftwareControlFlow)

Changes the configuration of a serial port and returns the new configuration.

This function can also be used to query the current configuration by requesting no changes.

async_call control(in port: SerialPort)

Changes the output control lanes of the serial port.

async_call query_control(in port: SerialPort, out dtr: bool, out dcd: bool, out dsr: bool, out ring: bool, out rts: bool, out cts: bool)

Reads all control lanes of the serial port.

async_call write(in port: SerialPort, in data: bytestr, out written: usize)

Writes data to the serial port.

async_call read(in port: SerialPort, in data: bytebuf, out read: usize, out stop_reason: SerialPortError)

Reads data from a serial port.

async_call break(in port: SerialPort, in duration: Duration)

Sends a break signal.