|
您好!tronlong提供的最新的linux3.3内核已经对uart0和uart1做了rs485功能的支持,uart2默认为启动串口。如何想使能uart0和uart1 rs485的功能,只需在menuconfig将485使能。
& \/ |' Q7 w) X *** DaVinci Core Type *** | |$ ^6 h; K" t7 Q/ t0 g
| | [ ] DaVinci 644x based system | |7 P( C7 v) ^( @0 i) s* s
| | [ ] DaVinci 355 based system | |
, M/ P0 D$ A% J% G | | [ ] DaVinci 646x based system | |5 \: e' a" v+ S, b: t1 J
| | [ ] DA830/OMAP-L137/AM17x based system | |
, E' n0 y2 d' U | | [*] DA850/OMAP-L138/AM18x based system | |' P* V8 e+ w0 X
| | [ ] Enable UART1 flow control | |. F& a! d, x3 g, a1 s
| | [ ] Enable UART0 RS485 funcation | |
% |; r4 T5 e! z8 ^3 { | | [*] Enable UART1 RS485 funcation
8 {% @- D: ^( {/ K# u' C5 b1 z& d
想了解详细的功能实现,也可以查看8250.c文件里面的;0 J4 G; c* `% K2 p0 K% W, l
void serial8250_tx_chars(struct uart_8250_port *up)# A% v$ t. I; s/ t, K
return;
( ^# h' E( p3 D# \8 w( @ }
$ q0 [- d$ y0 F% {- C0 [' W; {/ r0 R! j% i% Q, I
+#if 1( b+ [4 i2 \, K; @+ h1 B5 f
+ /* The funcation with RS485 flow control */
; V) T4 l6 B" T7 B! }+ if (up->port.private_data) {7 k* ?8 ?8 t* g9 O& k% o" T
+ struct serial8250_flow_ctrl *flow_ctrl_p;% j0 Y2 r: H( {5 d3 D! P5 ~
+ flow_ctrl_p = up->port.private_data;
$ w3 v8 {) W. w& H7 v+
/ L) V" V* k' y: z! z+ if (flow_ctrl_p->gpio) {
9 n7 d( s' A$ k2 r. G: u2 V+ gpio_set_value(flow_ctrl_p->gpio, 1);
9 e/ ~# W8 x* G v' H8 x/ r+ ndelay(50); /* Propagation delay >= 50ns */
3 a. l# b; c/ R+ u; L+ }
! Z: i% N+ F& ?2 A+ }
, [; c& N7 M `5 @3 m8 h+#endif5 I, X) i: L. t1 u' D
希望对您有帮助。( e$ @$ H# G4 \- Q8 X+ \' l
|
|