|
|
您好!tronlong提供的最新的linux3.3内核已经对uart0和uart1做了rs485功能的支持,uart2默认为启动串口。如何想使能uart0和uart1 rs485的功能,只需在menuconfig将485使能。
1 s) S; w6 A9 V: l% J. Y {$ T *** DaVinci Core Type *** | |" V0 P. J" c8 L( @! {# E( ?
| | [ ] DaVinci 644x based system | |
$ P. \; f0 b0 E& e. Q0 ^9 V; T | | [ ] DaVinci 355 based system | |. P- K4 }% Q7 G0 f! J2 v7 a
| | [ ] DaVinci 646x based system | |
; L$ T5 R, T: m5 }9 @: c+ e. w | | [ ] DA830/OMAP-L137/AM17x based system | |% Q) L: R' z: b) K' I. K
| | [*] DA850/OMAP-L138/AM18x based system | |
, N d; n+ p9 V) Q1 H | | [ ] Enable UART1 flow control | |- p1 a) P3 U6 s
| | [ ] Enable UART0 RS485 funcation | | G$ F1 X# F0 M1 g$ C9 R3 H
| | [*] Enable UART1 RS485 funcation 2 e( N4 a$ a* P- m' T1 a. g
5 H( D5 R& j. d7 p想了解详细的功能实现,也可以查看8250.c文件里面的;
9 b) ?% ~* L* p2 a0 f6 z- wvoid serial8250_tx_chars(struct uart_8250_port *up)6 s# U' c% G# V- w
return;0 S6 c5 N; D: P/ A) p& p
}0 L# Y2 i4 Q: ^7 I" B+ ]
8 ? K/ U! V t" W2 o
+#if 1
7 l- t& P1 x4 Q3 `6 K7 |9 m+ /* The funcation with RS485 flow control */, f( j6 H4 Y6 f3 e. b% N k! [
+ if (up->port.private_data) {
' F; }) J3 |8 h- U2 }7 o5 H+ struct serial8250_flow_ctrl *flow_ctrl_p;
7 l0 y9 i! I1 k+ flow_ctrl_p = up->port.private_data;" h* H4 v0 H) P" k
+
5 g" h5 R1 k: a o, K. g+ if (flow_ctrl_p->gpio) {
9 G8 P+ n7 K. Y7 G8 p+ gpio_set_value(flow_ctrl_p->gpio, 1);6 _3 ^* G( v; P+ i0 U
+ ndelay(50); /* Propagation delay >= 50ns */
4 x2 S/ ^& }4 v. c1 z: O" t8 }* p+ }4 V( `2 U8 L/ e! R ^
+ }/ }/ I7 w/ h# p N8 k* c+ d% \, O
+#endif) j# N @8 `* U/ D* d# ]4 F8 R
希望对您有帮助。% w1 r5 W: X+ d' }+ o: v' h
|
|