Asphinx.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]hPortuguese (Brazilian)}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget2/translations/pt_BR/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}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(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&]uh1hhhhKhjubh)}(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.}(hj#hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubeh}(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}(hjBhhhNhNubah}(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.}(hjThhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK hjPubh)}(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 }(hj5hhhNhNubj)}(h``SER_RS485_ADDR_DEST``h]hSER_RS485_ADDR_DEST}(hj=hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj5ubh is set).}(hj5hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhj/var/lib/git/docbuild/linux/Documentation/driver-api/serial/serial-rs485:52: ./include/uapi/linux/serial.hhKwhj2ubah}(h]h ]h"]h$]h&]uh1jEhjubeh}(h]h ]h"]h$]h&]uh1j%hj1hKxhj"ubj&)}(h$``padding0`` Padding (set to zero). h](j,)}(h ``padding0``h]j)}(hjhh]hpadding0}(hjjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjfubah}(h]h ]h"]h$]h&]uh1j+hj/var/lib/git/docbuild/linux/Documentation/driver-api/serial/serial-rs485:52: ./include/uapi/linux/serial.hhKyhjbubjF)}(hhh]h)}(hPadding (set to zero).h]hPadding (set to zero).}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhj}hKyhj~ubah}(h]h ]h"]h$]h&]uh1jEhjbubeh}(h]h ]h"]h$]h&]uh1j%hj}hKyhj"ubj&)}(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&]uh1j+hj/var/lib/git/docbuild/linux/Documentation/driver-api/serial/serial-rs485:52: ./include/uapi/linux/serial.hhKyhjubjF)}(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&]uh1jEhjubeh}(h]h ]h"]h$]h&]uh1j%hjhKyhj"ubeh}(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:}(hj hhhNhNubah}(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}(hj&hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj#ubh - RS485 enabled.}(hj#hhhNhNubeh}(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&]uh1jhjubj)}(hG``SER_RS485_RTS_ON_SEND`` - Logical level for RTS pin when sending.h]h)}(hjGh](j)}(h``SER_RS485_RTS_ON_SEND``h]hSER_RS485_RTS_ON_SEND}(hjLhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjIubh. - Logical level for RTS pin when sending.}(hjIhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhj/var/lib/git/docbuild/linux/Documentation/driver-api/serial/serial-rs485:52: ./include/uapi/linux/serial.hhKhjEubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hE``SER_RS485_RTS_AFTER_SEND`` - Logical level for RTS pin after sent.h]h)}(hjmh](j)}(h``SER_RS485_RTS_AFTER_SEND``h]hSER_RS485_RTS_AFTER_SEND}(hjrhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjoubh) - Logical level for RTS pin after sent.}(hjohhhNhNubeh}(h]h ]h"]h$]h&]uh1hhj/var/lib/git/docbuild/linux/Documentation/driver-api/serial/serial-rs485:52: ./include/uapi/linux/serial.hhKhjkubah}(h]h ]h"]h$]h&]uh1jhjubj)}(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.hhKhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(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&]uh1jhjubj)}(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&]uh1jhjubj)}(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}(hj hhhNhNubah}(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}(hj.hhhNhNubah}(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&]uh1jhjubj)}(hd``SER_RS485_ADDR_DEST`` - Destination address (enables **addr_dest**). Requires ``SER_RS485_ADDRB``.h]h)}(hjOh](j)}(h``SER_RS485_ADDR_DEST``h]hSER_RS485_ADDR_DEST}(hjThhhNhNubah}(h]h ]h"]h$]h&]uh1jhjQubh - Destination address (enables }(hjQhhhNhNubj)}(h **addr_dest**h]h addr_dest}(hjfhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjQubh ). Requires }(hjQhhhNhNubj)}(h``SER_RS485_ADDRB``h]hSER_RS485_ADDRB}(hjxhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjQubh.}(hjQhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhj/var/lib/git/docbuild/linux/Documentation/driver-api/serial/serial-rs485:52: ./include/uapi/linux/serial.hhKhjMubah}(h]h ]h"]h$]h&]uh1jhjubj)}(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&]uh1jhjubeh}(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}(hj"hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKlubh)}(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 }(hj4hhhNhNubj)}(h``SER_RS485_ADDRB``h]hSER_RS485_ADDRB}(hj<hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj4ubh flag in struct serial_rs485. The struct serial_rs485 has two additional flags and fields for enabling receive and destination addresses.}(hj4hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKnhj0ubj!)}(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:}(hj[hhhNhNubah}(h]h ]h"]h$]h&]uh1j+hhhKwhjWubjF)}(hhh]j)}(hhh](j)}(hJ``SER_RS485_ADDRB``: Enabled addressing mode (sets also ADDRB in termios).h]h)}(hjqh](j)}(h``SER_RS485_ADDRB``h]hSER_RS485_ADDRB}(hjvhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjsubh7: Enabled addressing mode (sets also ADDRB in termios).}(hjshhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKuhjoubah}(h]h ]h"]h$]h&]uh1jhjlubj)}(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&]uh1jhjlubj)}(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&]uh1jhjlubeh}(h]h ]h"]h$]h&]j-uh1jhhhKuhjiubah}(h]h ]h"]h$]h&]uh1jEhjWubeh}(h]h ]h"]h$]h&]uh1j%hhhKwhjTubj&)}(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&]uh1j+hhhK{hjubjF)}(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&]uh1jhj ubj)}(h$``addr_dest``: Destination address. h]h)}(h#``addr_dest``: Destination address.h](j)}(h ``addr_dest``h]h addr_dest}(hjI hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjE ubh: Destination address.}(hjE hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK{hjA ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]jjuh1jhhhKzhj ubah}(h]h ]h"]h$]h&]uh1jEhjubeh}(h]h ]h"]h$]h&]uh1j%hhhK{hjTubeh}(h]h ]h"]h$]h&]uh1j hj0ubh)}(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 }(hj hhhNhNubj)}(h``SER_RS485_ADDR_RECV``h]hSER_RS485_ADDR_RECV}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh is not set.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK}hj0ubh)}(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&]uh1hhhhKhj0ubeh}(h]h ]h"]h$]h&]uh1hhhhKnhjhhubeh}(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]j}ah ]h"] dt-bindingsah$]h&]jvaj{Kj~juh1j 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]jlasrefids}j}]jlasnameids}(j j hhj<j9jjjjj j j j j j}u nametypes}(j hj<jjj j j uh}(j hhhj9jjj?jvjlj@jIjjj jj j j}j u footnote_refs}jh ]jlas citation_refs} autofootnotes]j aautofootnote_refs]jlasymbol_footnotes]symbol_footnote_refs] footnotes] citations]autofootnote_startKsymbol_footnote_startK id_counter collectionsCounter}j6 KsRparse_messages]transform_messages] transformerN include_log] decorationNhhub.