Qsphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}parenthsba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget2/translations/zh_CN/driver-api/serial/serial-rs485modnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget2/translations/zh_TW/driver-api/serial/serial-rs485modnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget2/translations/it_IT/driver-api/serial/serial-rs485modnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget2/translations/ja_JP/driver-api/serial/serial-rs485modnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget2/translations/ko_KR/driver-api/serial/serial-rs485modnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget2/translations/sp_SP/driver-api/serial/serial-rs485modnameN classnameN refexplicituh1hhh ubeh}(h]h ]h"]h$]h&]current_languageEnglishuh1h hh _documenthsourceNlineNubhsection)}(hhh](htitle)}(hRS485 Serial Communicationsh]hRS485 Serial Communications}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhL/var/lib/git/docbuild/linux/Documentation/driver-api/serial/serial-rs485.rsthKubh)}(hhh](h)}(h1. Introductionh]h1. Introduction}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhKubh block_quote)}(hXUEIA-485, also known as TIA/EIA-485 or RS-485, is a standard defining the electrical characteristics of drivers and receivers for use in balanced digital multipoint systems. This standard is widely used for communications in industrial automation because it can be used effectively over long distances and in electrically noisy environments. h]h paragraph)}(hXTEIA-485, also known as TIA/EIA-485 or RS-485, is a standard defining the electrical characteristics of drivers and receivers for use in balanced digital multipoint systems. This standard is widely used for communications in industrial automation because it can be used effectively over long distances and in electrically noisy environments.h]hXTEIA-485, also known as TIA/EIA-485 or RS-485, is a standard defining the electrical characteristics of drivers and receivers for use in balanced digital multipoint systems. This standard is widely used for communications in industrial automation because it can be used effectively over long distances and in electrically noisy environments.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubeh}(h] introductionah ]h"]1. introductionah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(h"2. Hardware-related Considerationsh]h"2. Hardware-related Considerations}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhKubh)}(hXSome CPUs/UARTs (e.g., Atmel AT91 or 16C950 UART) contain a built-in half-duplex mode capable of automatically controlling line direction by toggling RTS or DTR signals. That can be used to control external half-duplex hardware like an RS485 transceiver or any RS232-connected half-duplex devices like some modems. For these microcontrollers, the Linux driver should be made capable of working in both modes, and proper ioctls (see later) should be made available at user-level to allow switching from one mode to the other, and vice versa. h](h)}(hX:Some CPUs/UARTs (e.g., Atmel AT91 or 16C950 UART) contain a built-in half-duplex mode capable of automatically controlling line direction by toggling RTS or DTR signals. That can be used to control external half-duplex hardware like an RS485 transceiver or any RS232-connected half-duplex devices like some modems.h]hX:Some CPUs/UARTs (e.g., Atmel AT91 or 16C950 UART) contain a built-in half-duplex mode capable of automatically controlling line direction by toggling RTS or DTR signals. That can be used to control external half-duplex hardware like an RS485 transceiver or any RS232-connected half-duplex devices like some modems.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhubh)}(hFor these microcontrollers, the Linux driver should be made capable of working in both modes, and proper ioctls (see later) should be made available at user-level to allow switching from one mode to the other, and vice versa.h]hFor these microcontrollers, the Linux driver should be made capable of working in both modes, and proper ioctls (see later) should be made available at user-level to allow switching from one mode to the other, and vice versa.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhubeh}(h]h ]h"]h$]h&]uh1hhhhKhhhhubeh}(h]hardware-related-considerationsah ]h"]"2. hardware-related considerationsah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(h23. Data Structures Already Available in the Kernelh]h23. Data Structures Already Available in the Kernel}(hj.hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj+hhhhhKubh)}(hX3The Linux kernel provides the struct serial_rs485 to handle RS485 communications. This data structure is used to set and configure RS485 parameters in the platform data and in ioctls. The device tree can also provide RS485 boot time parameters [#DT-bindings]_. The serial core fills the struct serial_rs485 from the values given by the device tree when the driver calls uart_get_rs485_mode(). Any driver for devices capable of working both as RS232 and RS485 should implement the ``rs485_config`` callback and provide ``rs485_supported`` in the ``struct uart_port``. The serial core calls ``rs485_config`` to do the device specific part in response to TIOCSRS485 ioctl (see below). The ``rs485_config`` callback receives a pointer to a sanitizated struct serial_rs485. The struct serial_rs485 userspace provides is sanitized before calling ``rs485_config`` using ``rs485_supported`` that indicates what RS485 features the driver supports for the ``struct uart_port``. TIOCGRS485 ioctl can be used to read back the struct serial_rs485 matching to the current configuration. h](h)}(hThe Linux kernel provides the struct serial_rs485 to handle RS485 communications. This data structure is used to set and configure RS485 parameters in the platform data and in ioctls.h]hThe Linux kernel provides the struct serial_rs485 to handle RS485 communications. This data structure is used to set and configure RS485 parameters in the platform data and in ioctls.}(hj@hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK hj<ubh)}(hThe device tree can also provide RS485 boot time parameters [#DT-bindings]_. The serial core fills the struct serial_rs485 from the values given by the device tree when the driver calls uart_get_rs485_mode().h](hDestination address for RS485 addressing mode (used only when }(hj!hhhNhNubj)}(h``SER_RS485_ADDR_DEST``h]hSER_RS485_ADDR_DEST}(hj)hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj!ubh is set).}(hj!hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhj/var/lib/git/docbuild/linux/Documentation/driver-api/serial/serial-rs485:52: ./include/uapi/linux/serial.hhKwhjubah}(h]h ]h"]h$]h&]uh1j1hjubeh}(h]h ]h"]h$]h&]uh1jhjhKxhjubj)}(h$``padding0`` Padding (set to zero). h](j)}(h ``padding0``h]j)}(hjTh]hpadding0}(hjVhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjRubah}(h]h ]h"]h$]h&]uh1jhj/var/lib/git/docbuild/linux/Documentation/driver-api/serial/serial-rs485:52: ./include/uapi/linux/serial.hhKyhjNubj2)}(hhh]h)}(hPadding (set to zero).h]hPadding (set to zero).}(hjmhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjihKyhjjubah}(h]h ]h"]h$]h&]uh1j1hjNubeh}(h]h ]h"]h$]h&]uh1jhjihKyhjubj)}(h#``padding1`` Padding (set to zero).h](j)}(h ``padding1``h]j)}(hjh]hpadding1}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhj/var/lib/git/docbuild/linux/Documentation/driver-api/serial/serial-rs485:52: ./include/uapi/linux/serial.hhKyhjubj2)}(hhh]h)}(hPadding (set to zero).h]hPadding (set to zero).}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhj/var/lib/git/docbuild/linux/Documentation/driver-api/serial/serial-rs485:52: ./include/uapi/linux/serial.hhKzhjubah}(h]h ]h"]h$]h&]uh1j1hjubeh}(h]h ]h"]h$]h&]uh1jhjhKyhjubeh}(h]h ]h"]h$]h&]uh1j hjubeh}(h]h ] kernelindentah"]h$]h&]uh1jhj+hhhNhNubh)}(h**Description**h]j)}(hjh]h Description}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1hhj/var/lib/git/docbuild/linux/Documentation/driver-api/serial/serial-rs485:52: ./include/uapi/linux/serial.hhK}hj+hhubh)}(hSerial interface for controlling RS485 settings on chips with suitable support. Set with TIOCSRS485 and get with TIOCGRS485 if supported by your platform. The set function returns the new state, with any unsupported bits reverted appropriately.h]hSerial interface for controlling RS485 settings on chips with suitable support. Set with TIOCSRS485 and get with TIOCGRS485 if supported by your platform. The set function returns the new state, with any unsupported bits reverted appropriately.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhj/var/lib/git/docbuild/linux/Documentation/driver-api/serial/serial-rs485:52: ./include/uapi/linux/serial.hhK~hj+hhubh)}(hThe flag bits are:h]hThe flag bits are:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhj/var/lib/git/docbuild/linux/Documentation/driver-api/serial/serial-rs485:52: ./include/uapi/linux/serial.hhKhj+hhubh bullet_list)}(hhh](h list_item)}(h.``SER_RS485_ENABLED`` - RS485 enabled.h]h)}(hj h](j)}(h``SER_RS485_ENABLED``h]hSER_RS485_ENABLED}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh - RS485 enabled.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhj/var/lib/git/docbuild/linux/Documentation/driver-api/serial/serial-rs485:52: ./include/uapi/linux/serial.hhKhj ubah}(h]h ]h"]h$]h&]uh1j hjubj )}(hG``SER_RS485_RTS_ON_SEND`` - Logical level for RTS pin when sending.h]h)}(hj3h](j)}(h``SER_RS485_RTS_ON_SEND``h]hSER_RS485_RTS_ON_SEND}(hj8hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj5ubh. - Logical level for RTS pin when sending.}(hj5hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhj/var/lib/git/docbuild/linux/Documentation/driver-api/serial/serial-rs485:52: ./include/uapi/linux/serial.hhKhj1ubah}(h]h ]h"]h$]h&]uh1j hjubj )}(hE``SER_RS485_RTS_AFTER_SEND`` - Logical level for RTS pin after sent.h]h)}(hjYh](j)}(h``SER_RS485_RTS_AFTER_SEND``h]hSER_RS485_RTS_AFTER_SEND}(hj^hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj[ubh) - Logical level for RTS pin after sent.}(hj[hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhj/var/lib/git/docbuild/linux/Documentation/driver-api/serial/serial-rs485:52: ./include/uapi/linux/serial.hhKhjWubah}(h]h ]h"]h$]h&]uh1j hjubj )}(h7``SER_RS485_RX_DURING_TX`` - Full-duplex RS485 line.h]h)}(hjh](j)}(h``SER_RS485_RX_DURING_TX``h]hSER_RS485_RX_DURING_TX}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh - Full-duplex RS485 line.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhj/var/lib/git/docbuild/linux/Documentation/driver-api/serial/serial-rs485:52: ./include/uapi/linux/serial.hhKhj}ubah}(h]h ]h"]h$]h&]uh1j hjubj )}(hF``SER_RS485_TERMINATE_BUS`` - Enable bus termination (if supported).h]h)}(hjh](j)}(h``SER_RS485_TERMINATE_BUS``h]hSER_RS485_TERMINATE_BUS}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh+ - Enable bus termination (if supported).}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhj/var/lib/git/docbuild/linux/Documentation/driver-api/serial/serial-rs485:52: ./include/uapi/linux/serial.hhKhjubah}(h]h ]h"]h$]h&]uh1j hjubj )}(h=``SER_RS485_ADDRB`` - Enable RS485 addressing mode.h]h)}(hjh](j)}(h``SER_RS485_ADDRB``h]hSER_RS485_ADDRB}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh* - Enable RS485 addressing mode.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhj/var/lib/git/docbuild/linux/Documentation/driver-api/serial/serial-rs485:52: ./include/uapi/linux/serial.hhKhjubah}(h]h ]h"]h$]h&]uh1j hjubj )}(hg``SER_RS485_ADDR_RECV`` - Receive address filter (enables **addr_recv**). Requires ``SER_RS485_ADDRB``.h]h)}(hjh](j)}(h``SER_RS485_ADDR_RECV``h]hSER_RS485_ADDR_RECV}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh# - Receive address filter (enables }(hjhhhNhNubj)}(h **addr_recv**h]h addr_recv}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh ). Requires }(hjhhhNhNubj)}(h``SER_RS485_ADDRB``h]hSER_RS485_ADDRB}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhj/var/lib/git/docbuild/linux/Documentation/driver-api/serial/serial-rs485:52: ./include/uapi/linux/serial.hhKhjubah}(h]h ]h"]h$]h&]uh1j hjubj )}(hd``SER_RS485_ADDR_DEST`` - Destination address (enables **addr_dest**). Requires ``SER_RS485_ADDRB``.h]h)}(hj;h](j)}(h``SER_RS485_ADDR_DEST``h]hSER_RS485_ADDR_DEST}(hj@hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj=ubh - Destination address (enables }(hj=hhhNhNubj)}(h **addr_dest**h]h addr_dest}(hjRhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj=ubh ). Requires }(hj=hhhNhNubj)}(h``SER_RS485_ADDRB``h]hSER_RS485_ADDRB}(hjdhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj=ubh.}(hj=hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhj/var/lib/git/docbuild/linux/Documentation/driver-api/serial/serial-rs485:52: ./include/uapi/linux/serial.hhKhj9ubah}(h]h ]h"]h$]h&]uh1j hjubj )}(hO``SER_RS485_MODE_RS422`` - Enable RS422. Requires ``SER_RS485_ENABLED``. h]h)}(hM``SER_RS485_MODE_RS422`` - Enable RS422. Requires ``SER_RS485_ENABLED``.h](j)}(h``SER_RS485_MODE_RS422``h]hSER_RS485_MODE_RS422}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh - Enable RS422. Requires }(hjhhhNhNubj)}(h``SER_RS485_ENABLED``h]hSER_RS485_ENABLED}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhj/var/lib/git/docbuild/linux/Documentation/driver-api/serial/serial-rs485:52: ./include/uapi/linux/serial.hhKhjubah}(h]h ]h"]h$]h&]uh1j hjubeh}(h]h ]h"]h$]h&]bullet*uh1jhj*hKhj+hhubeh}(h]/data-structures-already-available-in-the-kernelah ]h"]23. data structures already available in the kernelah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(h4. Usage from user-levelh]h4. Usage from user-level}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhK8ubh)}(hXaFrom user-level, RS485 configuration can be get/set using the previous ioctls. For instance, to set RS485 you can use the following code:: #include /* Include definition for RS485 ioctls: TIOCGRS485 and TIOCSRS485 */ #include /* Open your specific device (e.g., /dev/mydevice): */ int fd = open ("/dev/mydevice", O_RDWR); if (fd < 0) { /* Error handling. See errno. */ } struct serial_rs485 rs485conf; /* Enable RS485 mode: */ rs485conf.flags |= SER_RS485_ENABLED; /* Set logical level for RTS pin equal to 1 when sending: */ rs485conf.flags |= SER_RS485_RTS_ON_SEND; /* or, set logical level for RTS pin equal to 0 when sending: */ rs485conf.flags &= ~(SER_RS485_RTS_ON_SEND); /* Set logical level for RTS pin equal to 1 after sending: */ rs485conf.flags |= SER_RS485_RTS_AFTER_SEND; /* or, set logical level for RTS pin equal to 0 after sending: */ rs485conf.flags &= ~(SER_RS485_RTS_AFTER_SEND); /* Set rts delay before send, if needed: */ rs485conf.delay_rts_before_send = ...; /* Set rts delay after send, if needed: */ rs485conf.delay_rts_after_send = ...; /* Set this flag if you want to receive data even while sending data */ rs485conf.flags |= SER_RS485_RX_DURING_TX; if (ioctl (fd, TIOCSRS485, &rs485conf) < 0) { /* Error handling. See errno. */ } /* Use read() and write() syscalls here... */ /* Close the device when finished: */ if (close (fd) < 0) { /* Error handling. See errno. */ } h](h)}(hFrom user-level, RS485 configuration can be get/set using the previous ioctls. For instance, to set RS485 you can use the following code::h]hFrom user-level, RS485 configuration can be get/set using the previous ioctls. For instance, to set RS485 you can use the following code:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK:hjubj)}(hX/#include /* Include definition for RS485 ioctls: TIOCGRS485 and TIOCSRS485 */ #include /* Open your specific device (e.g., /dev/mydevice): */ int fd = open ("/dev/mydevice", O_RDWR); if (fd < 0) { /* Error handling. See errno. */ } struct serial_rs485 rs485conf; /* Enable RS485 mode: */ rs485conf.flags |= SER_RS485_ENABLED; /* Set logical level for RTS pin equal to 1 when sending: */ rs485conf.flags |= SER_RS485_RTS_ON_SEND; /* or, set logical level for RTS pin equal to 0 when sending: */ rs485conf.flags &= ~(SER_RS485_RTS_ON_SEND); /* Set logical level for RTS pin equal to 1 after sending: */ rs485conf.flags |= SER_RS485_RTS_AFTER_SEND; /* or, set logical level for RTS pin equal to 0 after sending: */ rs485conf.flags &= ~(SER_RS485_RTS_AFTER_SEND); /* Set rts delay before send, if needed: */ rs485conf.delay_rts_before_send = ...; /* Set rts delay after send, if needed: */ rs485conf.delay_rts_after_send = ...; /* Set this flag if you want to receive data even while sending data */ rs485conf.flags |= SER_RS485_RX_DURING_TX; if (ioctl (fd, TIOCSRS485, &rs485conf) < 0) { /* Error handling. See errno. */ } /* Use read() and write() syscalls here... */ /* Close the device when finished: */ if (close (fd) < 0) { /* Error handling. See errno. */ }h]hX/#include /* Include definition for RS485 ioctls: TIOCGRS485 and TIOCSRS485 */ #include /* Open your specific device (e.g., /dev/mydevice): */ int fd = open ("/dev/mydevice", O_RDWR); if (fd < 0) { /* Error handling. See errno. */ } struct serial_rs485 rs485conf; /* Enable RS485 mode: */ rs485conf.flags |= SER_RS485_ENABLED; /* Set logical level for RTS pin equal to 1 when sending: */ rs485conf.flags |= SER_RS485_RTS_ON_SEND; /* or, set logical level for RTS pin equal to 0 when sending: */ rs485conf.flags &= ~(SER_RS485_RTS_ON_SEND); /* Set logical level for RTS pin equal to 1 after sending: */ rs485conf.flags |= SER_RS485_RTS_AFTER_SEND; /* or, set logical level for RTS pin equal to 0 after sending: */ rs485conf.flags &= ~(SER_RS485_RTS_AFTER_SEND); /* Set rts delay before send, if needed: */ rs485conf.delay_rts_before_send = ...; /* Set rts delay after send, if needed: */ rs485conf.delay_rts_after_send = ...; /* Set this flag if you want to receive data even while sending data */ rs485conf.flags |= SER_RS485_RX_DURING_TX; if (ioctl (fd, TIOCSRS485, &rs485conf) < 0) { /* Error handling. See errno. */ } /* Use read() and write() syscalls here... */ /* Close the device when finished: */ if (close (fd) < 0) { /* Error handling. See errno. */ }}hjsbah}(h]h ]h"]h$]h&]jjuh1jhhhK=hjubeh}(h]h ]h"]h$]h&]uh1hhhhK:hjhhubeh}(h]usage-from-user-levelah ]h"]4. usage from user-levelah$]h&]uh1hhhhhhhhK8ubh)}(hhh](h)}(h5. Multipoint Addressingh]h5. Multipoint Addressing}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hhhhhKlubh)}(hXThe Linux kernel provides addressing mode for multipoint RS-485 serial communications line. The addressing mode is enabled with ``SER_RS485_ADDRB`` flag in struct serial_rs485. The struct serial_rs485 has two additional flags and fields for enabling receive and destination addresses. Address mode flags: - ``SER_RS485_ADDRB``: Enabled addressing mode (sets also ADDRB in termios). - ``SER_RS485_ADDR_RECV``: Receive (filter) address enabled. - ``SER_RS485_ADDR_DEST``: Set destination address. Address fields (enabled with corresponding ``SER_RS485_ADDR_*`` flag): - ``addr_recv``: Receive address. - ``addr_dest``: Destination address. Once a receive address is set, the communication can occur only with the particular device and other peers are filtered out. It is left up to the receiver side to enforce the filtering. Receive address will be cleared if ``SER_RS485_ADDR_RECV`` is not set. Note: not all devices supporting RS485 support multipoint addressing. h](h)}(hXThe Linux kernel provides addressing mode for multipoint RS-485 serial communications line. The addressing mode is enabled with ``SER_RS485_ADDRB`` flag in struct serial_rs485. The struct serial_rs485 has two additional flags and fields for enabling receive and destination addresses.h](hThe Linux kernel provides addressing mode for multipoint RS-485 serial communications line. The addressing mode is enabled with }(hj hhhNhNubj)}(h``SER_RS485_ADDRB``h]hSER_RS485_ADDRB}(hj(hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh flag in struct serial_rs485. The struct serial_rs485 has two additional flags and fields for enabling receive and destination addresses.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKnhjubj )}(hhh](j)}(hAddress mode flags: - ``SER_RS485_ADDRB``: Enabled addressing mode (sets also ADDRB in termios). - ``SER_RS485_ADDR_RECV``: Receive (filter) address enabled. - ``SER_RS485_ADDR_DEST``: Set destination address. h](j)}(hAddress mode flags:h]hAddress mode flags:}(hjGhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKwhjCubj2)}(hhh]j)}(hhh](j )}(hJ``SER_RS485_ADDRB``: Enabled addressing mode (sets also ADDRB in termios).h]h)}(hj]h](j)}(h``SER_RS485_ADDRB``h]hSER_RS485_ADDRB}(hjbhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj_ubh7: Enabled addressing mode (sets also ADDRB in termios).}(hj_hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKuhj[ubah}(h]h ]h"]h$]h&]uh1j hjXubj )}(h:``SER_RS485_ADDR_RECV``: Receive (filter) address enabled.h]h)}(hjh](j)}(h``SER_RS485_ADDR_RECV``h]hSER_RS485_ADDR_RECV}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh#: Receive (filter) address enabled.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKvhjubah}(h]h ]h"]h$]h&]uh1j hjXubj )}(h2``SER_RS485_ADDR_DEST``: Set destination address. h]h)}(h1``SER_RS485_ADDR_DEST``: Set destination address.h](j)}(h``SER_RS485_ADDR_DEST``h]hSER_RS485_ADDR_DEST}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh: Set destination address.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKwhjubah}(h]h ]h"]h$]h&]uh1j hjXubeh}(h]h ]h"]h$]h&]j-uh1jhhhKuhjUubah}(h]h ]h"]h$]h&]uh1j1hjCubeh}(h]h ]h"]h$]h&]uh1jhhhKwhj@ubj)}(hAddress fields (enabled with corresponding ``SER_RS485_ADDR_*`` flag): - ``addr_recv``: Receive address. - ``addr_dest``: Destination address. h](j)}(hFAddress fields (enabled with corresponding ``SER_RS485_ADDR_*`` flag):h](h+Address fields (enabled with corresponding }(hjhhhNhNubj)}(h``SER_RS485_ADDR_*``h]hSER_RS485_ADDR_*}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh flag):}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhK{hjubj2)}(hhh]j)}(hhh](j )}(h``addr_recv``: Receive address.h]h)}(hj h](j)}(h ``addr_recv``h]h addr_recv}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh: Receive address.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKzhj ubah}(h]h ]h"]h$]h&]uh1j hj ubj )}(h$``addr_dest``: Destination address. h]h)}(h#``addr_dest``: Destination address.h](j)}(h ``addr_dest``h]h addr_dest}(hj5 hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj1 ubh: Destination address.}(hj1 hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK{hj- ubah}(h]h ]h"]h$]h&]uh1j hj ubeh}(h]h ]h"]h$]h&]jjuh1jhhhKzhj ubah}(h]h ]h"]h$]h&]uh1j1hjubeh}(h]h ]h"]h$]h&]uh1jhhhK{hj@ubeh}(h]h ]h"]h$]h&]uh1j hjubh)}(hXOnce a receive address is set, the communication can occur only with the particular device and other peers are filtered out. It is left up to the receiver side to enforce the filtering. Receive address will be cleared if ``SER_RS485_ADDR_RECV`` is not set.h](hOnce a receive address is set, the communication can occur only with the particular device and other peers are filtered out. It is left up to the receiver side to enforce the filtering. Receive address will be cleared if }(hjk hhhNhNubj)}(h``SER_RS485_ADDR_RECV``h]hSER_RS485_ADDR_RECV}(hjs hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjk ubh is not set.}(hjk hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK}hjubh)}(hENote: not all devices supporting RS485 support multipoint addressing.h]hENote: not all devices supporting RS485 support multipoint addressing.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubeh}(h]h ]h"]h$]h&]uh1hhhhKnhj hhubeh}(h]multipoint-addressingah ]h"]5. multipoint addressingah$]h&]uh1hhhhhhhhKlubh)}(hhh](h)}(h 6. Referencesh]h 6. References}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hhhhhKubhfootnote)}(h2Documentation/devicetree/bindings/serial/rs485.txth](hlabel)}(hhh]h1}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j hj hhhNhNubh)}(hj h]h2Documentation/devicetree/bindings/serial/rs485.txt}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubeh}(h]jiah ]h"] dt-bindingsah$]h&]jbajgKjjjkuh1j hhhKhj hhubeh}(h] referencesah ]h"] 6. referencesah$]h&]uh1hhhhhhhhKubeh}(h]rs485-serial-communicationsah ]h"]rs485 serial communicationsah$]h&]uh1hhhhhhhhKubeh}(h]h ]h"]h$]h&]sourcehuh1hcurrent_sourceN current_lineNsettingsdocutils.frontendValues)}(hN generatorN datestampN source_linkN source_urlN toc_backlinksentryfootnote_backlinksK sectnum_xformKstrip_commentsNstrip_elements_with_classesN strip_classesN report_levelK halt_levelKexit_status_levelKdebugNwarning_streamN tracebackinput_encoding utf-8-siginput_encoding_error_handlerstrictoutput_encodingutf-8output_encoding_error_handlerj error_encodingutf-8error_encoding_error_handlerbackslashreplace language_codeenrecord_dependenciesNconfigN id_prefixhauto_id_prefixid dump_settingsNdump_internalsNdump_transformsNdump_pseudo_xmlNexpose_internalsNstrict_visitorN_disable_configN_sourceh _destinationN _config_files]7/var/lib/git/docbuild/linux/Documentation/docutils.confafile_insertion_enabled raw_enabledKline_length_limitM'pep_referencesN pep_base_urlhttps://peps.python.org/pep_file_url_templatepep-%04drfc_referencesN rfc_base_url&https://datatracker.ietf.org/doc/html/ tab_widthKtrim_footnote_reference_spacesyntax_highlightlong smart_quotessmartquotes_locales]character_level_inline_markupdoctitle_xform docinfo_xformKsectsubtitle_xform image_loadinglinkembed_stylesheetcloak_email_addressessection_self_linkenvNubreporterNindirect_targets]substitution_defs}substitution_names}refnames} dt-bindings]jXasrefids}ji]jXasnameids}(j j hhj(j%jjjjj j j j j jiu nametypes}(j hj(jjj j j uh}(j hhhj%hjj+jbjXj,j5jjj j j j jij u footnote_refs}jT ]jXas citation_refs} autofootnotes]j aautofootnote_refs]jXasymbol_footnotes]symbol_footnote_refs] footnotes] citations]autofootnote_startKsymbol_footnote_startK id_counter collectionsCounter}j" KsRparse_messages]transform_messages] transformerN include_log] decorationNhhub.