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: io.serial.SerialPort, in acceptable_baud_error: f32, out current_baud_rate: u32, out current_data_bits: u8, out current_stop_bits: io.serial.StopBits, out current_parity: io.serial.Parity, out current_control_flow: io.serial.ControlFlow, out current_sw_control_flow_rx: io.serial.SoftwareControlFlow, out current_sw_control_flow_tx: io.serial.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: io.serial.SerialPort)

Changes the output control lanes of the serial port.

async_call query_control(in port: io.serial.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: io.serial.SerialPort, in data: bytestr, out written: usize)

Writes data to the serial port.

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

Reads data from a serial port.

async_call break(in port: io.serial.SerialPort, in duration: Duration)

Sends a break signal.

LEARN: A break signal means that the TX line is held *low* for a given duration larger than a single word. This way, the receiver can recognize an event that will be transferred "out of band" and allows to send an event to the receiver.

In DMX, this is used to signal the start of a new frame.