Struct rs485::SerialRs485
[−]
[src]
#[repr(C)]pub struct SerialRs485 { /* fields omitted */ }
RS485 serial configuration
Internally, this structure is the same as a struct serial_rs485
.
Methods
impl SerialRs485
[src]
fn new() -> SerialRs485
Create a new, empty set of serial settings
All flags will default to "off", delays will be set to 0 ms.
fn from_fd(fd: RawFd) -> Result<SerialRs485>
Load settings from file descriptor
Settings will be loaded from the file descriptor, which must be a valid serial device support RS485 extensions
fn set_enabled<'a>(&'a mut self, enabled: bool) -> &'a mut Self
Enable RS485 support
Unless enabled, none of the settings set take effect.
fn set_rts_on_send<'a>(&'a mut self, rts_on_send: bool) -> &'a mut Self
Set RTS high or low before sending
RTS will be set before sending, this setting controls whether
it will be set high (true
) or low (false
).
fn set_rts_after_send<'a>(&'a mut self, rts_after_send: bool) -> &'a mut Self
Set RTS high or low after sending
RTS will be set after sending, this setting contrls whether
it will be set high (true
) or low (false
).
fn delay_rts_before_send_ms<'a>(
&'a mut self,
delay_rts_before_send: u32
) -> &'a mut Self
&'a mut self,
delay_rts_before_send: u32
) -> &'a mut Self
Delay before sending in ms
If set to non-zero, transmission will not start until
delays_rts_before_send
milliseconds after RTS has been set
fn delay_rts_after_send_ms<'a>(
&'a mut self,
delay_rts_after_send: u32
) -> &'a mut Self
&'a mut self,
delay_rts_after_send: u32
) -> &'a mut Self
Hold RTS after sending, in ms
If set to non-zero, RTS will be kept high/low for
delays_rts_after_send
ms after the transmission is complete
fn set_rx_during_tx<'a>(&'a mut self, set_rx_during_tx: bool) -> &'a mut Self
Allow receiving whilst transmitting
Note that turning off this option sometimes seems to make the UART misbehave and cut off transmission. For this reason, it is best left on even when using half-duplex.
fn set_on_fd(&self, fd: RawFd) -> Result<()>
Apply settings to file descriptor
Applies the constructed configuration a raw filedescriptor using
ioctl
.
Trait Implementations
impl Copy for SerialRs485
[src]
impl Clone for SerialRs485
[src]
fn clone(&self) -> SerialRs485
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more