|
您好!tronlong提供的最新的linux3.3内核已经对uart0和uart1做了rs485功能的支持,uart2默认为启动串口。如何想使能uart0和uart1 rs485的功能,只需在menuconfig将485使能。# v5 J+ N5 Z& v& Z
*** DaVinci Core Type *** | |
& q0 ?9 S, b+ E | | [ ] DaVinci 644x based system | |
0 F* I F2 f# O. n | | [ ] DaVinci 355 based system | |
; ]9 I1 N- E1 _+ Y# u+ n | | [ ] DaVinci 646x based system | |7 |4 F1 }0 F# s6 W0 k4 r0 u
| | [ ] DA830/OMAP-L137/AM17x based system | |% G- C6 s X! _
| | [*] DA850/OMAP-L138/AM18x based system | | O" t3 l9 c$ e9 n+ G2 W, o' ?" w
| | [ ] Enable UART1 flow control | |
4 Z, J0 ^, h8 W# {; R2 J | | [ ] Enable UART0 RS485 funcation | |
, l/ }# a2 K; g2 } | | [*] Enable UART1 RS485 funcation
1 H5 X9 G; D* K( Q6 L/ S7 i) z P( |: N( P) ]
想了解详细的功能实现,也可以查看8250.c文件里面的;
6 x. |: ^6 T* Z5 X1 y, ]. j- [! avoid serial8250_tx_chars(struct uart_8250_port *up)
4 A4 B4 ]2 J3 i- s1 s return;
' V0 P" I9 U6 |3 }3 Y {% f }
$ i, t2 e. c5 r7 b4 k d" v% \' ^% F+ Z' i2 w; |* a% f' A
+#if 1$ i/ ]1 A @; R7 b
+ /* The funcation with RS485 flow control */
- r- P5 R, V' D9 g, F+ if (up->port.private_data) {
- _2 R1 `1 t8 T+ struct serial8250_flow_ctrl *flow_ctrl_p;
! C( t7 ~5 Q% N0 u; o6 I: D5 O, v+ flow_ctrl_p = up->port.private_data;
8 J% U( g4 G9 d. Y+ H+
( }0 Q# ~! V* }5 K7 W' o+ if (flow_ctrl_p->gpio) {
1 ^# P$ S5 N: \+ gpio_set_value(flow_ctrl_p->gpio, 1);8 [1 ~3 g7 b R( C7 B1 ]
+ ndelay(50); /* Propagation delay >= 50ns */$ p7 L: M4 C7 c4 l* x% T. O1 c9 J
+ }, |- V5 V9 p' ~. o# n# \2 S C
+ }
5 `" N3 p; l4 H9 b( R+#endif
! J7 L- ^* j6 Y9 I9 U希望对您有帮助。+ j j1 t; v/ U0 |- N1 [% b
|
|