This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

am335x 如何使用将串口配置成485功能



内核版本是linux-rt-4.1.18,现在想修改uart2,使用rs485的功能,使用gpio0_5作为控制引脚

配置完成没有办法使用,需要手动对gpio0_5拉高或拉低才能完成收发,请问这种情况应该怎么处理

设备树配置如下

uart2_pins_default: pinmux_uart2_pins  {
	pinctrl-single,pins = <
		0x150 (PIN_INPUT_PULLUP | MUX_MODE1) /* (A17) spi0_sclk.uart2_rxd */
		0x154 (PIN_OUTPUT_PULLDOWN | MUX_MODE1) /* (B17) spi0_d0.uart2_txd */
		0x15c (PIN_OUTPUT | MUX_MODE7) /* (A16) spi0_cs0.gpio0[5] */
	>;
};

&uart2 {
	pinctrl-names = "default";
	pinctrl-0 = <&uart2_pins_default>;
	rts-gpio = <&gpio0 5 GPIO_ACTIVE_HIGH>;
	rs485-rts-active-high;
	rs485-rts-delay = <1 1>;
	linux,rs485-enabled-at-boot-time;
	status = "okay";
};