Document number
205065
Version
Rev. N
Issue date
2019-02-04
Sirius OBC and TCM User Manual
Page
49
of
174
5.5.2.5.
Function int ioctl(…)
Ioctl allows for toggling the RS422/RS485/Loopback mode and setting the baud rate.
RS422/RS485 mode selection is not applicable for safe bus and power ctrl UARTs.
Argument name
Type
Direction Description
fd
int
in
File descriptor received at
open
cmd
int
in
Command to send
val
int
in
Value to write or a pointer to a buffer
where data will be written.
Command table
Type
Direction Description
UART_IOCTL_SET_BITRATE
uint32_t
in
Set the bitrate of the line interface.
Possible values:
UART_B375000
UART_B153600
UART_B115200 (default)
UART_B76800
UART_B57600
UART_B38400
UART_B19200
UART_B9600
UART_B4800
UART_B2400
UART_B1200
UART_IOCTL_MODE_SELECT
uint32_t
in
Set the mode of the interface. Possible
values:
UART_RTEMS_MODE_RS422 (default)
UART_RTEMS_MODE_RS485
UART_RTEMS_MODE_LOOPBACK
(TX connected to RX internally)
UART_IOCTL_RX_FLUSH
uint32_t
in
Flushes the RX software FIFO
UART_IOCTL_SET_PARITY
uint32_t
in
Set parity. Possible values:
UART_PARITY_NONE (default)
UART_PARITY_ODD
UART_PARITY_EVEN
UART_IOCTL_SET_BUFFER_DEPTH
uint32_t
in
Set the FIFO buffer depth. Possible
values:
UART_BUFFER_DEPTH_16 (default)
UART_BUFFER_DEPTH_32
UART_BUFFER_DEPTH_64
UART_BUFFER_DEPTH_128
UART_IOCTL_GET_BUFFER_DEPTH
uint32_t*
out
Get the current buffer depth.