|
您好!tronlong提供的最新的linux3.3内核已经对uart0和uart1做了rs485功能的支持,uart2默认为启动串口。如何想使能uart0和uart1 rs485的功能,只需在menuconfig将485使能。+ [# B8 h" {/ ]$ t# b
*** DaVinci Core Type *** | |
' _$ n# P/ {! Q8 I" D# G | | [ ] DaVinci 644x based system | |5 Q0 o& k7 v- c# N. W S7 R v. j
| | [ ] DaVinci 355 based system | |: S1 q% x: a X) ]7 I
| | [ ] DaVinci 646x based system | |
0 m3 J6 m/ V+ j4 v# D9 b | | [ ] DA830/OMAP-L137/AM17x based system | |
+ M$ z; j' U& n; q | | [*] DA850/OMAP-L138/AM18x based system | |' z5 ]' p( P) I6 |
| | [ ] Enable UART1 flow control | |+ M" U9 G4 D2 M) r. \
| | [ ] Enable UART0 RS485 funcation | |* K% `" o* Z& t, P
| | [*] Enable UART1 RS485 funcation + b& d* a* k1 S; i6 l
0 O7 k+ B3 Z$ b, I1 w; y9 F$ O) H
想了解详细的功能实现,也可以查看8250.c文件里面的;
' [/ j0 U: d4 Y$ u& pvoid serial8250_tx_chars(struct uart_8250_port *up)
6 f, ~2 N( H5 a2 x* O/ C$ G return;
- ^* f. g, f! b. m3 I }
2 O0 x+ z: |7 d" a% T
7 ^& o3 R3 ~' M7 W& Z+#if 1
6 h! |; u% c: X' B+ /* The funcation with RS485 flow control */
- f. K; h6 N4 }+ if (up->port.private_data) {
( G* ]' P4 z5 D+ struct serial8250_flow_ctrl *flow_ctrl_p;
; l! t l$ |5 l& O. e* f( W+ flow_ctrl_p = up->port.private_data;
- \( f4 C4 M0 M& K) N; {0 R$ x5 E( ^+
! V- J. x2 v- m) Q+ D1 o! R. f+ if (flow_ctrl_p->gpio) {; ]+ M$ Q- M( Z( J0 T# ]
+ gpio_set_value(flow_ctrl_p->gpio, 1);
- Q) w4 j. m& O+ g6 k1 c+ ndelay(50); /* Propagation delay >= 50ns */7 q3 y% y, t( J% y
+ }3 {5 ~7 q* |& B+ c1 L
+ }7 w3 y# e# p E1 e7 Z S6 m
+#endif( n, p2 V0 [8 X) D" a: Q# w6 Q$ R
希望对您有帮助。, e5 {6 k g1 `9 S1 E
|
|