6. UART 使用

6.1. 简介

AIO-3562JQ支持 UART、RS232、RS485 接口

  • UARTx1

  • RS485x2

  • RS232x2

其中 UART 为 uart7,开发板的 RS232 接口由主控的 uart8 和 uart9 扩展出来,而 RS485 由 uart5 和 uart6 扩展出来。

AIO-3562JQ开发板的串口接口图如下:

_images/uart_interface.jpg

6.2. DTS 配置

文件路径kernel/arch/arm64/boot/dts/rockchip/rk3562-firefly-aio-3562jq.dtsi

/* RS485 */
&uart5 {
    status = "okay";
    pinctrl-names = "default";
    pinctrl-0 = <&uart5m1_xfer>;
};

&uart6 {
    status = "okay";
    pinctrl-names = "default";
    pinctrl-0 = <&uart6m0_xfer>;
};

&uart7 {
    status = "okay";
    pinctrl-names = "default";
    pinctrl-0 = <&uart7m0_xfer>;
};

/* RS232 */
&uart8 {
    status = "okay";
    pinctrl-names = "default";
    pinctrl-0 = <&uart8m0_xfer>;
};

&uart9 {
    status = "okay";
    pinctrl-names = "default";
    pinctrl-0 = <&uart9m1_xfer>;
};

硬件接口对应软件上的节点分别为:

485A1/B1:   /dev/ttyS5
485A2/B2:   /dev/ttyS6
TX7/RX7:    /dev/ttyS7
232TX1/RX1:  /dev/ttyS8
232TX2/RX2:  /dev/ttyS9