Ashet OS

async_call: ashet.io.serial.configure

Documentation

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.

Inputs

port: io.serial.SerialPort
acceptable_baud_error: f32

Outputs

current_baud_rate: u32
current_data_bits: u8
current_stop_bits: io.serial.StopBits
current_parity: io.serial.Parity
current_control_flow: io.serial.ControlFlow
current_sw_control_flow_rx: io.serial.SoftwareControlFlow
current_sw_control_flow_tx: io.serial.SoftwareControlFlow

Errors

InvalidHandle
ImpreciseBaudRate

The actual baud rate diverges more than acceptable_baud_error from the requested baud rate.

UnsupportedDataBits

The requested word size is not supported by this serial port.

UnsupportedStopBits

The requested number of stop bits is not supported by this serial port.

UnsupportedParity

The requested parity is not supported by this serial port.

UnsupportedControlFlow

The requested control flow (or its configuration) is not supported by this serial port.