返回所有文章
工程 / TSENGCHEN BLOG

RK3576 INDUSTRIAL RS485

09_Engineering/DTS · RK3576 INDUSTRIAL RS485

09_Engineering · 第 1 / 7 篇

保留原笔记正文与技术内容,仅脱敏敏感信息。配图按作者要求保留原样。

传统设备树编写方法

原理图

RS485收发器

R0:UART1_RX_M0:GPIO0_C0_d RE#/DE: UART1_RETN_M0:GPIO0_D3_d DI:UART1_TX_M0:GPIO0_B7_d VCC:3.3v

dtsi

compatible = “rockchip,rk3576-uart”, “snps,dw-apb-uart”; status = “disabled”;

yaml

vim /home/user/SDK/rk3xxx/kernel-6.1/Documentation/devicetree/bindings/serial/rs485.yaml

# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/serial/rs485.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: RS485 serial communications Bindings

description: The RTS signal is capable of automatically controlling line
  direction for the built-in half-duplex mode. The properties described
  hereafter shall be given to a half-duplex capable UART node.

maintainers:
  - Rob Herring <robh@kernel.org>
    
rs485-rts-delay:
    description: prop-encoded-array <a b>
    $ref: /schemas/types.yaml#/definitions/uint32-array
    items:
      items:
        - description: Delay between rts signal and beginning of data sent in
            milliseconds. It corresponds to the delay before sending data.
          default: 0
          maximum: 100
        - description: Delay between end of data sent and rts signal in milliseconds.
            It corresponds to the delay after sending data and actual release
            of the line.
          default: 0
          maximum: 100

  rs485-rts-active-low:
    description: drive RTS low when sending (default is high).
    $ref: /schemas/types.yaml#/definitions/flag

  rs485-rx-active-high:
    description: Polarity of receiver enable signal (when separate from RTS).
      True indicates active high (default is low).
    $ref: /schemas/types.yaml#/definitions/flag

  linux,rs485-enabled-at-boot-time:
    description: enables the rs485 feature at boot time. It can be disabled
      later with proper ioctl.
    $ref: /schemas/types.yaml#/definitions/flag

  rs485-rx-during-tx:
    description: enables the receiving of data even while sending data.
    $ref: /schemas/types.yaml#/definitions/flag

  rs485-term-gpios:
    description: GPIO pin to enable RS485 bus termination.
    maxItems: 1
    
additionalProperties: true
09_Engineering · 文档目录
下一篇RK182x 系统资源